473,321 Members | 1,748 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,321 software developers and data experts.

Is there a SOAP module that can do this...?

I've been trying to use SOAPpy and ZSI (with and without the use of
wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic
server(?) in front of some enterprise java bean) and not having much
luck. I got them to send me an example of what the bytes on the wire
are supposed to look like (attached below), and I got it to "work" by
going lo-tech:

cn = httplib.HTTPSConnection('test.xx.no',443)
cn.putrequest("POST", "/service/url")
cn.putheader("Host", "test.xx.no")
cn.putheader("Content-type", 'text/xml; charset="UTF-8"')
cn.putheader("Content-length", "%d" % len(soap_message))
cn.putheader("SOAPAction", '""')
cn.endheaders()
cn.send(soap_message)

Is there a better way to do this? Can it be done with any of the
Python SOAP libraries?

Bjorn

soap message follows:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<Header xmlns="http://schemas.xmlsoap.org/soap/envelope/" />
<env:Body>
<submitMessage xmlns="http://no/brreg/BReMS/WebService/services">
<cpaid>y111</cpaid>
<securityKey>y222</securityKey>
<message><![CDATA[<?xml version='1.0' encoding='ISO-8859-1'?>
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<SOAP:Header xmlns:eb='http://www.oasis-open.org/committees/ebxml-msg/
schema/msg-header-2_0.xsd'>
<eb:MessageHeader eb:id='1' eb:version='2.0' SOAP:mustUnderstand='1'>
<eb:From>
<eb:PartyId eb:type='orgnr-submitter'>x111</eb:PartyId>
<eb:PartyId eb:type='orgnr-caseworker'>x222</eb:PartyId>
<eb:Role>Submitter</eb:Role>
</eb:From>
<eb:To>
<eb:PartyId eb:type='orgnr-registrator'>x111</eb:PartyId>
<eb:Role>Registrator</eb:Role>
</eb:To>
<eb:CPAId>y111</eb:CPAId>
<eb:ConversationId>ccd6dc26-836f-4768-8d28-5d46a872b9e8</
eb:ConversationId>
<eb:Service eb:type='lockup'>x444</eb:Service>
<eb:Action>appendMessage</eb:Action>
<eb:MessageData>
<eb:MessageId>ccd6dc26-836f-4768-8d28-5d46a872b9e8</eb:MessageId>
<eb:Timestamp>23.09.2006</eb:Timestamp>
</eb:MessageData>
<eb:Description xml:lang='no'></eb:Description>
</eb:MessageHeader>
</SOAP:Header>
<SOAP:Body>
<LegacyData>
<JegerproveInn xsi:noNamespaceSchemaLocation="JegerproveInn.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Arrangor>
<ArrangorId>3</ArrangorId>
<ArrangorNavn>
<Navn1>BBB</Navn1>
<Navn5></Navn5>
</ArrangorNavn>
<PersonNavn>
<Fornavn>CCC</Fornavn>
<Etternavn>DDD</Etternavn>
</PersonNavn>
<Kommunenr>9999</Kommunenr>
<Telefon>12345678</Telefon>
<Epost>a@b.no</Epost>
</Arrangor>
</JegerproveInn></LegacyData></SOAP:Body></SOAP:Envelope>]]>
</message>
</submitMessage>
</env:Body>
</env:Envelope>
Sep 10 '08 #1
4 2435
On Sep 10, 1:23*pm, thebjorn <BjornSteinarFjeldPetter...@gmail.com>
wrote:
I've been trying to use SOAPpy and ZSI (with and without the use of
wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic
server(?) in front of some enterprise java bean) and not having much
luck. *I got them to send me an example of what the bytes on the wire
are supposed to look like (attached below), and I got it to "work" by
going lo-tech:
If you are willing to go low tech you can try
http://effbot.org/downloads/#elementsoap

But before you do that try:
https://fedorahosted.org/suds
It is actively maintained and holds a lot of promise.
In my testing it knew how to connect to Sharepoint as well
as WebLogic exposed services.

Waldemar
Sep 10 '08 #2
On Sep 10, 9:44*pm, Waldemar Osuch <waldemar.os...@gmail.comwrote:
On Sep 10, 1:23*pm, thebjorn <BjornSteinarFjeldPetter...@gmail.com>
wrote:I've been trying to use SOAPpy and ZSI (with and without the use of
wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic
server(?) in front of some enterprise java bean) and not having much
luck. *I got them to send me an example of what the bytes on the wire
are supposed to look like (attached below), and I got it to "work" by
going lo-tech:

If you are willing to go low tech you can tryhttp://effbot.org/downloads/#elementsoap

But before you do that try:https://fedorahosted.org/suds
It is actively maintained and holds a lot of promise.
In my testing it knew how to connect to Sharepoint as well
as WebLogic exposed services.

Waldemar
Thanks for the info Waldemar. I'm looking into suds now, but there's
something I'm having trouble wrapping my head around (xml isn't my
usual territory, so this is perhaps obvious to someone...) This is
what suds tells me:
>>print client
suds ( version=0.2.9 )

service ( InboundLegacyDataService )
prefixes:
ns0 = "http://no/brreg/BReMS/WebService/services"
methods (2):
getInfo()
submitMessage(xs:string cpaid, xs:string securityKey,
xs:string message, )
types (4):
submitMessage
submitMessageResponse
getInfo
getInfoResponse

The method I'm interested in is submitMessage and in particular the
``xs:string message`` parameter. I've been provided with three xsd
files that I'm almost 100% sure defines the format of the xml in the
message (it defines the JegerproveInn sub-structure), but it looks
like that has to be wrapped in a SOAP:Envelope, including the <?xml..>
declaration before being stuffed into the xs:string message parameter,
before that in turn is wrapped in an env:Envelope... Am I on the right
track?

Another question: I'm assuming the xsd files can be used for more
than documentation :-) I've found the w3schools "Introduction to XML
Schema" which I'm starting to read right now, however I haven't been
able to google up any Python<->xsd "thingy" that looked promising
(since I'm not sure what I'm looking for, this might not be a big
surprise ;-) Is there such a "thingy"?

Bjorn
Sep 11 '08 #3
thebjorn wrote:
I've been trying to use SOAPpy and ZSI (with and without the use of
wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic
server(?) in front of some enterprise java bean) and not having much
luck.
Have you tried using soaplib? I find it very usable and from what I heard so
far, a couple of other people also like it a lot better than ZSI.

Stefan
Sep 11 '08 #4
On Sep 11, 3:50*am, thebjorn <BjornSteinarFjeldPetter...@gmail.com>
wrote:
On Sep 10, 9:44*pm, Waldemar Osuch <waldemar.os...@gmail.comwrote:
On Sep 10, 1:23*pm, thebjorn <BjornSteinarFjeldPetter...@gmail.com>
wrote:I've been trying to use SOAPpy and ZSI (with and without the use of
wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic
server(?) in front of some enterprise java bean) and not having much
luck. *I got them to send me an example of what the bytes on the wire
are supposed to look like (attached below), and I got it to "work" by
going lo-tech:
If you are willing to go low tech you can tryhttp://effbot.org/downloads/#elementsoap
But before you do that try:https://fedorahosted.org/suds
It is actively maintained and holds a lot of promise.
In my testing it knew how to connect to Sharepoint as well
as WebLogic exposed services.
Waldemar

Thanks for the info Waldemar. I'm looking into suds now, but there's
something I'm having trouble wrapping my head around (xml isn't my
usual territory, so this is perhaps obvious to someone...) This is
what suds tells me:
>print client

suds ( version=0.2.9 )

service ( InboundLegacyDataService )
* * * * prefixes:
* * * * * * * * ns0 = "http://no/brreg/BReMS/WebService/services"
* * * * methods (2):
* * * * * * * * getInfo()
* * * * * * * * submitMessage(xs:string cpaid, xs:string securityKey,
xs:string message, )
* * * * types (4):
* * * * * * * * submitMessage
* * * * * * * * submitMessageResponse
* * * * * * * * getInfo
* * * * * * * * getInfoResponse

The method I'm interested in is submitMessage and in particular the
``xs:string message`` parameter. *I've been provided with three xsd
files that I'm almost 100% sure defines the format of the xml in the
message (it defines the JegerproveInn sub-structure), but it looks
like that has to be wrapped in a SOAP:Envelope, including the <?xml..>
declaration before being stuffed into the xs:string message parameter,
before that in turn is wrapped in an env:Envelope... Am I on the right
track?
After you figure out how the message should look like, pass it with
the
rest of the parameters to the submitMessage.
"suds" should take care of the rest. Like wrap everything
into Envelope, send the request and parse response.

If you have to build XML from python let me point you to very useful
http://svn.effbot.python-hosting.com...lib/builder.py
or
http://codespeak.net/lxml/api/lxml.b...ker-class.html
Another question: *I'm assuming the xsd files can be used for more
than documentation :-) *I've found the w3schools "Introduction to XML
Schema" which I'm starting to read right now, however I haven't been
able to google up any Python<->xsd "thingy" that looked promising
(since I'm not sure what I'm looking for, this might not be a big
surprise ;-) *Is there such a "thingy"?
python<->xsd thingy you mention could be "lxml" library that is an
implementation of ElementTree + "number of very useful extensions".
Most of the time XSD is used to validate XML documents.
http://codespeak.net/lxml/validation.html

Sep 11 '08 #5

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...
6
by: Glauco | last post by:
I'm trying to use SOAPpy 0.10.1 for a client but is difficult to handle easly Is this library in use or i'm using an OLD death library ? I'm alone in find a lot of problem in a SOAP Client ?...
0
by: Doug Farrell | last post by:
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...
7
by: Mickel Grönroos | last post by:
Hi everybody, To the heart of the matter: Which of the available Soap modules is best fitted for client side soap messaging? I have an upload service (written in Perl) that I want to use from a...
0
by: Alvin A. Delagon | last post by:
Hello python programmers! I would like to add myself to the ever increasing number of python users. Here's my first question. I've written two SOAP clients using PERL and a PHP. I tried to wirte a...
1
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom...
0
by: Stu | last post by:
Hi, I am using a http module to authenticate soap base web services However i want to return a soap exception if its a soap message and a http error if its no a soap exception. Any ideas ...
2
by: Sells, Fred | last post by:
I need to talk to a vendor side via SOAP, Googling is overwhelming and many hits seem to point to older attempts. Can someone tell me which SOAP module is recommended. I'm using Python 2.4. ...
1
by: Jennifer Duerr | last post by:
All, I need help concerning SOAP, Python and XML. I am very new to this, so dumbing it down for me will not offend me! I'm using Python and want to send a user-inputted string to an existing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.