kartagis / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

WSDL fixer function #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The universe isn't perfect, nor is the WSDL for a webservice I have to deal 
with.  There should be a way to fixup the incoming WSDL so that pysimplesoap 
will behave correctly. SUDS does this with 'doctors', which seems a reasonable 
idea. Something like:

client = SoapClient(wsdl=wsdlurl, wsdl_fixer=myfunc)

such that myfunc would be called with the retrieved wsdl (perhaps already 
parsed into a SimpleXMLElement tree?) and expected to return the same thing it 
was passed in, but fixed up to the user's liking.

Original issue reported on code.google.com by pjimen...@gmail.com on 16 Jun 2011 at 6:23

GoogleCodeExporter commented 8 years ago
Can you provide an example of such fixer function?

Maybe it its easier to fix the python representation (pickled) than the xml.

An use case (with examples) would be great, anyway, if this is optional and 
does not broke anything it will be feasible, I'm open to new ideas ;-) 

Original comment by reingart@gmail.com on 16 Jun 2011 at 9:05

GoogleCodeExporter commented 8 years ago
Sure, a simple one: One WSDL I have to deal with claims that it's okay for 
certain elements to not appear (ie. minOccurs=0, nillable=true) even though in 
practice it 500s if that's the case. My solution is to 'fix up' the WSDL by 
forcing minOccurs=1 and nillable=false on those elements.

Though I must admit I'm not sure that's a viable solution with pysimplesoap 
because I'm not sure it pays attention to minOccurs and nillable anyway :)

Original comment by pjimen...@gmail.com on 20 Jun 2011 at 4:08

GoogleCodeExporter commented 8 years ago
I think it is better to fix wsdl_parse, as it is not paying attention to 
minOccurs nor nillable.

See a maxOccurs code:
http://code.google.com/p/pysimplesoap/source/browse/pysimplesoap/client.py#583

This is related to issue 31, where the server expect empty tags and the client 
doesn't send them if they are None values.

Original comment by reingart@gmail.com on 20 Jun 2011 at 6:58

GoogleCodeExporter commented 8 years ago

Original comment by oczk...@gmail.com on 17 Aug 2013 at 7:47

GoogleCodeExporter commented 8 years ago
You could fix already parsed WSDL, see 
https://code.google.com/p/pysimplesoap/wiki/SoapClient#Fixing_broken_WSDL

As there are schema imports and similar, there is no unified xml or object to 
fix (except the processed services)

Although wsdl_fixer would be convenient, it may be better adding the special 
handling in the wsdl parser, so the fixes are more permanent and more dialects 
can be supported (see latest jetty, axis, mcf, etc. workaround included)

Original comment by reingart@gmail.com on 22 Jan 2014 at 2:21