943,917 Members | Top Members by Rank

Jun 3rd, 2009
0

How do I set soap:header on my server?

Expand Post »
Hi, I'm newbie in nusoap library, and I'm getting stuck how to declare soap:header to be use in authentication from the client to the server. My script/wsdl server works fine, but I just want to secure my functions using authentication and also as of now dont have any idea how to set up soap:header on my server. Here's my WSDL server using PHP
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:Calculator" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:Calculator">
  3. <types>
  4. <xsd:schema targetNamespace="urn:Calculator"
  5. >
  6. <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
  7. <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
  8. <xsd:complexType name="sample">
  9. <xsd:sequence>
  10. <xsd:element name="input1" type="xsd:integer" nillable="false"/>
  11. <xsd:element name="input2" type="xsd:integer" nillable="true"/>
  12. <xsd:element name="operation" type="xsd:string" nillable="true"/>
  13.  
  14. </xsd:sequence>
  15. </xsd:complexType>
  16. </xsd:schema>
  17. </types>
  18. <message name="ComputationRequest">
  19. <part name="Input" type="tns:sample" /></message>
  20. <message name="ComputationResponse">
  21. <part name="Result" type="tns:sample" /></message>
  22. <portType name="Calculator_ServerPortType">
  23. <operation name="Computation">
  24. <input message="tns:ComputationRequest"/>
  25.  
  26. <output message="tns:ComputationResponse"/>
  27. </operation>
  28. </portType>
  29. <binding name="Calculator_ServerBinding" type="tns:Calculator_ServerPortType">
  30. <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  31. <operation name="Computation">
  32. <soap:operation soapAction="urn:Calculator_Server#Computation" style="rpc"/>
  33. <input><soap:body use="encoded" namespace="urn:Calculator_Server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
  34. <output><soap:body use="encoded" namespace="urn:Calculator_Server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  35. </operation>
  36.  
  37. </binding>
  38. <service name="Calculator_Server">
  39. <port name="Calculator_ServerPort" binding="tns:Calculator_ServerBinding">
  40. <soap:address location="http://ws16.racequeen.local/RQIPRO/branches/jun_new/RQIPRO_NUSOAP_CLIENT_SERVER/rqipro_server/sipport/sipport_server_post.php"/>
  41. </port>
  42. </service>
  43. </definitions>
-------------------------------------------------------------------------------------------------

Heres the server server I want to create:
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
  1. <wsdl:binding name="Calculator_ServerBinding" type="ngnpro:Calculator_ServerBindingPortType">
  2. <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  3. <wsdl:operation name="addAccount">
  4. <wsdlsoap:operation soapAction=""/>
  5. <wsdl:input name="AddCustomerAccountRequest">
  6. <wsdlsoap:header message="ngnpro:Login" part="auth" use="encoded" namespace="urn:AGProjects:NGNPro" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  7. <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:AGProjects:NGNPro:Customer" use="encoded"/>
  8. </wsdl:input>
  9. <wsdl:output name="AddCustomerAccountResponse">
  10. <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:AGProjects:NGNPro:Customer" use="encoded"/>
  11. </wsdl:output>
  12. </wsdl:operation>
  13. </wsdl:binding>
  14. <service name="Calculator_Server">
  15. <port name="Calculator_ServerPort" binding="tns:Calculator_ServerBinding">
  16. <soap:address location="http://ws16.racequeen.local/RQIPRO/branches/jun_new/RQIPRO_NUSOAP_CLIENT_SERVER/rqipro_server/sipport/sipport_server_post.php"/>
  17. </port>
  18. </service>
Last edited by Tekmaven; Jun 4th, 2009 at 3:33 am. Reason: Code Tags
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
junrest is offline Offline
6 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in RSS, Web Services and SOAP Forum Timeline: Memory usage increases when using Web services
Next Thread in RSS, Web Services and SOAP Forum Timeline: Problem sending the SOAP request message to weblogic session web service





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC