I try to figure out how to build a soap service with spyne to this kind of request:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:MyService">
<soapenv:Header/>
<soapenv:Body>
<urn:test_rpc soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<urn:in0>test</urn:in0>
</urn:test_rpc>
</soapenv:Body>
</soapenv:Envelope>
My Testmethod looks like this:
@spyne.srpc(Unicode, _return=Result, _in_variable_names={"input": 'in0'}, _body_style='wrapped')
def test_rpc(input):
return Result()
When I send my requests the soap service respond with following Webfault:
Server raised fault: ':1:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_3_2_1: Element '{urn:MyService}test_rpc', attribute '{http://schemas.xmlsoap.org/soap/envelope/}encodingStyle': The attribute '{http://schemas.xmlsoap.org/soap/envelope/}encodingStyle' is not allowed.'
How can I fix this without removing the encodingStyle? The section 4.1.1 of the Simple Object Access Protocol (SOAP) 1.1 W3C Note (http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383495) notes that "This attribute[encodingStyle] MAY appear on any element, ..."
As of 2.11, Spyne doesn't support encodingStyle attribute.
If you want to implement it:
spyne.interface.xml_schema
accomodate itIf you want to work around it:
ctx.in_object
according to information in ctx.in_document
in a 'method_call'
event.You can chime in at http://lists.spyne.io/listinfo/people for further discussion.
HTH,