soap icon indicating copy to clipboard operation
soap copied to clipboard

Error when parsing a WSDL

Open js-ojus opened this issue 7 years ago • 7 comments

When using soap:wsdl2erlang(...). on http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl, I get the following.

** exception error: no function clause matching 
                    soap_parse_wsdl:'-services/1-lc$^0/1-0-'(undefined) (src/soap_parse_wsdl.erl, line 116)
     in function  soap_parse_wsdl:get_services/3 (src/soap_parse_wsdl.erl, line 107)
     in call from soap_parse_wsdl:get_services/3 (src/soap_parse_wsdl.erl, line 112)
     in call from soap:wsdl2erlang/2 (src/soap.erl, line 305)

A little investigation shows that erlsom:scan(...) is returning a bunch of undefined elements for the imported document at http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl=wsdl0.

So, it is possible that this is erlsom's problem. Or, it could be a problem with the model being passed to erlsom:scan.

In any case, could you take a look at this, please? All help is appreciated. Thanks!

js-ojus avatar Sep 14 '16 07:09 js-ojus

Bumping this, because of urgency at my end! My apologies!

Could this be an erlsom issue @willemdj?

js-ojus avatar Sep 16 '16 07:09 js-ojus

I think that it is more likely to be caused by a somewhat unusual structure of the WSDL. You could for example try to replace the bit

<wsdl:import namespace="http://tourico.com/webservices/hotelv3" location="http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl=wsdl0"/> <wsdl:types/>

by the contents (the wsdl:types part) of http://demo-hotelws.touricoholidays.com/HotelFlow.svc?wsdl

willemdj avatar Sep 16 '16 08:09 willemdj

Thanks for your quick reply @willemdj!

I have downloaded both WSDLs, modified the main one to include the imported types. When this modified version is given as input, the referred XSDs are no longer being fetched from the net.

** exception error: no match of right hand side value {error,
                                                       "Include file not found http://demo-hotelws.touricoholidays.com/HotelFlow.svc?xsd=xsd0"}
     in function  soap_parse_wsdl:add_schemas/5 (src/soap_parse_wsdl.erl, line 215)
     in call from soap_parse_wsdl:parse_wsdls/3 (src/soap_parse_wsdl.erl, line 148)
     in call from soap_parse_wsdl:file/4 (src/soap_parse_wsdl.erl, line 80)
     in call from soap_parse_wsdl:get_model/2 (src/soap_parse_wsdl.erl, line 55) 
     in call from soap_parse_wsdl:get_namespaces/2 (src/soap_parse_wsdl.erl, line 66)
     in call from soap:wsdl2erlang/2 (src/soap.erl, line 313)

I am still looking into this, but posting the update here!

js-ojus avatar Sep 17 '16 03:09 js-ojus

Same issue here. It looks like the imported types, which are given as remote resources ("http://...") are not downloaded. It appears that soap expects them to be located in the local file system. Any prognosis on how difficult it would be to produce a fix?

mkrogemann avatar Nov 07 '16 19:11 mkrogemann

Hi,

I don't think that is the problem, it should get remote resources as well.

I do recognize that there is a problem with the WSDL that the original issue refers to. This is related to the complex structure of that WSDL. Assuming that you are trying to process a different WSDL, could you let me know what error you are getting, and if possible also provide the files?

Thanks, Willem

willemdj avatar Nov 09 '16 08:11 willemdj

The error that I get is that included XSDs appear to be expected in local file system. I'll open another issue.

mkrogemann avatar Nov 09 '16 09:11 mkrogemann

Apologies for disappearing!

The problem indeed was with the WSDL. It got resolved after I upgraded a later version of the API, with an updated WSDL.

Nonetheless, I could make calls using the original WSDL from Python. So, soap did have some problem fetching the referenced WSDLs.

js-ojus avatar Dec 20 '16 13:12 js-ojus