SOAP using ZSI talking to .NET Web Service

R

Russell

Using Python 2.3 and ZSI 1.2 I am having problems getting information
back from a test web service running on a PC on our LAN.

The SOAP request details (from the .asmxfile) are as follows:

POST /rjetest/rjetestservice.asmx HTTP/1.1
Host: grouse
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://RJE.com/RJETestItDoc"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<RJETestItDoc xmlns="http://RJE.com">
<i>int</i>
<extra>string</extra>
</RJETestItDoc>
</soap:Body>
</soap:Envelope>

and the response details (from the .asmx) are:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<RJETestItDocResponse xmlns="http://RJE.com">
<RJETestItDocResult>string</RJETestItDocResult>
</RJETestItDocResponse>
</soap:Body>
</soap:Envelope>


The Python program is:

import sys
from ZSI.client import Binding, TC

class fooRequest:
def __init__(self, i, extra):
self.i = i
self.extra = extra

fooRequest.typecode = TC.Struct(fooRequest, [TC.Integer('i'),
TC.String('extra')], 'RJETestItDoc')


url1 = 'http://grouse/rjetest/rjetestservice.asmx'
soapaction ='http://RJE.com/RJETestItDoc'
namespace = 'http://RJE.com'

host = 'grouse'
port = 80

dict = {
'soap' : 'http://schemas.xmlsoap.org/wsdl/soap/',
's' : 'http://www.w3.org/2001/XMLSchema',
's0' : 'http://RJE.com',
'http' : 'http://schemas.xmlsoap.org/wsdl/http/',
'tm' : 'http://microsoft.com/wsdl/mime/textMatching/',
'mime' : 'http://schemas.xmlsoap.org/wsdl/mime/',
'soapenc' : 'http://schemas.xmlsoap.org/soap/encoding/'
}
i = 10
extra = 'A lovely day at the office'

b = Binding(url=url1, ns=namespace, host=host, port=port, nsdict=dict,
soapaction=soapaction, tracefile=sys.stdout)
b.Send(url1, 'RJETestItDoc', fooRequest(i, extra))
x = b.ReceiveSOAP()


The SOAP response via the Python program is:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><RJETestItDocResponse
xmlns="http://RJE.com">
<RJETestItDocResult>********** A lovely day at the office
**********</RJETestItDocResult>
</RJETestItDocResponse></soap:Body></soap:Envelope>

and looks fine (to me anyway).

However... I can't figure out how to get the text from response. Any
advice would be very much appreciated. The input values are being
correctly received by the web service.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top