0 Replies Latest reply on Feb 24, 2009 9:57 AM by flexisgood

    SOAP Headers in Flex?

    flexisgood
      I have a .NET SOAP function that looks like this:

      public AuthSoapHd spAuthenticationHeader;
      [WebMethod, SoapHeader("spAuthenticationHeader")]
      public string helloWorld()
      {
      if (spAuthenticationHeader != null)
      {
      if (spAuthenticationHeader.strUserName == "TestUser" &&
      spAuthenticationHeader.strPassword == "TestPassword")
      {
      return "Hello World";
      }
      else
      {
      return "Access Denied";
      }
      }
      else
      {
      return "No header";
      }
      }

      I am then trying to add a SOAP header in Flex to match the webservice:
      myWebservice.addSimpleHeader("header1"," http://soapinterop.org/xsd","strUserName","TestUser");
      myWebservice.addSimpleHeader("header2"," http://soapinterop.org/xsd","strPassword","TestPassword");
      myWebservice.helloWorld.send();

      <mx:WebService id="myWebservice" wsdl=" http://myURL/myWebservice.asmx?wsdl">
      <mx:operation name="ws_helloWorld" resultFormat="object" result="fn_processResultHandler(event)" fault="fn_faultHandler(event)" />
      </mx:WebService>

      But it does not send the SOAP header. How do I write them so FLEX configure the header correct?