[erlang-questions] yaws_soap_lib question

Willem de Jong w.a.de.jong@REDACTED
Fri Jul 18 21:43:22 CEST 2008


Hi Corrado,

There are two variants of yaws_soap_lib:call() : 1 where you pass the
arguments
as a list, and one where you pass it a list of records. You have been using
the
first variant. This is just a rather simplistic wrapper around the 2nd
variant:
it is translated to yaws_soap_lib:call(.., Operation,
[{list_to_atom(Operation,
[], <the list of argumments as elements of the tuple>}], ...). It only works
of
the soap body has 1 'part', and if the name of this part is identical to the
name of the operation. In your test, neither is true.

You could try to call the service as:

yaws_soap_lib:call(M, "add", [], [{'p:in0', [], 1}, {'p:in1', [],  2}]).

or (after creating record definitions with yaws_soap_lib:write_hrl()):

yaws_soap_lib:call(M, "add", [], [#'p:in0'{'in0' = 1}, #'p:in1'{'in1' =
2}]).

With the version of yaws_soap_lib on my PC, this works. It may not work with
the software in the distribution, because I have made several changes to fix
various issues. Let me know if it doesn't work, I'll send you a new
version of the code.

Note: for a simple service like your test the records don't make much sense,
but in my experience soap services often take a fairly complex XML as
argument,
and in such cases the records are convenient (I think, anyway).

Note 2: It is unfortunate that nobody takes care of the yaws soap code...
Personally I don't manage to take care of the improvements and the
maintenance
that the server side actually requires. It is not my area of expertise, I
don't
know how to test this kind of stuff efficiently, I don't understand the
source
code control system etc., and I don't have the time to change all that.

For the client side it is a bit easier, since this only depends on erlsom. I
think I'll include a new version of the soap client with the next version of
erlsom (whenever that may be...).
Regards,
Willem

2008/7/18 Corrado Santoro <csanto@REDACTED>:

> Hi all,
>
> I'm a SOAP/SW newbie and I'm trying to use yaws as a client for a web
> service.
>
> This is what happens after I initialize the model and try to call a
> service.
>
> 19> yaws_soap_lib:call(M, "add", [1, 2]).
>
> =ERROR REPORT==== 18-Jul-2008::13:59:49 ===
> 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...
>
> The wsdl file has been generated from a Java interface using java2wsl. This
> is the java interface:
>
> public interface Test {
>  public int add (int x, int y);
> }
>
>
> I've generated the WSDL (which is attached to this message) using DOCUMENT
> and LITERAL encodig.
>
> Any suggestions??
>
> thanks.
> --Corrado
>
>
> --
> ==================================================================
> Eng. Corrado Santoro, Ph.D.
> University of Catania - ITALY - Engineering Faculty
>
> Tel: +39 095 7382380        VoIP: sip:7035@REDACTED<sip%3A7035@REDACTED>
>
> Personal Home Page: http://www.diit.unict.it/users/csanto
>    NUXI Home Page: http://nuxi.diit.unict.it
> ==================================================================
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080718/e5e48337/attachment.htm>


More information about the erlang-questions mailing list