Cannot process SOAP requests
I'm trying to implement a simple handler for SOAP requests. This is for an interface required by a client, so the choice of SOAP over XML-RPC, etc., is nothing I can change. In order to figure out the way that such a request would be formatted, I added the following line to the handler script: context.recordRequest(req=context.REQUEST) "recordRequest" is a Z SQL Method that inserts the passed string into a log database. I then created a simple WSDL that pointed to my Zope handler, and invoked it using the Generic SOAP client tool available at http://www.soapclient.com/soaptest.html. The request was recorded, but none of the SOAP data was visible in the request! Here's what got stored in the log: <h3>form</h3><table></table><h3>cookies</h3><table></table><h3>lazy items</h3><table><tr valign="top" align="left"><th>SESSION</th><td><bound method SessionDataManager.getSessionData of <SessionDataManager instance at 8b6c7c0>></td></tr></table><h3>other</h3><table><tr valign="top" align="left"><th>AUTHENTICATION_PATH</th><td>''</td></tr><tr valign="top" align="left"><th>TraversalRequestNameStack</th><td>[]</td></tr><tr valign="top" align="left"><th>VirtualRootPhysicalPath</th><td>('',)</td></tr><tr valign="top" align="left"><th>URL</th><td>'http://leafe.com/MyTestWS'</td></tr><tr valign="top" align="left"><th>PUBLISHED</th><td><PythonScript at /MyTestWS></td></tr><tr valign="top" align="left"><th>SERVER_URL</th><td>'http://leafe.com'</td></tr><tr valign="top" align="left"><th>AUTHENTICATED_USER</th><td>Anonymous User</td></tr><tr valign="top" align="left"><th>traverse_subpath</th><td>[]</td></tr><tr valign="top" align="left"><th>URL0</th><td>http://leafe.com/MyTestWS</td></tr><tr valign="top" align="left"><th>URL1</th><td>http://leafe.com</td></tr><tr valign="top" align="left"><th>BASE0</th><td>http://leafe.com</td></tr><tr valign="top" align="left"><th>BASE1</th><td>http://leafe.com</td></tr><tr valign="top" align="left"><th>BASE2</th><td>http://leafe.com/MyTestWS</td></tr></ table><h3>environ</h3><table><tr valign="top" align="left"><th>SCRIPT_NAME</th><td>''</td></tr><tr valign="top" align="left"><th>SERVER_SOFTWARE</th><td>'Zope/(Zope 2.6.0 (binary release, python 2.1, linux2-x86), python 2.1.3, linux2) ZServer/1.1b1'</td></tr><tr valign="top" align="left"><th>channel.creation_time</th><td>1042309538</td></tr><tr valign="top" align="left"><th>SERVER_PROTOCOL</th><td>'HTTP/1.1'</td></tr><tr valign="top" align="left"><th>SERVER_PORT</th><td>'8080'</td></tr><tr valign="top" align="left"><th>PATH_INFO</th><td>'/MyTestWS'</td></tr><tr valign="top" align="left"><th>HTTP_HOST</th><td>'leafe.com:8080'</td></tr><tr valign="top" align="left"><th>REQUEST_METHOD</th><td>'POST'</td></tr><tr valign="top" align="left"><th>PATH_TRANSLATED</th><td>'/MyTestWS'</td></tr><tr valign="top" align="left"><th>HTTP_MAX_FORWARDS</th><td>'10'</td></tr><tr valign="top" align="left"><th>CONTENT_TYPE</th><td>'text/xml; charset="UTF-8"'</td></tr><tr valign="top" align="left"><th>HTTP_X_FORWARDED_HOST</th><td>'www.leafe.com'</td></ tr><tr valign="top" align="left"><th>HTTP_X_FORWARDED_FOR</th><td>'63.50.145.198'</td></ tr><tr valign="top" align="left"><th>REMOTE_ADDR</th><td>'24.95.211.16'</td></tr><tr valign="top" align="left"><th>SERVER_NAME</th><td>'leafe.com'</td></tr><tr valign="top" align="left"><th>HTTP_X_FORWARDED_SERVER</th><td>'leafe.com'</td></ tr><tr valign="top" align="left"><th>GATEWAY_INTERFACE</th><td>'CGI/1.1'</td></tr><tr valign="top" align="left"><th>HTTP_SOAPACTION</th><td>'"http://tempuri.org/action/ MyTestWS.SearchSubjectLinks"'</td></tr><tr valign="top" align="left"><th>CONTENT_LENGTH</th><td>'480'</td></tr></table> There is nothing listed under the "form" section - that's where the XML request should be, right? And the CONTENT-LENGTH certainly suggests that something was sent, but I can't see it anywhere in the request. How do I access the posted XML from the SOAP request? ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
Ed Leafe wrote at 2003-1-12 10:24 -0500:
I'm trying to implement a simple handler for SOAP requests. This is for an interface required by a client, so the choice of SOAP over XML-RPC, etc., is nothing I can change.
In order to figure out the way that such a request would be formatted, ... debugging output of REQUEST ... There is nothing listed under the "form" section - that's where the XML request should be, right? Zope does not yet support SOAP.
Especially, it does not decode SOAP parameters for you and puts them in "form". You must do your own SOAP parsing. Some time ago, difficulties have been reported (--> archive) for the handling of POST requests with "text/xml" content type. They are interpreted as XML-RPC calls, although, they may not be meant this way. Dieter
I'm trying to implement a simple handler for SOAP requests. This is for an interface required by a client, so the choice of SOAP over XML-RPC, etc., is nothing I can change.
In order to figure out the way that such a request would be formatted, I added the following line to the handler script:
context.recordRequest(req=context.REQUEST)
"recordRequest" is a Z SQL Method that inserts the passed string into a log database. I then created a simple WSDL that pointed to my Zope handler, and invoked it using the Generic SOAP client tool available at http://www.soapclient.com/soaptest.html. The request was recorded, but none of the SOAP data was visible in the request! Here's what got stored in the log:
<snipped>
There is nothing listed under the "form" section - that's where the XML request should be, right? And the CONTENT-LENGTH certainly suggests that something was sent, but I can't see it anywhere in the request.
How do I access the posted XML from the SOAP request?
I think you want to use REQUEST['BODY'] to get the raw data. REQUEST.form is only populated with form variable when the data is form encoded. Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com
On Sunday, January 12, 2003, at 10:12 PM, Brian Lloyd wrote:
How do I access the posted XML from the SOAP request?
I think you want to use REQUEST['BODY'] to get the raw data. REQUEST.form is only populated with form variable when the data is form encoded.
Thanks - that's what I needed. One question, though: why doesn't that key show up when saving the full request? I was trying to see where the XML was in the request by writing str(context.REQUEST) into a log, and the BODY didn't show up at all. ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
Ed Leafe wrote at 2003-1-13 10:45 -0500:
...
I think you want to use REQUEST['BODY'] to get the raw data. REQUEST.form ... One question, though: why doesn't that key show up when saving the full request? Usually, this information is redundant (as Zope usually decodes the information found there and presents it in other REQUEST resources).
Furthermore, it can be really huge. You will not want to see it e.g. in TAL error pages... Few peoply use SOAP currently with Zope... Dieter
On Monday, January 13, 2003, at 02:50 PM, Dieter Maurer wrote:
Few peoply use SOAP currently with Zope...
A thorough Google on the subject confirms that. Unfortunately, I need to be able to do it for a particular client, and I didn't want to have to go the Perl/PHP route. My site is mostly in Zope, and I'd like to keep it that way if possible. ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
participants (3)
-
Brian Lloyd -
Dieter Maurer -
Ed Leafe