amds09 - 2009-07-02

Hello everyone,

First, I am new to ZSI and Python in general, but I would like to know if anyone has any documentation on how Soap header processing can be accomplished at server level.

I've created so far the WSDL schema, soap client and server, and I am able to send SOAP headers from the client. My problem now is how to verify the values in the header and ensure that proper values are passed.

In my WSDL file, I request at input the soap header presence:
<wsdl:input name="GetStringRequest">
<wsdlsoap:body use="literal" />
<wsdlsoap:header message="cws:AuthSoapHeader" part="AuthSoapHeader" use="literal" />
where AuthSoapHeader is a complex element:
<xsd:element name="AuthSoapHeader">
<xsd:element name="Username" nillable="false" type="xsd:string"></xsd:element>
<xsd:element name="Password" nillable="false" type="xsd:string"></xsd:element>

Then, in the client, I set the soap header as follows:

AuthHeader = GED("urn:SHC:CoyoteWS", "AuthSoapHeader").pyclass
ah = AuthHeader()
ah.Username = "myuser"
ah.Password = "mypass"

and make the soap call (with input parameters and everything):

result = service.GetString(getString,soapheaders=[ah])

When I run the client, everything works fine, in the sense that the header is passed and a return is received, but how do I check at the server script for header presence and what values for the username and password were provided?

Just to mention, I am using ZSI Version 2.1 alpha 1 on python 2.5

The client input/output:

_________________________________ Thu Jul  2 15:14:40 2009 REQUEST:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="" xmlns:SOAP-ENV="" xmlns:ZSI="" xmlns:xsd="" xmlns:xsi=""><SOAP-ENV:Header xmlns:ns1="urn:SHC:CoyoteWS"><ns1:AuthSoapHeader><Username>myuser</Username><Password>mypass</Password></ns1:AuthSoapHeader></SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="urn:SHC:CoyoteWS"><ns1:StringData><StringIn>test abc 123</StringIn></ns1:StringData></SOAP-ENV:Body></SOAP-ENV:Envelope>
_________________________________ Thu Jul  2 15:14:40 2009 RESPONSE:
Server: ZSI/1.1 BaseHTTP/0.3 Python/2.5.2
Date: Thu, 02 Jul 2009 22:14:40 GMT
Content-type: text/xml; charset="utf-8"
Content-Length: 540

<SOAP-ENV:Envelope xmlns:SOAP-ENC="" xmlns:SOAP-ENV="" xmlns:ZSI="" xmlns:xsd="" xmlns:xsi=""><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="urn:SHC:CoyoteWS"><ns1:RandomMessage><MessageString>Hi There test abc 123</MessageString><MessageDT>2009-07-02Z</MessageDT></ns1:RandomMessage></SOAP-ENV:Body></SOAP-ENV:Envelope>

Thank you for your help. It's been almost a week of search and I couldn't find anything about server soap header processing.