[Twisted-Python] WSDL Proxy Send variable names

Hi, I need to be able to send variable names when sending requests to a SOAP server. Currently SOAPpy sends my variables automatically named as v1, v2, v3. The server requires they have a name varNameA, varNameB etc. Here is my outgoing SOAP and code. wsdlFile = "http://webapi.allegro.pl/uploader.php?wsdl" server = WSDL.Proxy(wsdlFile) server.doGetCountries(1, h23dk99sd) *** Outgoing SOAP ****************************************************** <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi=" http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/1999/XMLSchema"> <SOAP-ENV:Body> <ns1:doGetCountries xmlns:ns1="urn:AllegroWebApi" SOAP-ENC:root="1"> <v1 xsi:type="xsd:int">1</v1> <v2 xsi:type="xsd:string">h23dk99sd</v2> </ns1:doGetCountries> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ************************************************************************ This is what the variable area should look like: <country-code xsi:type="xsd:int">1</country-code> <webapi-key xsi:type="xsd:string">h23dk99sd</webapi-key> How do i accomplish this? (Wrapping it in a dictionary only sends the dictionary as v1) Thank you!

On Tue, Mar 2, 2010 at 5:20 AM, Kamil Wasilewski <kamil@lucem.pl> wrote:
Hi, I need to be able to send variable names when sending requests to a SOAP server. Currently SOAPpy sends my variables automatically named as v1, v2, v3. The server requires they have a name varNameA, varNameB etc. Here is my outgoing SOAP and code.
I played around with SOAPpy a couple months ago; I'm fairly sure that it does order-based parameters by default and I don't remember finding a way to use named parameters. There is another SOAP library called ZSI that might have that (it's not integrated with Twisted though).

On Tue, Mar 2, 2010 at 3:48 PM, Landreville <landreville@deadtreepages.com>wrote:
On Tue, Mar 2, 2010 at 5:20 AM, Kamil Wasilewski <kamil@lucem.pl> wrote:
Hi, I need to be able to send variable names when sending requests to a SOAP server. Currently SOAPpy sends my variables automatically named as v1, v2, v3. The server requires they have a name varNameA, varNameB etc. Here is my outgoing SOAP and code.
I played around with SOAPpy a couple months ago; I'm fairly sure that it does order-based parameters by default and I don't remember finding a way to use named parameters.
There is another SOAP library called ZSI that might have that (it's not integrated with Twisted though).
Yes it does order them correctly if you just call server.doFunction(param1, param2), but assignes them names v1, v2.. But i found a way to name (and order) them http://ungil.com/remedy/webservices.html # Define the order of args: needed for this service server.config.argsOrdering = {'doFunction': ('id', 'code') } response = server.doFunction(code=sc, id=gi ) Notice however that i need to name my parameters with a '-' in the middle: country-code, webapi-key and the above naming method gives me errors. if the variables were country_code it would be a different story. Any idea how to get around this? Thanks
participants (2)
-
Kamil Wasilewski
-
Landreville