[Soap-Python] soaplib: patch: out_type list

Burak Arslan burak.arslan at arskom.com.tr
Thu Oct 7 14:01:55 CEST 2010


 Hello Raymond,

Thank you very much for the patch, the test case and the detailed
explanation. Your work will be integrated to both 1.0 and trunk branches
and will be shipped in the next releases.

Best regards,
Burak

ps: be sure to subscribe to soap at python.org (cc'd) to make sure you get
the latest news about python-related soap matters.


On 10/06/10 18:13, Raymond Penners wrote:
> Hi,
>
> I am implementing a soap service with a predefined (legacy) WSDL in
> python using soaplib. I ran into an issue for which I have cooked up a
> patch that I would like to hear your opinion on.
>
> The WSDL is defined in such a way that when you invoke a "getRoles"
> method one must return a SOAP response with the out parameters
> directly embedded into the <getRolesResponse>, not in a
> <getRolesResult> (nested in the <getRolesResponse>).
>
> So I dove into soaplib internals and found out this could be
> accomplished like this:
>
> class SomeService( DefinitionBase):
>     @rpc(String, Integer, _returns=[Integer, String, Integer,
> Array(Enum("MEMBER", type_name="role"))],
>          _out_variable_names=['resultCode','resultDescription','transactionId',
> 'roles' ])
>     def getRoles(self, token, userId):
>         return [1, "Test", 123, ["MEMBER"]]
>
> However, when attempting to invoke a call using the above service I
> run into an assert (for both 1.0.0-beta6 and 2.0 alpha):
>
> assert len(out_type) == 1   # __handle_soap_request of wsgi.py (soaplib 1.0.0)
>
> I have patched the code (soaplib 1.0) and it is now working properly.
> Is the patch the proper way to address this problem? And if so, could
> you please patch this upstream?
>
> Thanks,




More information about the Soap mailing list