How do I set soap:header on my server?

Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Apr 2009
Posts: 4
Reputation: junrest is an unknown quantity at this point 
Solved Threads: 0
junrest junrest is offline Offline
Newbie Poster

How do I set soap:header on my server?

 
0
  #1
Jun 3rd, 2009
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC