<div dir="ltr"><p>Hi Corrado,</p>
<p>There are two variants of yaws_soap_lib:call() : 1 where you pass the arguments<br>as a list, and one where you pass it a list of records. You have been using the<br>first variant. This is just a rather simplistic wrapper around the 2nd variant:<br>
it is translated to yaws_soap_lib:call(.., Operation, [{list_to_atom(Operation,<br>[], <the list of argumments as elements of the tuple>}], ...). It only works of<br>the soap body has 1 'part', and if the name of this part is identical to the<br>
name of the operation. In your test, neither is true.</p>
<p>You could try to call the service as:</p>
<p>yaws_soap_lib:call(M, "add", [], [{'p:in0', [], 1}, {'p:in1', [],  2}]).</p>
<p>or (after creating record definitions with yaws_soap_lib:write_hrl()):</p>
<p>yaws_soap_lib:call(M, "add", [], [#'p:in0'{'in0' = 1}, #'p:in1'{'in1' = 2}]).</p>
<p>With the version of yaws_soap_lib on my PC, this works. It may not work with<br>the software in the distribution, because I have made several changes to fix<br>various issues. Let me know if it doesn't work, I'll send you a new<br>
version of the code.</p>
<p>Note: for a simple service like your test the records don't make much sense,<br>but in my experience soap services often take a fairly complex XML as argument, <br>and in such cases the records are convenient (I think, anyway).</p>

<p>Note 2: It is unfortunate that nobody takes care of the yaws soap code...<br>Personally I don't manage to take care of the improvements and the maintenance<br>that the server side actually requires. It is not my area of expertise, I don't<br>
know how to test this kind of stuff efficiently, I don't understand the source<br>code control system etc., and I don't have the time to change all that.</p>
<p>For the client side it is a bit easier, since this only depends on erlsom. I<br>think I'll include a new version of the soap client with the next version of<br>erlsom (whenever that may be...).</p>
<div>Regards,</div>
<div>Willem<br><br></div>
<div class="gmail_quote">2008/7/18 Corrado Santoro <<a href="mailto:csanto@diit.unict.it">csanto@diit.unict.it</a>>:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi all,<br><br>I'm a SOAP/SW newbie and I'm trying to use yaws as a client for a web service.<br><br>
This is what happens after I initialize the model and try to call a service.<br><br>19> yaws_soap_lib:call(M, "add", [1, 2]).<br><br>=ERROR REPORT==== 18-Jul-2008::13:59:49 ===<br>Error in process <0.60.0> with exit value: {{nocatch,{error,"Struct doesn't match model: recordtype not expected: p:add"}},[{erlsom_write,findAlternative,4},{erlsom_write,processSubType,5},{erlsom_write,processElementValues,7},{erlsom_write,struct2xml,6...<br>
<br>The wsdl file has been generated from a Java interface using java2wsl. This is the java interface:<br><br>public interface Test {<br> public int add (int x, int y);<br>}<br><br><br>I've generated the WSDL (which is attached to this message) using DOCUMENT and LITERAL encodig.<br>
<br>Any suggestions??<br><br>thanks.<br>--Corrado<br><br><br>-- <br>==================================================================<br>Eng. Corrado Santoro, Ph.D.<br>University of Catania - ITALY - Engineering Faculty<br>
<br>Tel: +39 095 7382380        VoIP: <a href="mailto:sip%3A7035@voicegw2.diit.unict.it" target="_blank">sip:7035@voicegw2.diit.unict.it</a><br><br>Personal Home Page: <a href="http://www.diit.unict.it/users/csanto" target="_blank">http://www.diit.unict.it/users/csanto</a><br>
   NUXI Home Page: <a href="http://nuxi.diit.unict.it/" target="_blank">http://nuxi.diit.unict.it</a><br>==================================================================<br><br><br>_______________________________________________<br>
erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>