views:

885

answers:

1

So I've got a bit of an issue I'm trying to work through. Perhaps some Flex guru could assist?

I have a WebService instance that attempts to load a WSDL file from our JBoss Application Server. If I do something like this:

webService = new WebService();
webService.destination = WebService.DEFAULT_DESTINATION_HTTP;
webService.wsdl = "http://<removed>/services/ApiService?wsdl";
webService.loadWSDL();

everything works fine. The WSDL is loaded successfully and the application can invoke methods against the web service.

The issue is when I need to add some HTTP authentication to the mix:

webService.setCredentials(userName, password);

this line ends up throwing an error stating that credentials are only supported on HTTPS. Ok fair enough, I want to use secure HTTPS anyway!

So then I tried to change it up to this...

webService = new WebService();
webService.destination = WebService.DEFAULT_DESTINATION_HTTPS;
webService.wsdl = "https://<removed>/services/ApiService?wsdl";
webService.setCredentials(userName, password);
webService.loadWSDL();

and now the WebService instance cannot load the WSDL. The error received is:

[FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (https://<removed>/services/ApiService?wsdl)"] messageId="6905CC5B-5317-C4B3-2D12-84647EE648A7" type="fault" bubbles=false cancelable=true eventPhase=2]

I can reach this URI in the browser just fine and it returns the WSDL as expected.

I am not a Flex guy (learning) but instead a Java developer. I am trying out Flex as a potential client to our system but this has caused me all kinds of grief today. Google doesn't appear to have any quick answers for me and I am a bit stumped.

First question on StackOverflow so hopefully this gets a bite somewhere and helps some other poor Java dev staying late in the office on a Friday night :-)

A: 

This seems to be related to your question. We are planning to use https in the future, so I'm curious to know the solution of your problem.

Lieven Cardoen
In case that link no longer works... the problem is that I am using a self-signed certificate which pops up a browser warning. Flex will not allow the application to view the WSDL against an untrusted certificate. Once I trusted the certificate I could use the WSDL.Thanks!
Chris Stokes