SOAP using ZSI talking to .NET Web Service

Russell Russell.Every at MentumGroup.com
Wed Aug 20 03:34:45 EDT 2003


And the anwer is, as shown in the working code below.  Basically it
involved setting up a class for the response and parsing the SOAP
object.

import sys
from ZSI.client import Binding
from ZSI import *

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

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

class Response:
	def __init__(self, RJETestItDocResult):
		self.RJETestItDocResult = RJETestItDocResult

	def __str__(self):
		return self.RJETestItDocResult

Response.typecode = TC.Struct(Response,
[TC.String('RJETestItDocResult')], 'RJETestItDocResponse')

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

host = 'XXX' # Set this to your proxy host
port = nnn   # Set this to the appropriate port on the proxy
dict = {}

i = 5
extra = 'A lovely day at the office'
trace = sys.stdout

b = Binding(url=url1, ns=namespace, host=host, port=port, nsdict=dict,
soapaction=soapaction, tracefile=trace)
b.Send(None, 'RJETestItDoc', Request(i, extra))
obj = b.ReceiveSOAP()
answer =  obj.Parse(Response)




More information about the Python-list mailing list