472,371 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

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 2312

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

Similar topics

0
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
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
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
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
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
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
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
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
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
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.