views:

34

answers:

1

In Flex 3, introspecting a web service resulted in a constructor that allowed the location of the web service to change at runtime. It appears that the Web Service introspection tool now only allows the single WSDL URI that was specified in the WS Wizard. It this the case or am I just missing something?

Flex 3 introspected services would create a service class with the following constructor signatures:

private var service:MyWebService;
service= new MyWebService(null, wsdlLocation);  // With parameters

or you could use:

service = new MyWebService(); //with no parameters

In Flex 4, it appears that you can only use:

service = new MyWebService(); 

So if you don't know the web server location until runtime, am I going to need to manually override the instrospected/generated _super_MyWebService.as class in order to get back the ability to point to different servers at runtime?

Anyone know why this has changed, or what the "new" way the Flash Builder 4 web service introspection tool uses for dynamic servers?

A: 

I found a solution to this question on the Adobe Forums.

The solution is to set the wsdl property once your service is created:

var service:MyWebService = new MyWebService();
service.wsdl = "location to the wsdl";

It should be noted that using the Flash Builder 4 web service introspection tool will automatically populate the wsdl location in the superclass. According to the post on Adobe Forums, it is necessary to remove the wsdl location in the superclass or the value will not get reset.

Shawn Yale