[erlang-questions] How combine WSDL along with XSD using erlsom + yaws_soap_lib

Willem de Jong <>
Fri Sep 11 12:14:10 CEST 2015


Hello David,

I had a look at the examples that you provided.

I don't think that it is related to the prefix or the structure of the XSD.
The use of the <sequence>  as one of the alternatives in a <choice> is a
bit strange, but if I modify your "working_test.wsdl" to include a type
with this feature then that works fine.

The example that you provided that gives the error message has some other
differences compared to the working example: the use of the (target-)
namespace is is different (and possibly not correct), and
elementFormDefault is set to "unqualified". It is more likely that the
problem is related to one of these things. Also the types that are declared
in the XSD are not used in the messages, which makes it difficult to do a
proper test.

Can you send me a "real" example of a WSDL that is giving you problems? If
you want you can send it directly to me (so not via the mailing list).

regards,
Willem

On Thu, Sep 10, 2015 at 11:08 AM, David García <>
wrote:

> Hi Wille,
>
> I attach you the WSDL (test.wsdl) I am using. I have tried three ways of
> using this WSDL:
>
>    - first one this same one I am sending you
>    - second one adding the import of the XSD file:
>       - <wsdl:types>
>       -         <xsd:schema targetNamespace="
>       http://www.w3.org/2001/XMLSchema">
>       -             <xsd:import namespace="http://www.w3.org/namespace/"
>       schemaLocation="../wsdl/redsys/consultas/redsys_types.xsd"/>
>       -         </xsd:schema>
>       -     </wsdl:types>
>    - third one, copying all the XSD content into the WSDL file
>
>
> I am using yaws_soap_lib.erl for doing so, along with erlsom library.I
> call the method:
>
> yaws_soap_lib:initModel("WHOLE_PATH_TO_test.wsdl").
>
> I get the message:
>
>  exited: {{shutdown,
>                  {failed_to_start_child,redsys_wsdl_connector,
>                      {{badmatch,
>                           {error,"Group definition not found
> Response/SEQ1"}},
>                       [{yaws_soap_lib,addSchemas,4,
>
>  [{file,"src/lib/yaws_soap_lib.erl"},{line,394}]},
>                        {yaws_soap_lib,parseWsdls,4,
>
>  [{file,"src/lib/yaws_soap_lib.erl"},{line,359}]},
>                        {yaws_soap_lib,initModel2,5,
>
>  [{file,"src/lib/yaws_soap_lib.erl"},{line,331}]},
>                        {redsys_wsdl_connector,init,1,
>                            [{file,"src/redsys/redsys_wsdl_connector.erl"},
>                             {line,29}]},
>                        {gen_server,init_it,6,
>                            [{file,"gen_server.erl"},{line,304}]},
>                        {proc_lib,init_p_do_apply,3,
>                            [{file,"proc_lib.erl"},{line,239}]}]}}},
>
>
> I also have been trying creating a config file to get headers for
> compiling WSDL. I also attach  the config file I have prepared, but still
> can't getting working.
>
> I also attach a WSDL that is working for me with the same source code (the
> only difference is that XSD definition is embeded in the WSDL -- as in the
> third option I have tried with the non working example -- ). This XSD
> definition does not have sequences defined, then I don't have the problem I
> have with the non working WSDL.
>
> Regards,
>
>
> 2015-09-10 8:04 GMT+02:00 Willem de Jong <>:
>
>> Hello David,
>>
>> Yes, it should be possible to use yaws_soap_lib with a WSDL and an XSD,
>> either by importing the XSD or by embedding it in the WSDL.
>>
>> At first sight I would say that the definition of ClassA is valid and
>> should be accepted by erlsom.
>>
>> Can you give a bit more information about what you are doing? Perhaps
>> send me the WSDL and XSD and the commands that you have been trying.
>>
>> Regards,
>> Willem
>>
>> On Wed, Sep 9, 2015 at 7:56 PM, David García <>
>> wrote:
>>
>>>
>>> Would it be possible to combine WSDL along with XSD file when using
>>> yaws_soap_lib?
>>> I have already tried importing XSD from WSDL, as well as copying the
>>> content of the XSD into the WSDL.
>>> Apparently there's a problem with erlsom dealing with sequence
>>> definitions in the XSD file:
>>>
>>>    <element name="ClassA">
>>>         <complexType>
>>>             <choice>
>>>                   <element ref="MoMa" />
>>>                 <sequence minOccurs="0" maxOccurs="unbounded">
>>>                     <element ref="Resp" />
>>>                 </sequence>
>>>                 <element ref="ErrMsg" />
>>>             </choice>
>>>         </complexType>
>>>     </element>
>>>
>>>
>>> I get "*Group definition not found*" for the sequence elements, because
>>> it looks like erlsom uses a default prefix ("P:") for creating internal
>>> structure, but it does not use the prefix in the sequence erlsom internal
>>> structure, then it can not link it.
>>>
>>> I have already tried compiling and adding the XSD model to the WSDL
>>> model using erlsom API methods, but I didn't succeed to get it working.
>>>
>>> Any clue?
>>>
>>> Thanks in advance.
>>>
>>> --
>>> David
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> 
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>>
>>
>
>
> --
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150911/7361c104/attachment.html>


More information about the erlang-questions mailing list