473,487 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

simple SOAP method doesn't work,

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 -http://pastebin.com/873488.
I made wsdl2py wsdl2py --complexType --file=binding.wsdl and get
Example_services.py and Example_Services_types.py.
Here is the Example_services.py -http://pastebin.com/873492
and Example_Services_types.py -http://pastebin.com/873494
Now I use cgi script for getting request/ sending response.
Script is runned by apache2.0.
It looks like this:
#!c:\opt\python24\python
from Example_services import EchoResponse
def echo(message):
response = EchoResponse()
response._Message = message
return response

from ZSI import dispatch
dispatch.AsCGI()

Now i write 2 scripts to test my Soap webservices. First is write just
like in guide.html
from Example_services import *
loc = ExampleServiceLocator()
port = loc.getExample()
req = EchoRequest()
req._Message='test'

resp = port.echo(req)
print resp

and I get:
Traceback (most recent call last):
File "test.py", line 9, in ?
resp = port.echo(req)
File "I:\Prace\PRYWATNE\test\Example_services.py", line 41, in echo
response = self.binding.Receive(typecode)
File "I:\Prace\PRYWATNE\test\client.py", line 497, in Receive

File "I:\Prace\PRYWATNE\test\client.py", line 397, in ReceiveSOAP

File "C:\opt\Python24\lib\site-packages\zsi-2.0_rc3-py2.4.egg\ZSI
\parse.py", line 59, in __init__
File "c:\opt\python24\lib\site-packages\PyXML-0.8.4-py2.4-win32.egg
\_xmlplus\dom\ext\reader\__init__.py", line 60, in
fromString
return self.fromStream(stream, ownerDoc)
File "c:\opt\python24\lib\site-packages\PyXML-0.8.4-py2.4-win32.egg
\_xmlplus\dom\ext\reader\PyExpat.py", line 65, in f
romStream
success = self.parser.ParseFile(stream)
xml.parsers.expat.ExpatError: unclosed token: line 12, column 152

Second looks like this:
import sys
from ZSI.client import Binding
b = Binding(url='http://127.0.0.1/cgi-bin/cgi.py',
tracefile=sys.stdout)
print b.echo('test')
and i get:
_________________________________ Fri Feb 02 13:05:06 2007 REQUEST:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org
/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
ENV:
Header></SOAP-ENV:Header><SOAP-ENV:Body><echo SOAP-
ENC:arrayType="xsd:anyType[1]" xsi:type="SOAP-ENC:Array"><element id=
"oad1c20" xsi:type="xsd:string">test</element></echo></SOAP-ENV:Body></
SOAP-ENV:Envelope>
_________________________________ Fri Feb 02 13:05:07 2007 RESPONSE:
200
OK
-------
Date: Fri, 02 Feb 2007 12:05:06 GMT
Server: Apache/2.0.59 (Win32) DAV/2 PHP/5.1.6 mod_python/3.2.10 Python/
2.4.3 SVN/1.4.2
Content-Length: 453
Content-Type: text/xml; charset="utf-8"

<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org
/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body
xmlns:ns1="urn:Example"><ns
1:echoResponse><Message>test</Message></ns1:echoResponse></SOAP-
ENV:Body></SOAP-ENV:Envelope>
Traceback (most recent call last):
File "testSoap.py", line 12, in ?
zPalca()
File "testSoap.py", line 7, in zPalca
print b.echo('test')
File "I:\Prace\PRYWATNE\test\client.py", line 42, in __call__

File "I:\Prace\PRYWATNE\test\client.py", line 171, in RPC

File "I:\Prace\PRYWATNE\test\client.py", line 502, in Receive

File "I:\Prace\PRYWATNE\test\client.py", line 436, in Receive

File "C:\opt\Python24\lib\site-packages\zsi-2.0_rc3-py2.4.egg\ZSI
\parse.py", line 323, in Parse
File "C:\opt\Python24\lib\site-packages\zsi-2.0_rc3-py2.4.egg\ZSI
\TC.py", line 573, in parse
File "C:\opt\Python24\lib\site-packages\zsi-2.0_rc3-py2.4.egg\ZSI
\TC.py", line 542, in parse_into_dict_or_list
File "C:\opt\Python24\lib\site-packages\zsi-2.0_rc3-py2.4.egg\ZSI
\TC.py", line 572, in parse
ZSI.EvaluateException: Any cannot parse untyped element
[Element trace: /SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:echoResponse/
Message]

Can anyone tell me what I'm doing wrong?
I read guide and think do everything in right way, but it's not
working
Thanks for any help I really ned this

Feb 2 '07 #1
0 2181

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

Similar topics

3
4866
by: Nimai Malle | last post by:
I have not had any luck searching for a simple, simple example that calls a method on an object given a SOAP string. Here's what I'm looking for (in pseudocode): string SOAPCall = "bla bla...
0
2277
by: Michael Jackson | last post by:
I have attempted to mark up a service and it's methods so that it doesn't require the SOAPAction HTTP header to resolve the methods being called, this is done from first element in <SOAP-ENV:Body>...
4
7663
by: Henrik | last post by:
Hi all,, I'm trying to make a program, that calls a webservice, and then does somthing about the data, that i recive.. But i don't know what to do with this data??.. i tried to load into an...
16
3152
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
2780
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...
7
1615
by: Andy Kendall | last post by:
Hi, This article states the following in relation to ASP.NET default test harness web pages. "These test pages can be used to invoke your WebMethods, but the test harness does this by making...
6
42969
by: Peter van der veen | last post by:
Hi I have the following problem. I'm calling a webservice from within a VB.net 2005 Windows program. For this i got a WSDL file and loaded that in VB. Until now i just call the webservice and...
4
2462
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code...
10
2103
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
0
7106
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
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
7181
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...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5442
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,...
1
4874
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.