views:

91

answers:

1

I am trying to access a .Net service which requires an authentication header. If WebService is used it works fine. But when it is accessed using HTTPService it throws error. The project is already done by somebody else using HTTPService. Now changing to webService requires some time since there needs to be modification in a lot of files.

Below is the SOAP envelop required by the service.

<soap:Header>
    <AuthenticationHeader xmlns="http://tempuri.org/"&gt;
      <UserName>string</UserName>
      <Password>string</Password>
    </AuthenticationHeader>
  </soap:Header>
  <soap:Body>
    <HelloWorld xmlns="http://tempuri.org/" />
  </soap:Body>

I tried it setting the headers property of the HTTP service.

var enc:Base64Encoder = new  Base64Encoder();
enc.encode("uname:pw");
hs.headers.Authorization = "Basic " +encoder.toString();

This also doesn't work.

Is there any way to access it using HTTP Service?

A: 

Enjoy :)

Eugene