Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Can not parse WSDL file with yaws_soap_lib #65

Closed
gregorej opened this Issue Oct 20, 2011 · 6 comments

Comments

Projects
None yet
3 participants

I've been trying to use YAWS' SOAP lib (old version, can't remember which one) to parse a WSDL file and invoke service operation. However, I could not parse the WSDL property. The WSDL itself is valid (tested on multiple on-line validators). Probably the problem was an empty tag in the WSDL file. Details are here: http://stackoverflow.com/questions/5404926/wsdl-empty-types-tag-and-yaws-soap-support

Right now I am trying to do the same with 1.9.1 version and erlsom 1.2.1. Unfortunately I had no luck. It appears to me that yaws is trying to include files that are not existent (such as soap.xsd, wsdl.xsl) and erlsom can't handle that. The commands I am invoking:

inets:start(),
yaws_soap_lib:initModel(WSDL_FILE_URL)

the error:

** exception error: no match of right hand side value {error,"Include file not found XSD_INDLUDED_IN_WSDL_URL"}
     in function  yaws_soap_lib:addSchemas/5
     in call from yaws_soap_lib:parseWsdls/5
     in call from yaws_soap_lib:initModel2/5

Both urls are available through HTTP

Collaborator

vinoski commented Oct 21, 2011

I'm currently discussing your issue with the author of erlsom, and we're trying to figure out if we can address this and if so what best way to do it would be. Stay tuned.

@willemdj willemdj added a commit to willemdj/yaws that referenced this issue Oct 29, 2011

@willemdj willemdj Allow to pass options to erlsom (fix issue #65) ec553ff

@vinoski vinoski added a commit that referenced this issue Oct 29, 2011

@vinoski vinoski Merge pull request #67 from willemdj/issue_65
Allow to pass options to erlsom (fix issue #65)
1b8546f
Collaborator

vinoski commented Oct 29, 2011

Please try out Willem's changes, they should allow you to do what you're trying to do. Let us know how it goes.

gregorej commented Nov 3, 2011

I've just tried it with newly pulled version but the problem still exists. The only difference I can see are the arities of functions in stack trace:

exception error: no match of right hand side value {error,"Include file not found XSD_INDLUDED_IN_WSDL_URL"}
     in function  yaws_soap_lib:addSchemas/4
     in call from yaws_soap_lib:parseWsdls/4
     in call from yaws_soap_lib:initModel2/5
Collaborator

vinoski commented Nov 3, 2011

You need to make your call differently, which is why Willem made the changes he made. Hopefully Willem will chime in with specific instructions for you.

Contributor

willemdj commented Nov 4, 2011

Yes, Steve is right.

The changes I made allow you to pass a list of options to yaws_soap_lib:initModel(). These options will be passed on to erlsom. One of them can be a reference to a function that fetches the included XSDs.

You can find more about it in the erlsom documentation. In your case, you might try to pass it a reference to a function called find_xsd() in erlsom_lib. Your call could look something like this: yaws_soap_lib:initModel(WSDL_FILE_URL, [{include_fun, {yaws_soap_lib, find_xsd}}]) - I can't guarantee that this will work, but it should be enough to get you started, I hope.

gregorej commented Nov 4, 2011

OK, I've managed to build model with following command:

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

Thanks!

@gregorej gregorej closed this Nov 4, 2011

@jgrinstead jgrinstead pushed a commit to jgrinstead/yaws that referenced this issue Apr 23, 2015

@vinoski vinoski Merge pull request #67 from willemdj/issue_65
Allow to pass options to erlsom (fix issue #65)
7f1b4f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment