I have a SOAP Web Service that I'm trying to connect to that requires
Basic authentication. Here's the code that I'm calling in my .mxml
application:
private function callService():void {
var xplannerSvc:WebService = new WebService();
xplannerSvc.destination = "xplanner";
xplannerSvc.showBusyCursor = true;
xplannerSvc.useProxy = true;
xplannerSvc.getPerson.addEventListener(ResultEvent.RESULT, onResult);
xplannerSvc.addEventListener(FaultEvent.FAULT,
showFault);
xplannerSvc.loadWSDL();
xplannerSvc.setRemoteCredentials("jeremy", "jeremy");
xplannerSvc.getPerson(221);
}
and my destination in the proxy-config.xml:
<destination id="xplanner">
<properties>
<wsdl>http://localhost:8080/xplanner/soap/XPlanner?wsdl</wsdl>
<soap>http://localhost:8080/xplanner/soap/XPlanner</soap>
</properties>
<adapter ref="soap-proxy"/>
</destination>
Whenever I call the callService() function, I get a HTTP 401
unauthorized. If I specify the <remote-username> and <remote-password>
in my proxy-config.xml it works as expected. Any ideas on how to get
this to work?
Regards,
Jeremy