Soap Client

D

DougJrs

Good Evening Everyone,

I am working to create a Soap client in Python using wsdl2py. So far
I have been pretty successful in creating most of the client, but I am
having trouble figuring out how to change the content of the message
that is being sent.

After running wsdl2py I have created this client code:

import OnlineQuery_client as QC

loc QC.QueryLocator()
srv = loc.getOnlineQuerySoap()
msg = QC.querySoapIn()
rep = srv.query(msg)


I would like to change the message that is being sent to something
like this (soap headers excluded below, but they would be in the
actual message, and the xml would be escaped.)
"<request><GetEventList><Month>1</Month></GetEventList></request>".

wsdl2py created the code below in OnlineQuery_client.py:
"querySoapIn = GED("http://eventquery.org/", "query", "test").pyclass"

So, can anyone point me in the right direction as to how I would
change the message that is being sent? I have tried a couple of
different combinations, but so far I have not been successful in
creating the messages that I want.

Any help is appreciated,
Doug
 
D

Doug

I believe that I have answered my own question. If anyone else is
interested in what I did ... using iPython's code completion (. then
hit tab tab) I noticed that msg had a _request attribute. I set that
attribute to "<GetEventList><Month>1</Month></GetEventList>" and that
sent the message that I needed!

Hope everyone has a great day!

Doug
 

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

Forum statistics

Threads
473,772
Messages
2,569,588
Members
45,100
Latest member
MelodeeFaj
Top