473,695 Members | 2,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SOAPpy : How do I prefix items with a string in a SOAP/XML request?

Hi everyone,

I'm trying to build a program to interface to a SOAP/XML interface
provided by one of our vendors. This interface is built with MS SOAP
Toolkit 3.0, so I'm guessig they are running a .NET server. I'm trying
to build my program with Python as I've got to deploy on both Linux
and Sun/Solaris platforms. I'm developing on RedHat Linux 8.0 using
Python 2.2.1 and SOAPpy 0.10.2.

My experimental program almost works, but it isn't putting a necessary
prefix string on the XML items in the request. Here is the incorrect
request my program is generating:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingSty le="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:Init xmlns:ns1="http ://some.web.servic e/" SOAP-ENC:root="1">
<authRequest>
<userPwd xsi:type="xsd:s tring">doug</userPwd>
<userID xsi:type="xsd:s tring">beta.gro lier.doug</userID>
<profileID xsi:type="xsd:s tring"></profileID>
</authRequest>
</ns1:Init>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is what a working request should look like:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingSty le="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:Init xmlns:ns1="http ://some.web.servic e/" SOAP-ENC:root="1">
<ns1:authReques t>
<ns1:userPwd xsi:type="xsd:s tring">doug</ns1:userPwd>
<ns1:userID xsi:type="xsd:s tring">beta.gro lier.doug</ns1:userID>
<ns1:profileI D xsi:type="xsd:s tring"></ns1:profileID>
</ns1:authRequest >
</ns1:Init>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The difference is the 'ns1:' prefix in front of the userPwd, userID
and profileID items in the XML part of the request. Here is my sample
code that is generating the incorrect SOAP request:

#!/usr/bin/python

from SOAPpy import SOAPProxy
from SOAPpy import SOAPConfig

url = "http://some.web.servic e/direct/direct.asmx"
ns = "http://some.web.servic e/"
sa = "http://some.web.servic e/Init"

server = SOAPProxy(url, namespace=ns, soapaction=sa,
config=SOAPConf ig(debug=1))

rsp = server._ns('ns1 ',
ns).Init(authRe quest={'userID' :'beta.grolier. doug', 'userPwd':'doug ',
'profileID':''} )

print "I'm outta here"

The degug=1 flag makes the program dump the XML requests/responses,
but then it crashes with a traceback because the message I'm getting
back is the server error message, not the expected response.

Does anyone have any ideas/suggestions on how I can tell the SOAPpy
module to add the 'ns1:' prefix to the the items in the request?

Thanks for your help,
Doug Farrell
Jul 18 '05 #1
0 2422

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1873
by: Harry George | last post by:
I'm trying to setup a SOAPpy service under xinetd. Has someone done this sort of thing? Didn't find it from google searches or documentation. This is probably a sockets-level issue, but I was hoping someone in python land had done this with SOAPpy before. The server works fine as simple SOAP server and client pair on localhost. But when I try to put it under xinetd, it fails. Using "xinetd -d" I can see it is failing due to address...
0
1938
by: elsarfhem | last post by:
I have a problem with soappy when i try to send a python dictionary... i send something like this {'1':2,'3':4} and it returns something like this {'1':, '3':4} function on the server is simply an echo: def echo(arg): return arg i post the soap message, it may be useful... *** Incoming HTTP headers **********************************************
1
2615
by: Jim | last post by:
Hi all, I am new to SOAP and Python. I am practicing learning SOAP with Python. I sent a request and I got the following response: <SOAPpy.Types.structType HashStringResponse at 23909440>: {}
0
1457
by: giblfiz | last post by:
I'm having difficulty sending out correctly named method parameters to a php soap server that I am running using SOAPpy. Idealy I would like to send XML that looks like this (which I cribbed from another client that works just fine) <SOAP-ENV:Body> <ns1:login xmlns:ns1="http://testuri.org"> <user_auth> <user_name xsi:type="xsd:string">
0
2301
by: Bartas | last post by:
Hi, I'am writting a simple SOAP client in python (2.4) using SOAPpy lib. I've met with this problem: when I want to send a list of complex type using some method from WebService(java,WAS), I'v got an exception:
0
1718
by: Max QRO | last post by:
I have created a web service in C# that needs to receive a SOAP request from some system I have no control over. An example of the SOAP request is given below:- <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body>
1
7690
by: icius | last post by:
Hello all, I am trying to use a web services API with Python and SOAPpy as a client. Some of the method paramters in this web service's WSDL are asking for an "ArrayOfString" type. Here is my code so far: #!/usr/bin/python from SOAPpy import WSDL
0
1104
by: Alex Ezell | last post by:
Can anyone offer any assistance as to how to convert a basic python dictionary, list, or even tuple into the SOAP type "ArrayOfKeyValue"? I am currently using SOAPpy, but would be willing to change to ZSI or something else if it made this conversion easier. I have tried with the arrayType and structType methods in SOAPpy.Types, yet they don't seem to do what I need. I suspect there might not be just a single method call, so, I wrote...
1
3914
by: sberry | last post by:
I have an Adobe InDesign server running that includes a built-in SOAP server. The wsdl is located here: http://www.seanberry.com/IDSP.wsdl. I have a PHP example that looks like this for calling the SOAP function runScriptParameters //--------------------------------------------------------------------------- $scriptArgs = array(); $scriptArgs = array("name" ="myVarName", "value" ="myVarValue");
0
8574
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7664
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5839
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4580
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1977
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.