BiWebService2
Construct a web service client. A BiWebService2 object allows accessing web services through SOAP, based on a WSDL describing the services' interfaces. To use BiWebService2, first construct an object of this class. Then, call the object's useService method -- passing the URL to the WSDL describing the service and the service's name. Finally, call syncInvoke, asyncInvoke and callMethod to invoke service operations synchronously or asynchronously.
This class extends
BiEventTarget
and therefore all methods and fields available for
BiEventTarget
are also available for
BiWebService2
.
Constructor
new
BiWebService2
(
)
Parameters
No parameters.
Properties
| Name | Type | get | set | Descripton |
async |
Boolean |
![]() |
![]() |
This property determines whether or not calls made by the web service using callMethod and service loading using useService without specifying an async flag is done asynchronously. |
loaded |
Boolean Indication of whether the service is loaded and ready for action |
![]() |
Return a boolean indicating whether the service is loaded and ready for action or not. | |
wsdl |
|
![]() |
Retrieve the WSDL object used to connect to the web service. |
Methods
| Name | Description |
asyncInvoke |
Invoke a web-service operation asynchronously. Return a cookie which will be passed in the wscallcomplete event to identify the completed call. |
callMethod |
Invoke a web-service operation either synchronously or asynchronously, depending on the value of this._async. For asynchronous invocations return value, see asyncInvoke. For synchronous invocations return value, see syncInvoke. |
popCallContext |
Pop a call context object from the stack. |
pushCallContext |
Push a call context object to the stack. This object will server as the call context of all subsequent calls until a call to popCallContext (or another call to pushCallContext) |
syncInvoke |
Invoke a web-service operation synchronously. Return the invoked service's result, or throw an exception in case of an error or a service-returned fault. The function returns the operation's result if the operation doesn't include out parameters; it returns an object consisting of a field named 'result' storing the return value and additional fields for each out parameter if out parameters exist. |
useService |
Prepare this WebService2 object to operate a web service described in a WSDL document. |
Events
| Name | Type | Bubbles | Descripton |
callcomplete |
|
Notifies that an asynchronous web service operation invocation was completed, either succesfuly or with errors. | |
serviceloaded |
|
Notifies that loading the WSDL used to describe the service represented by this instance is complete. If the event has an 'err' member, this describes an error which occurred during loading. |
Static Methods
None.
Static Fields
None.
Remarks
Method Details
asyncInvoke
Invoke a web-service operation asynchronously. Return a cookie which will be passed in the wscallcomplete event to identify the completed call.
Syntax
object.asyncInvoke ( aOpName,other )
Parameters
| Name | Type | Optional | Default | Descripton |
aOpName |
String |
Name of operation to invoke | ||
other |
arguments |
Web service operation invocation parameters |
Return Type
void
callMethod
Invoke a web-service operation either synchronously or asynchronously, depending on the value of this._async. For asynchronous invocations return value, see asyncInvoke. For synchronous invocations return value, see syncInvoke.
Syntax
object.callMethod ( aOpName,other )
Parameters
| Name | Type | Optional | Default | Descripton |
aOpName |
String |
Name of operation to invoke | ||
other |
arguments |
Web service operation invocation parameters |
Return Type
Object
popCallContext
Pop a call context object from the stack.
Syntax
object.popCallContext ( )
Parameters
No arguments.
Return Type
void
pushCallContext
Push a call context object to the stack. This object will server as the call context of all subsequent calls until a call to popCallContext (or another call to pushCallContext)
Syntax
object.pushCallContext ( aContext,aAdditive )
Parameters
| Name | Type | Optional | Default | Descripton |
aContext |
Object |
Context object to push. | ||
aAdditive |
Boolean |
Should fields of current call context be added to this call context? (unless named the same as existing fields) |
Return Type
void
syncInvoke
Invoke a web-service operation synchronously. Return the invoked service's result, or throw an exception in case of an error or a service-returned fault. The function returns the operation's result if the operation doesn't include out parameters; it returns an object consisting of a field named 'result' storing the return value and additional fields for each out parameter if out parameters exist.
Syntax
object.syncInvoke ( aOpName,other )
Parameters
| Name | Type | Optional | Default | Descripton |
aOpName |
String |
Name of operation to invoke | ||
other |
arguments |
Web service operation invocation parameters |
Return Type
Object
useService
Prepare this WebService2 object to operate a web service described in a WSDL document.
Syntax
object.useService ( aWsdlUri,aServiceName,aAsync )
Parameters
| Name | Type | Optional | Default | Descripton |
aWsdlUri |
String |
URL to WSDL describing service desired to be accessed | ||
aServiceName |
String |
Name of service to access | ||
aAsync |
Boolean |
If true, call will be asyncly processed; if false, call will return only after the WSDL is available and parsed. |
Return Type
void
