dw.ws
Class WebReference2
Object
dw.ws.WebReference2
Represents a web service defined in a WSDL file. The implementation is backed by a JAX-WS framework.

This implementation does not support RPC/encoded WSDLs. Such a WSDL must be migrated to a supported encoding such as Document/literal to work with this API.

To create an instance of a WebReference2, you put a web service WSDL file in the webreferences2 directory and reference the WSDL file in a B2C Commerce Script. You then request the service Port using one the the get service methods. For example, if your WSDL file is MyWSDL.wsdl, here is how you create an instance of WebReference2 and access the Port:

 
 var webref : WebReference2 = webreferences2.MyWSDL;
 var port : Port = webref.getDefaultService();
 
 
Note that all script classes representing your WSDL file are placed in the webreferences2 package. To use classes in the webreferences2 package, you do not need to use the importPackage statement in your B2C Commerce Script file.

The generated API may be customized via a property file named <WSDLFile>.properties. For example, if your WSDL file is MyWSDL.wsdl, the property file name is MyWSDL.wsdl.properties. Supported properties include:

  • namespace=true: If the WSDL contains different types with the same name a compilation error may occur. Set this flag to generate a namespace-aware Port, which will have classes separated into packages based on their associated namespace. The default value is false.
  • underscoreBinding=asCharInWord: If you have elements in a WSDL schema that contain the underscore character, code generation may fail. This property will resolve the problem. The default value is asWordSeparator.
  • collectionType=indexed: The generated API will use array types instead of List types for collections. This results in code that is more compatible with older webreferences-based implementations. The default behavior is to generate Lists.
  • enableWrapperStyle=false: The generated API will use "bare" methods when this is false. When this is true, "wrapped" methods may be generated instead. The default value is true, but a false value is more compatible with older webreferences-based implementations.
See Also:
Properties
defaultService  :  Port  (Read Only)
The default service endpoint interface port of the web reference. The default service is determined as the first service based on the alphabetic order of the service name, and within the service the first SOAP port based on the alphabetic order of the port name.
Constructor Summary
Method Summary
getDefaultService() : Port
Returns the default service endpoint interface port of the web reference.
getService(service : String, portName : String) : Port
Returns a specific service from this web reference.
Methods inherited from class Object
Constructor Detail
WebReference2
public WebReference2()

Method Detail
getDefaultService
getDefaultService() : Port
Returns the default service endpoint interface port of the web reference. The default service is determined as the first service based on the alphabetic order of the service name, and within the service the first SOAP port based on the alphabetic order of the port name.
Returns:
the default service of the web reference.

getService
getService(service : String, portName : String) : Port
Returns a specific service from this web reference.
Parameters:
service - the service to locate.
portName - the name of the port to use.
Returns:
a specific service from this web reference.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.