473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

SOAP - Beginner Desperately looking for Help

Hi All,

I am a relative beginner to Python and am looking for help with sending and
XML message and getting back a return file. The server is:

https://node.deq.state.or.us/node/node.asmx

I have have successfully sent and recieved using the PING, AUTHENTICATE
(send in username and password and return a secuirity token), SOLICIT(send
in information for a query and get a number indicating the query),
GETSTATUS(status of query) using SOAPpy. I am using Python 2.4 on a Window
XP machine.

What I want to do now is download the result of my query using the DOWNLOAD
method. However, I cann't figure out how to do this. I have tried SOAPpy
and httplib and I cann't send the correct XML outgoing message. Any help
with this would be greatly appreciated. Following is the needed outgoing
XML file and my successful SOAPpy code.

Thank you,

Rodney (ro************@hotmail.com)

POST /node/node.asmx HTTP/1.1
Host: node.deq.state.or.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: ""

<?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl"
xmlns:types="http://www.ExchangeNetwork.net/schema/v1.0/node.wsdl/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:Download
xmlns:q1="http://www.ExchangeNetwork.net/schema/v1.0/node.xsd">
<securityToken xsi:type="xsd:string">string</securityToken>
<transactionId xsi:type="xsd:string">string</transactionId>
<dataflow xsi:type="xsd:string">string</dataflow>
<documents href="#id1" />
</q1:Download>
<soapenc:Array id="id1"
xmlns:q1="http://www.ExchangeNetwork.net/schema/v1.0/node.xsd"
soapenc:arrayType="q1:NodeDocument[2]">
<Item href="#id2" />
<Item href="#id3" />
</soapenc:Array>
<q3:NodeDocument id="id2" xsi:type="q3:NodeDocument"
xmlns:q3="http://www.ExchangeNetwork.net/schema/v1.0/node.xsd">
<name xsi:type="xsd:string">string</name>
<type xsi:type="xsd:string">string</type>
</q3:NodeDocument>
<q4:NodeDocument id="id3" xsi:type="q4:NodeDocument"
xmlns:q4="http://www.ExchangeNetwork.net/schema/v1.0/node.xsd">
<name xsi:type="xsd:string">string</name>
<type xsi:type="xsd:string">string</type>
</q4:NodeDocument>
</soap:Body>
</soap:Envelope>
Below is an example of the code that does work.

urlNode = 'https://node.deq.state.or.us/node/node.asmx?op=NodePing'
namespace = 'http://www.ExchangeNetwork.net/schema/v1.0/node.xsd'
server = SOAPProxy(urlNode, namespace)
PING = server.NodePing('Ping')

urlAuth = 'https://node.deq.state.or.us/node/node.asmx?op=Authenticate'
# AUTHENTICATE - Returns a variable with the token
server = SOAPProxy(urlAuth, namespace)
token = server.Authenticate(userId='MYUSERNAME', credential='MYPASSWORD',
authenticationMethod='Invoke')
print token

urlSolicit = 'https://node.deq.state.or.us/node/node.asmx?op=Solicit'
server = SOAPProxy(urlSolicit, namespace)
rowID='0'
maxRows='1000'
service='GetAirMeasurements'
fieldEventStartDate='2005-01-01'
fieldEventEndDate='2005-02-01'
analyteName='PM10'
parameters=[rowID,maxRows,'','','','','','','','','','','','', '','','',fieldEventStartDate,fieldEventEndDate,'', analyteName]
transID = server.Solicit(securityToken = token, returnURL = '', request =
'GetAirMeasurements', parameters = parameters)
print transID

Nov 27 '05 #1
3 1767
Rodney Garland wrote:
Hi All,

I am a relative beginner to Python and am looking for help with sending and
XML message and getting back a return file. The server is:

https://node.deq.state.or.us/node/node.asmx

I have have successfully sent and recieved using the PING, AUTHENTICATE
(send in username and password and return a secuirity token), SOLICIT(send
in information for a query and get a number indicating the query),
GETSTATUS(status of query) using SOAPpy. I am using Python 2.4 on a Window
XP machine.

What I want to do now is download the result of my query using the DOWNLOAD
method. However, I cann't figure out how to do this. I have tried SOAPpy
and httplib and I cann't send the correct XML outgoing message. Any help
with this would be greatly appreciated. Following is the needed outgoing
XML file and my successful SOAPpy code.


Use wsdl2py(.py). It come with e.g. ZSI, but SOAPpy also use wsdltools -
which should include it. There is a WSDL given at the site, passing it
to wsdl2py results in type-definitions. Use these as arguments to
download - hopefully, that helps. I wanted to attach these - however,
taht didn't work for NNTP, so I mail them to you.

This whole mess is another reason to depsise SOAP and stick to xmlrpc or
better CORBA, btw.

Regards,

Diez
Nov 27 '05 #2
> I wanted to attach these - however,
taht didn't work for NNTP, so I mail them to you.


Didn't work - my mail server won't let me send these to you. So you're
on your own here. Shouldn't be too hard :)

Diez
Nov 27 '05 #3
Thanks :-)
"Diez B. Roggisch" <de***@nospam.web.de> wrote in message
news:3u*************@uni-berlin.de...
I wanted to attach these - however, taht didn't work for NNTP, so I mail
them to you.


Didn't work - my mail server won't let me send these to you. So you're on
your own here. Shouldn't be too hard :)

Diez

Nov 27 '05 #4

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

Similar topics

3
by: junkmail | last post by:
on a win 2k server apparantly it is saying i dont have it. or it cant find it. im using mySQL 4.1 php 4.3.x apache 3.0.53 im new to php and am doing some tutorials, but when i run the sripts...
2
by: Cantor | last post by:
Hello everyone :) I am writing some dotNET code to "consume" a web service written in PHP. So far I have been getting some error messages and PHP seems to place HTML text in front of the XML...
7
by: Brian P | last post by:
I am working on a new program that uses a SOAP interface. I have written a few of these before, but this time it is giving me trouble. I suspect there is a problem with on the SOAP handler side,...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
16
by: MR | last post by:
my soap messages to a remote site are failing. as far as i can tell the only differences between what my SOAP message looks liek and what they want are in the SOAP envelope SInce they don't have a...
31
by: Bryan Dickerson | last post by:
Ok, simple question: from a VB.Net web service (as I've said before, I'm a newbie to SOAP), how would I get the SOAP body into a string? My boss and I concur that it, at least from our...
5
by: vthakur | last post by:
Hello: I have a Axis Web Service that sets the sessionid in the SOAP header for persisting the session. The client is a .Net client that processes the header as an Unknown Header. It sets the...
0
by: Grzegorz Smith | last post by:
Hi All. I 'm learning ZSI to use SOAP and I desperately need help. I'm working on example from tutorial -(examples/server/send_response/ simple/wsdl/). Here are my wsdl files...
0
by: kim123 | last post by:
I got to write a c# client will ask a SOAP::Lite server for a list of data. In the request I have to send the following attributes: string, string, array, string, string The SOAP:Lite server is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.