1 Reply Latest reply on Oct 16, 2008 2:56 PM by insuractive

    Can CF do Custom Web Service Headers?

    insuractive Level 3
      I am trying to consumer a web service created in .NET that appears to use a custom Header object for authentication. I'm banging my head against the wall trying to figure out how to configure the WS invoke from CF so that it creates the correct SOAP.

      Normally I would try and create a CF Structure and pass it into the web service call.
      e.g.:

      objWS = CreateObject("webservice", " http://www.somesite.com/webservices/myMethod.asmx?WSDL");

      myAuthHeader = {username="user1",password="pass1"};

      addSOAPRequestHeader(obj, " http://www.somesite.com/webservices/", "AuthenticationHeader", myAuthHeader);


      But that gives me the following result:

      <soapenv:Header>
      <ns1:AuthenticationHeader soapenv:mustUnderstand="true" soapenv:role=" http://schemas.xmlsoap.org/soap/actor/next" xmlns:ns1=" http://www.somesite.com/webservices/">
      <item xmlns:ns2=" http://xml.apache.org/xml-soap">
      <key xsi:type="xsd:string">USERNAME</key>
      <value xsi:type="xsd:string">user1</value>
      </item>
      <item>
      <key xsi:type="xsd:string">PASSWORD</key>
      <value xsi:type="xsd:string">pass1</value>
      </item>
      </ns1:AuthenticationHeader>
      </soapenv:Header>

      Instead of:

      <soap:Header>
      <AuthenticationHeader xmlns=" http://www.somesite.com/webservices/">
      <UserName>user1</UserName>
      <Password>pass1</Password>
      </AuthenticationHeader>
      </soap:Header>

      Anyone have an ideas on what I'm doing wrong?

      Thanks!