Search code examples
soaperlangwsdlyaws

WSDL empty <types> tag and YAWS SOAP support


I am trying to invoke a WebService through SOAP using Erlang and YAWS (yaws_soap_lib module specifically). The examples published on http://yaws.hyber.org/soap_intro.yaws work for me.

However, when trying to invoke my own web service YAWS fails. The first problem were partner links in the WSDL that were put there because of BPEL is befind this service. I deleted them (for now).

Unfortunately, I've come across another problem: mentioned WSDL has an empty <types> tag. Now, I am not very familiar with WSDL specification and SOAP so my question is whether it is

  1. Erlang SOAP library issue that cannot handle empty <types> tag or
  2. badly generated WSDL?

Does anyone know any better Erlang library for handling SOAP? I have taken a look at erlsoap but it does not support WSDLs.

EDIT: error caused by mentioned WSDL:


::error:function_clause
  in function erlsom_add:add_model/2
    called as add_model({model,[{type,'_document',sequence,
              [{el,[{alt,'soap:Envelope','soap:Envelope',...},
                    {alt,'soap:Header',...},
                    {alt,...},
                    {...}],
                   1,1,1}],
              [],undefined,undefined,1,1,1,false,...},
        {type,'soap:detail',sequence,
              [{el,[{alt,'#any',...},{alt,...},{...}|...],0,unbound,1}],
              [],
              {anyAttr,"lax","##any",[...]},
              undefined,2,1,1,...},
        {type,'soap:Fault',sequence,
              [{el,[{alt,...}],1,1,...},
               {el,[{...}],1,...},
               {el,[...],...},
               {el,...}],
              [],undefined,undefined,5,1,...},
        {type,'soap:Body',sequence,
              [{el,[{...}|...],0,...}],
              [],
              {anyAttr,[...],...},
              undefined,2,...},
        {type,'soap:Header',sequence,
              [{el,[...],...}],
              [],
              {anyAttr,...},
              undefined,...},
        {type,'soap:Envelope',sequence,[{el,...},{...}|...],[],{...},...}],
       [{ns,"http://schemas.xmlsoap.org/soap/envelope/","soap"},
        {ns,"http://www.w3.org/2001/XMLSchema","xsd"}],
       "http://schemas.xmlsoap.org/soap/envelope/",[]},undefined)
  in call from yaws_soap_lib:initModel2/5

For those who are familiar with the source code: The problem is the Xsds array returned by getXsdsFromWsdl function is empty.


Solution

  • The issue has been resolved in latest YAWS version. In order to construct mentioned WSDL model following command has to be invoked:

    yaws_soap_lib:initModel(WSDL_FILE_URL, [{include_fun, {erlsom_lib, find_xsd}}])