Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > How to use SOAP HEADERS with PHP SOAP extension in WSDL mode
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 3rd July 19:11
sander
External User
 
Posts: 1
Default How to use SOAP HEADERS with PHP SOAP extension in WSDL mode



Hi,

I'm trying to create an application which has a SOAP webservice so
other applications can communicatie with the application. Herefor I'm
using the fairly new SOAP extension. Everything works fine until I try
to put a value into the SOAP HEADERS.

I want to add a key to the headers so my application can check whether
the third party application is authorized to execute the call. The
insertion of the value works fine. The problem resides in the
execution of the function on the server side. Using the webservice
when not in WSDL mode everything workst fine, so I quess it has
something to do with my WSDL. Can anyone help me please?

This is how the header part of my request message looks like:
---------------------------------------------------------------
<SOAP-ENV:Header><ns1:authorize>someKey</ns1:authorize></SOAP-ENV:Header>
---------------------------------------------------------------

My WSDL looks like this (shortened for displaying purposes):
---------------------------------------------------------------
<wsdl:definitions ...>
<message name="authorizeIn">
<part name="key" type="xsd:string"/>
</message>
<message name="authorizeOut">
<part name="Result" type="xsd:string"/>
</message>
<portType ...>
<wsdlperation name="authorize">
<wsdl:input message="typens:authorizeIn"/>
<wsdlutput message="typens:authorizeOut"/>
</wsdlperation>
</portType>
<binding ...>
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="authorize">
<soapperation soapAction="urn:#authorize"/>
<input>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:KennisAtlas"/>
</input>
<output>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:KennisAtlas"/>
</output>
</wsdlperation>
</binding>
<service name="KennisAtlas">
<port name="KennisAtlasSoap" binding="typens:KennisAtlasSoap">
<soap:address location="http://kennisatlas.axipress.nl/KennisAtlas/Service/"/>
</port>
</service>
</wsdl:definitions>
---------------------------------------------------------------

This is my function definition:
---------------------------------------------------------------
class Service
{
function authorize($key)
{
//...
}
}
---------------------------------------------------------------
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666