sagarnigade / pysimplesoap

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

namespace issue #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the following code to compare with suds:

from suds.client import Client
from pysimplesoap.client import SoapClient

WSDL = 'http://globe-meta.ifh.de:8080/axis/services/ILDG_MDC?wsdl'

print "Using suds"
service = Client(WSDL).service
print service.doEnsembleURIQuery("Xpath", "/markovChain", 0, -1)

print "Using pysimplesoap"
service = SoapClient(wsdl=WSDL, trace=True)
print service.doEnsembleURIQuery("Xpath", "/markovChain", 0, -1)

Suds works fine. pysimplesoap has two problems:
1) problem one, it sets TIMEOUT = 60 and this triggers an exception. I set it 
to None to move on
2) I obtain the following error:

...
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fau
lt><faultcode 
xmlns:ns1="http://xml.apache.org/axis/">ns1:Client</faultcode><faultstring>No 
such operation 'doEnsembleURIQueryRequest'</faultstring><detail><ns2:hostname 
xmlns:ns2="http://xml.apache.org/axis/">dysis.ifh.de</ns2:hostname></detail></so
apenv:Fault></soapenv:Body></soapenv:Envelope>
================================================================================
Traceback (most recent call last):
  File "test.py", line 12, in <module>
    print service.doEnsembleURIQuery("Xpath", "/markovChain", 0, -1)
  File "/Users/massimodipierro/Dropbox/PythonPrograms/myGridFTP/pysimplesoap/client.py", line 140, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr,*args,**kwargs)
  File "/Users/massimodipierro/Dropbox/PythonPrograms/myGridFTP/pysimplesoap/client.py", line 289, in wsdl_call
    response = self.call(method, *params)
  File "/Users/massimodipierro/Dropbox/PythonPrograms/myGridFTP/pysimplesoap/client.py", line 188, in call
    raise SoapFault(unicode(response.faultcode), unicode(response.faultstring))
pysimplesoap.client.SoapFault: ns1:Client: No such operation 
'doEnsembleURIQueryRequest'

It seems to be using the namespace="ns1:Client" but according to the WSDL it 
should be "urn:mdc.ildg.lqcd.org"

Original issue reported on code.google.com by massimo....@gmail.com on 2 Aug 2013 at 8:05

GoogleCodeExporter commented 9 years ago
I have learned something more about this...
In both cases I call service.doEnsembleURIQuery
suds translates this into:
   <doEnsembleURIQuery xmlns="....">....<doEnsembleURIQuery>
while pysimplesoap translates it into
   <doEnsembleURIQueryRequest xmlns="....">....<doEnsembleURIQueryRequest>
See the extra "Request"? that break it and the server does not respond.

Original comment by massimo....@gmail.com on 2 Aug 2013 at 10:08

GoogleCodeExporter commented 9 years ago
I fixed it. There is no problem in your code. The problem is that axis is DUMB:

service = SoapClient(wsdl=WSDL,soap_server='axis')

Original comment by massimo....@gmail.com on 2 Aug 2013 at 10:15

GoogleCodeExporter commented 9 years ago
You can close this. Thanks again for pySimpleSoap.

Original comment by massimo....@gmail.com on 2 Aug 2013 at 10:15

GoogleCodeExporter commented 9 years ago
About namespaces, I'm working to enhance the wsdl parser.
Current approach works most times, but some new webservices (specially .NET4 ) 
uses a very complicated namespace scheme, with similar names and other 
conflicts, that could cause some issues

About the soap_server, yes, there are some special cases and I didn't found a 
reliable way to detect it automagically, so it should be better documented 
somewhere.

Anyway, thanks you for using pysimplesoap ;-) 
I've added you to commiter list, just in case you need to modify tickets, wiki 
or code. 

Original comment by reingart@gmail.com on 2 Aug 2013 at 2:26

GoogleCodeExporter commented 9 years ago
There is a problem with multiRefs and arrays, please see the latest commits to 
trunk

Original comment by reingart@gmail.com on 3 Aug 2013 at 4:48

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 79a5176fd70d.

Original comment by reingart@gmail.com on 3 Aug 2013 at 4:57