title: setting soap headers when using wsdl in php
body: <p>I'm trying to use a simple wsdl file and make a soap call but for the life of me I can't get it to work.</p>
  
  <p>Here's the wsdl file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;wsdl:definitions targetNamespace="urn:gnHPD_Staging_Table_Submit_Generic" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s="urn:gnHPD_Staging_Table_Submit_Generic" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
   &lt;wsdl:types&gt;
    &lt;xsd:schema elementFormDefault="qualified" targetNamespace="urn:gnHPD_Staging_Table_Submit_Generic"&gt;
     &lt;xsd:element name="Submit" type="s:InputMapping"/&gt;
     &lt;xsd:complexType name="InputMapping"&gt;
      &lt;xsd:sequence&gt;
       &lt;xsd:element name="Assigned_To_Group" type="xsd:string"/&gt;
       &lt;xsd:element name="AutoPush" type="s:AutoPushType"/&gt;
       &lt;xsd:element name="Case_Type" type="s:Case_TypeType"/&gt;
       &lt;xsd:element name="Category" type="xsd:string"/&gt;
       &lt;xsd:element name="Description" type="xsd:string"/&gt;
       &lt;xsd:element name="Details" type="xsd:string"/&gt;
       &lt;xsd:element name="Entry_Number" type="xsd:string"/&gt;
       &lt;xsd:element name="Integration_Application" type="xsd:string"/&gt;
       &lt;xsd:element name="Item" type="xsd:string"/&gt;
       &lt;xsd:element name="Priority" type="s:PriorityType"/&gt;
       &lt;xsd:element name="Source" type="s:SourceType"/&gt;
       &lt;xsd:element name="Submitter_UNIX" type="xsd:string"/&gt;
       &lt;xsd:element name="Summary" type="xsd:string"/&gt;
       &lt;xsd:element name="Type" type="xsd:string"/&gt;
      &lt;/xsd:sequence&gt;
     &lt;/xsd:complexType&gt;
     &lt;xsd:simpleType name="AutoPushType"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
       &lt;xsd:enumeration value="Auto Push"/&gt;
      &lt;/xsd:restriction&gt;
     &lt;/xsd:simpleType&gt;
     &lt;xsd:simpleType name="Case_TypeType"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
       &lt;xsd:enumeration value="Incident"/&gt;
       &lt;xsd:enumeration value="Question"/&gt;
       &lt;xsd:enumeration value="Request"/&gt;
       &lt;xsd:enumeration value="Problem"/&gt;
      &lt;/xsd:restriction&gt;
     &lt;/xsd:simpleType&gt;
     &lt;xsd:simpleType name="PriorityType"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
       &lt;xsd:enumeration value="4"/&gt;
       &lt;xsd:enumeration value="3"/&gt;
       &lt;xsd:enumeration value="2"/&gt;
       &lt;xsd:enumeration value="1"/&gt;
      &lt;/xsd:restriction&gt;
     &lt;/xsd:simpleType&gt;
     &lt;xsd:simpleType name="SourceType"&gt;
      &lt;xsd:restriction base="xsd:string"&gt;
       &lt;xsd:enumeration value="Phone"/&gt;
       &lt;xsd:enumeration value="Requester"/&gt;
       &lt;xsd:enumeration value="Email"/&gt;
       &lt;xsd:enumeration value="Web"/&gt;
       &lt;xsd:enumeration value="NMP"/&gt;
      &lt;/xsd:restriction&gt;
     &lt;/xsd:simpleType&gt;
     &lt;xsd:element name="SubmitResponse" type="s:OutputMapping"/&gt;
     &lt;xsd:complexType name="OutputMapping"&gt;
      &lt;xsd:sequence&gt;
       &lt;xsd:element name="StagingTable_ID" type="xsd:string"/&gt;
       &lt;xsd:element name="HelpDesk_ID" type="xsd:string"/&gt;
      &lt;/xsd:sequence&gt;
     &lt;/xsd:complexType&gt;
     &lt;xsd:element name="AuthenticationInfo" type="s:AuthenticationInfo"/&gt;
     &lt;xsd:complexType name="AuthenticationInfo"&gt;
      &lt;xsd:sequence&gt;
       &lt;xsd:element name="userName" type="xsd:string"/&gt;
       &lt;xsd:element name="password" type="xsd:string"/&gt;
       &lt;xsd:element minOccurs="0" name="authentication" type="xsd:string"/&gt;
       &lt;xsd:element minOccurs="0" name="locale" type="xsd:string"/&gt;
       &lt;xsd:element minOccurs="0" name="timeZone" type="xsd:string"/&gt;
      &lt;/xsd:sequence&gt;
     &lt;/xsd:complexType&gt;
    &lt;/xsd:schema&gt;
   &lt;/wsdl:types&gt;
     &lt;wsdl:message name="SubmitSoapOut"&gt;
        &lt;wsdl:part element="s:SubmitResponse" name="parameters"/&gt;
     &lt;/wsdl:message&gt;
     &lt;wsdl:message name="SubmitSoapIn"&gt;
        &lt;wsdl:part element="s:Submit" name="parameters"/&gt;
     &lt;/wsdl:message&gt;
     &lt;wsdl:message name="ARAuthenticate"&gt;
        &lt;wsdl:part element="s:AuthenticationInfo" name="parameters"/&gt;
     &lt;/wsdl:message&gt;
     &lt;wsdl:portType name="gnHPD_Staging_Table_Submit_GenericPortType"&gt;
        &lt;wsdl:operation name="Submit"&gt;
           &lt;wsdl:input message="s:SubmitSoapIn"/&gt;
           &lt;wsdl:output message="s:SubmitSoapOut"/&gt;
        &lt;/wsdl:operation&gt;
     &lt;/wsdl:portType&gt;
     &lt;wsdl:binding name="gnHPD_Staging_Table_Submit_GenericSoapBinding" type="s:gnHPD_Staging_Table_Submit_GenericPortType"&gt;
        &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
        &lt;wsdl:operation name="Submit"&gt;
           &lt;soap:operation soapAction="urn:gnHPD_Staging_Table_Submit_Generic/Submit" style="document"/&gt;
           &lt;wsdl:input&gt;
              &lt;soap:header message="s:ARAuthenticate" part="parameters" use="literal"&gt;&lt;/soap:header&gt;
              &lt;soap:body use="literal"/&gt;
           &lt;/wsdl:input&gt;
           &lt;wsdl:output&gt;
              &lt;soap:body use="literal"/&gt;
           &lt;/wsdl:output&gt;
        &lt;/wsdl:operation&gt;
     &lt;/wsdl:binding&gt;
     &lt;wsdl:service name="gnHPD_Staging_Table_Submit_GenericService"&gt;
    &lt;wsdl:documentation&gt;Generic Submit for HD&lt;/wsdl:documentation&gt;
        &lt;wsdl:port binding="s:gnHPD_Staging_Table_Submit_GenericSoapBinding" name="gnHPD_Staging_Table_Submit_GenericSoap"&gt;
           &lt;soap:address location="http://servename:1234/midtier/services/ARService?server=servername&amp;amp;webService=gnHPD_Staging_Table_Submit_Generic"/&gt;
        &lt;/wsdl:port&gt;
     &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>Here's my php code:</p>
  
  <pre><code>$params = array( 
    "Submitter_UNIX"=&gt;'myunix', 
    "Source"=&gt;'Web', 
    "Summary"=&gt;'Test1', 
    "Description"=&gt;'Test1', 
    "Category"=&gt;'test services', 
    "Type"=&gt;'test s', 
    "Item"=&gt;'Problem', 
    "Assigned_To_Group"=&gt;'test s', 
    "Case_Type"=&gt;'Problem', 
    "Priority"=&gt;'4', 
    "AutoPush" =&gt; 'Auto Push', 
    "Details"=&gt;'Test Details', 
    "Entry_Number"=&gt;'', 
    "Integration_Application"=&gt;'MyDev' 
  ); 
  
  $client = new SoapClient('http://servername:1234/midtier/WSDL/servername/gnHPD_Staging_Table_Submit_Generic',array('trace' =&gt; 1 )); 
  
  
  $result = $client-&gt;Submit($params);  
  </code></pre>
  
  <p>But I don't know how to set the authentication headers for the soap call. any assistance is greatly appreciated.</p>