Jonathan Morgan jmorgan at
Wed Oct 4 13:21:06 CEST 2006


I'm just started playing around with Python to trigger a method in a web service.  I've been using SOAPpy and it's incredibly badly documented so i'm not getting very far.

What I need to do is create the following in my SOAP body:

	<n1:myMethod xmlns:n1="">
		<n1:address xmlns:n1="">MyAddress</n1:address>
	</n1:myMethod >

I've managed to kinda do something similar to this with the following piece of code:

	from SOAPpy import SOAPProxy

	wsdlurl = ''

	# define the namespace 
	namespace = ''

	server = SOAPProxy(wsdlurl) 

	print 'Test: ' + server._ns(namespace).myMethod(address = "MyAddress")

This creates the following SOAP XML:

	<ns1:myMethod xmlns:ns1="" SOAP-ENC:root="1">
      	<address xsi:type="xsd:string">MyAddress</address>

I need to be able to add a namespace to the address parameter so it matches the previous SOAP XML above (n1:address, xmlns, etc.) and, what with Python being new to me and SOAPpy having awful docs, I can't figure out how to do this. 

Could anyone please help here?



Information contained in this e-mail and any attachments are intended for the use of the addressee only, and may contain confidential information of Ubiquity Software Corporation.  All unauthorized use, disclosure or distribution is strictly prohibited.  If you are not the addressee, please notify the sender immediately and destroy all copies of this email.  Unless otherwise expressly agreed in writing signed by an officer of Ubiquity Software Corporation, nothing in this communication shall be deemed to be legally binding.  Thank you.

More information about the Python-list mailing list