473,503 Members | 2,059 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: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:Init xmlns:ns1="http://some.web.service/" SOAP-ENC:root="1">
<authRequest>
<userPwd xsi:type="xsd:string">doug</userPwd>
<userID xsi:type="xsd:string">beta.grolier.doug</userID>
<profileID xsi:type="xsd:string"></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: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:Init xmlns:ns1="http://some.web.service/" SOAP-ENC:root="1">
<ns1:authRequest>
<ns1:userPwd xsi:type="xsd:string">doug</ns1:userPwd>
<ns1:userID xsi:type="xsd:string">beta.grolier.doug</ns1:userID>
<ns1:profileID xsi:type="xsd:string"></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.service/direct/direct.asmx"
ns = "http://some.web.service/"
sa = "http://some.web.service/Init"

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

rsp = server._ns('ns1',
ns).Init(authRequest={'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 2408

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

Similar topics

0
1864
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...
0
1923
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...
1
2589
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
1446
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...
0
2289
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), ...
0
1693
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'...
1
7676
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...
0
1093
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...
1
3900
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...
0
7091
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...
0
7282
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,...
1
6998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5586
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,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4680
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...
0
3171
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...
0
1516
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 ...
0
391
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...

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.