To invoke web services from your ActionScript code
Dynamic proxy generation
var service:Service = new Service(GatewayURL, null,
"http://www.xmethods.net/sd/2001/DemoTemperatureService.wsdl");
var service:Service = new Service(GatewayURL, null,
"http://127.0.0.1/FluorineWeb/DemoService.asmx?wsdl");
var service:Service = new Service(GatewayURL, null,
"DemoTemperatureService.wsdl");
var service:Service = new Service(GatewayURL, null, "<?xml version="1.0"
?> <definitions name="TemperatureService" ...");
Note: DemoTemperatureService is a "hardcoded" webservice, for details see
http://www.xmethods.com/ve2/ViewListing.po?serviceid=8
When the gateway first time receives a web service remote call it will generate
a proxy assembly for the web service. One should be aware how the Web Services
Description Language tool / the ServiceDescriptionImporter generates proxy code
for XML Web services. The generated types that are used in the proxy class are
based on the contents of the WSDL document that describes the XML Web service.
However, the generated types might not be what you want nor what you expect.
Q326790 HOW TO: Change Types Used in Proxy Classes That Are Generated with Wsdl.exe
The following flags may be specified in the configuration file:
The namespace used for the generated proxy code.
If set to false removes all the generated types that aren't the proxy
itself. This is required if you want to share several types from your code.
To avoid namespace problems you must specify the namespaces to import into the
proxy code by using the importNamespaces configuration section. Please
note that in the current version the "assembly" attribute should be set to an
empty string.
Sample:
This is our shared type's definition
namespace com.ariaware.pizza.vo
{
public class OrderVO
{
string _name;
public OrderVO()
{
}
public string name
{
get{
return _name; }
set{
_name = value; }
}
...
}
}
The web service definition:
using com.ariaware.pizza.vo;
namespace MyWebAppNamespace
{
public class MyWebService : System.Web.Services.WebService
{
[WebMethod]
public void PlaceOrder(OrderVO order)
{
...
}
}
}
In the above sample if proxy class generation is allowed (wsdlGenerateProxyClasses=true) then a new
OrderVO type will be generated. Its fully qualified class name will be com.TheSilentGroup.Fluorine.Proxy.OrderVO.
(This class will not map to com.ariaware.pizza.vo.OrderVO objects sent from Flash)
To avoid generating these proxy classes set wsdlGenerateProxyClasses=false. Also specify in the importNamespaces configuration section the namespaces to import to the proxy code (in this sample the com.ariaware.pizza.vo namespace is required).
<importNamespaces> <add namespace="com.ariaware.pizza.vo" assembly=""/> </importNamespaces>