sagarnigade / pysimplesoap

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

wrong namespace and prefix in response - web2py #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create web service in web2py
@service.xmlrpc
@service.soap('_SEARCH',
              returns={'RESULT_COUNT':str},
              args={...})
def search(args...):
    return {'RESULT_COUNT':'42'}

2. call web service (I call it from a pl/sql routine in Oracle
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
        <m:_SEARCH xmlns:m="urn:sap-com:document:sap:rfc:functions" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding">
...
        </m:_SEARCH>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

3. this is the Resonse:

What is the expected output? What do you see instead?
this is the expected output:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:m="http://192.168.139.1:8100/soap/default/call/soap" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
        <m:_SEARCHResponse xmlns:m="urn:sap-com:document:sap:rfc:functions">
            <RESULT_COUNT>42</RESULT_COUNT>
        </m:_SEARCHResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

this is what i get
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:m="http://192.168.139.1:8100/soap/default/call/soap" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
        <_SEARCHResponse xmlns="m">
            <RESULT_COUNT>42</RESULT_COUNT>
        </_SEARCHResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

so the namespace seem to be recognized, but not used for the response 

What version of the product are you using? On what operating system?
web2py 2.9.11-stable on Mac OS X 10.10.1

any hints ?
thank you and kind regards,
Sven

Original issue reported on code.google.com by sven.tis...@gmail.com on 17 Dec 2014 at 2:30

GoogleCodeExporter commented 9 years ago
Sorry for the delay, I confirmed this one (only occurs when using a prefix) but 
couldn't take a look at this sooner.

Attached is a patch to fix the web2py pysimplesoap server version, basically in 
server.py you can replace the line no 238:

res = body.add_child("%sResponse" % name, ns=prefix)

with

res = body.add_child("%sResponse" % name, ns=self.namespace)

I'll fix this in the repo, and do a PR to web2py, it would be great if you can 
confirm this solves your issue.

Original comment by reingart@gmail.com on 23 Dec 2014 at 7:49

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 23ba389cb15f.

Original comment by reingart@gmail.com on 23 Dec 2014 at 7:52

GoogleCodeExporter commented 9 years ago
thanks you for the response and the patch - I will confirm the solution as soon 
as I am back to work (5th Jan 2015)

Thank you and happy new year !

Original comment by sven.tis...@gmail.com on 28 Dec 2014 at 11:47