Discussion:
Anyone know of a Python SOAP library that plays well with gSOAP?
Ramon E. Creager
2008-07-11 15:03:05 UTC
Permalink
?

Thx,

Ray Creager
Bruce Edge
2008-07-11 16:15:01 UTC
Permalink
I'm using the ZSI python libs. I can't say that I love it, but it does work.
Its shortcoming IMHO is the creation of complex data type request packets.
I often resort to firing off a query that returns one of the deep structs
that I need, then filling it out with my request :-(

-Bruce
Post by Ramon E. Creager
?
Thx,
Ray Creager
Ramon E. Creager
2008-07-11 19:09:32 UTC
Permalink
I guess I ought to explain what I'm having difficulties with.

I have a server, written in python, which uses soaplib
(http://trac.optio.webfactional.com/), and a client to this server
written using gSOAP. All the server does is takes two ints, adds them
together, and returns the results. So I have a .h file that looks like
this:

//gsoap ns1 service name: HelloWorldService
//gsoap ns1 service port: http://localhost:7789
//gsoap ns1 service namespace: urn:HelloWorldService.HelloWorldService

int ns1__add(int lhs, int rhs, int &);

I compile the client ok. When I run it, I get the following:

SOAP 1.1 fault: SOAP-ENV:Client[no subcode]
"Validation constraint violation: tag name or namespace mismatch in
element <addResponse>"
Detail: [no detail]

From RECV.log:

HTTP/1.1 200 OK
Content-type: text/xml
Date: Fri, 11 Jul 2008 18:55:23 GMT
Server: CherryPy/2.3.0
Connection: close

<SOAP-ENV:Envelope xmlns="HelloWorldService.HelloWorldService"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="HelloWorldService.HelloWorldService"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<SOAP-ENV:Body>
<addResponse>
<retval xmlns="" xsi:type="xs:int">10</retval>
</addResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

So gSOAP is calling the service OK, (with 5+5). This response shows
that my service function got called, and returned 10. But gSOAP chokes
on the response, with the message above. My first assumption is that
the server was screwing up by not prefacing 'addResponse' with the
service name, i.e. 'tns:addResponse' (hence my original post). Is this
the problem? And if so is there a workaround?

Thanks,

Ray
Post by Bruce Edge
I'm using the ZSI python libs. I can't say that I love it, but it does work.
Its shortcoming IMHO is the creation of complex data type request packets.
I often resort to firing off a query that returns one of the deep
structs that I need, then filling it out with my request :-(
-Bruce
?
Thx,
Ray Creager
Sam Gendler
2008-07-11 19:49:53 UTC
Permalink
I don't have any insight into your particular problem, but rather than
implementing your client by creating a .h file, you might have more
luck if you generate a WSDL file from the service and use that to have
gsoap create the .h file for the client for you. Or maybe write a
wsdl file and then use that to generate both the client and the
server. Even if that isn't how you want to work in the long term,
going through the effort once may reveal the issue to you and help you
figure out a solution.

--sam
Post by Ramon E. Creager
I guess I ought to explain what I'm having difficulties with.
I have a server, written in python, which uses soaplib
(http://trac.optio.webfactional.com/), and a client to this server
written using gSOAP. All the server does is takes two ints, adds them
together, and returns the results. So I have a .h file that looks like
//gsoap ns1 service name: HelloWorldService
//gsoap ns1 service port: http://localhost:7789
//gsoap ns1 service namespace: urn:HelloWorldService.HelloWorldService
int ns1__add(int lhs, int rhs, int &);
SOAP 1.1 fault: SOAP-ENV:Client[no subcode]
"Validation constraint violation: tag name or namespace mismatch in
element <addResponse>"
Detail: [no detail]
HTTP/1.1 200 OK
Content-type: text/xml
Date: Fri, 11 Jul 2008 18:55:23 GMT
Server: CherryPy/2.3.0
Connection: close
<SOAP-ENV:Envelope xmlns="HelloWorldService.HelloWorldService"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="HelloWorldService.HelloWorldService"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<SOAP-ENV:Body>
<addResponse>
<retval xmlns="" xsi:type="xs:int">10</retval>
</addResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So gSOAP is calling the service OK, (with 5+5). This response shows
that my service function got called, and returned 10. But gSOAP chokes
on the response, with the message above. My first assumption is that
the server was screwing up by not prefacing 'addResponse' with the
service name, i.e. 'tns:addResponse' (hence my original post). Is this
the problem? And if so is there a workaround?
Thanks,
Ray
Post by Bruce Edge
I'm using the ZSI python libs. I can't say that I love it, but it does work.
Its shortcoming IMHO is the creation of complex data type request packets.
I often resort to firing off a query that returns one of the deep
structs that I need, then filling it out with my request :-(
-Bruce
?
Thx,
Ray Creager
Jake Skinner
2008-07-14 04:18:34 UTC
Permalink
I am using a python server to interface to gSOAP.

But what we found is that you need to manually write the response back
to the client. The python libs are not very useful (pls don't hate me),
it is easier to just do it all yourself. Or you could always add the fix
to 'soaplib', but I doubt there is going to be an easy fix. :(

cheers
jake
Post by Sam Gendler
I don't have any insight into your particular problem, but rather than
implementing your client by creating a .h file, you might have more
luck if you generate a WSDL file from the service and use that to have
gsoap create the .h file for the client for you. Or maybe write a
wsdl file and then use that to generate both the client and the
server. Even if that isn't how you want to work in the long term,
going through the effort once may reveal the issue to you and help you
figure out a solution.
--sam
Post by Ramon E. Creager
I guess I ought to explain what I'm having difficulties with.
I have a server, written in python, which uses soaplib
(http://trac.optio.webfactional.com/
<http://trac.optio.webfactional.com/>), and a client to this server
Post by Ramon E. Creager
written using gSOAP. All the server does is takes two ints, adds them
together, and returns the results. So I have a .h file that looks like
//gsoap ns1 service name: HelloWorldService
//gsoap ns1 service port: http://localhost:7789 <http://localhost:7789>
//gsoap ns1 service namespace: urn:HelloWorldService.HelloWorldService
int ns1__add(int lhs, int rhs, int &);
SOAP 1.1 fault: SOAP-ENV:Client[no subcode]
"Validation constraint violation: tag name or namespace mismatch in
element <addResponse>"
Detail: [no detail]
HTTP/1.1 200 OK
Content-type: text/xml
Date: Fri, 11 Jul 2008 18:55:23 GMT
Server: CherryPy/2.3.0
Connection: close
<SOAP-ENV:Envelope xmlns="HelloWorldService.HelloWorldService"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>"
Post by Ramon E. Creager
xmlns:tns="HelloWorldService.HelloWorldService"
xmlns:xs="http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema>"
Post by Ramon E. Creager
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance
<http://www.w3.org/1999/XMLSchema-instance>">
Post by Ramon E. Creager
<SOAP-ENV:Body>
<addResponse>
<retval xmlns="" xsi:type="xs:int">10</retval>
</addResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So gSOAP is calling the service OK, (with 5+5). This response shows
that my service function got called, and returned 10. But gSOAP chokes
on the response, with the message above. My first assumption is that
the server was screwing up by not prefacing 'addResponse' with the
service name, i.e. 'tns:addResponse' (hence my original post). Is this
the problem? And if so is there a workaround?
Thanks,
Ray
Post by Bruce Edge
I'm using the ZSI python libs. I can't say that I love it, but it does work.
Its shortcoming IMHO is the creation of complex data type request
packets.
Post by Ramon E. Creager
Post by Bruce Edge
I often resort to firing off a query that returns one of the deep
structs that I need, then filling it out with my request :-(
-Bruce
On Fri, Jul 11, 2008 at 8:03 AM, Ramon E. Creager
?
Thx,
Ray Creager
--
[Go to the Zarloc Website] p: +61 8 8121 9317
m: +61 419 857 556
f: +61 8 8370 4229
Loading...