AJAX WebService Component
AJAX WebService Component

Overview
Download
License
Architecture
Tutorial
API
Support

WebService Explorer
WebService Explorer

Overview
Download
Online
License
Guide
Support

API Reference

There is AJAX WebService  Component reference, that describes all public methods and properties for our component, including

  • meta-information management (WSDLInfo  and related classes)
  • WebService invocation (WSClient)

The reference is organized on top-down order: the class that might use certain sub-class defined before that sub-class description.

WSClientParameters

The WSClientParameters  class contains all request parameters for WebService  method invocation. You need to fill  these parameters before calling WebService operation (if any input parameters are necessary). The following list of methods are available:

Add

The method ‘add’ inserts the new input parameter pair to WSClientParameters   object instance. It have no any checks to proper names relevant to schema; you need to validate proper parameter names with your code, or you need to use WSDL-based validation (for document-style calls) and related classes DocumentElement  and SchemaElement   as it described in tutorial.

 

Inputs:

Parameter name

Type

Description

Name

string

Input parameter name (it must be correct WSDL name; otherwise the calling web service may return error

Value

Any type

Input parameter value; there is value to be used into XML request (in textual form). No any validation to WSDL limits will be preformed; so you need to check correct values in your code.

 

Outputs:

  • Current instance of WSClientParameters   class. The operation like parms.add(…).add(…) are allowed.

toXml

The method toXml  serializes content of corresponding instance of WSClientParameters   to XML nodes. These nodes will be used to build envelope in SOAP request. Usually you don’t need to call this method directly except debug purposes.

Inputs:

  • none

Outputs:

  • string representation of XML envelope for SOAP requests.

getParameters

The method getParameters returns request parameters as named Array object. It can be useful when you wont change some of the request values.

Inputs:

  • none

Outputs:

  • Array representation request parameters.

getXml

The getXML method works in the same manner as to toXml  method; but it allow to serialize instance of WSClientParameters object limited to specific complex or array type.

Inputs:

Parameter name

Type

Description

parameters

WSClientParameters

The WSClientParameters  instance to be filled.

name

string

Optional parameter indicates which type will be limited while serializing to XML. This function is useful  in case you need to use only particular complex or array type. If parameter is not specified or null, the getXml () method works in the same manner as toXml () method.

 

Outputs:

  • string representation of XML envelope for SOAP requests

WSClient

The WSClient  class is main class for WebService  invocations. It provides all useful methods to invoke WebServices.

Invoke

The invoke method is main way to call certain WebService  operation, with input parameters already filled and validated before call this method, and creates response.

Inputs:

Parameter name

Type

Description

URL

string

The endpoint URL (it can be found from port definitions in WSDL)

methodName

string

Operation name to be called

Parameters

WSClientParameters

Optional, describes input parameter values if operation needs it. No specific validation against WSDL is performed here.

Asynchronous

bool

Optional, describes if you need callback function to handle response, or you need return value instead. In case asynchronous method is used and callback specified, this method will work in non-blocking mode and you’ll handle WebService  response as it will be delivered. In case no callback specified and “false” option passed, method will wait flow execution until WebService response received and parsed.

callback

Function(XML, string,Array)

Optional, is being used if asynchronous mode were selected (see above). If callback is not specified and asynchronous mode selected, it will be switched to blocking mode.

WSDL

WSDLInfo

The WSDL meta-information description. It needs to be filled with actual data from WSDL.

Outputs:

  • NULL, if asynchronous method were used
  • Array, if response from WebService  given
  • NULL, if any error occurs

WSDLInfo

The WSDLInfo class holds full meta-information about WebService  that WSDL could provide. You need instance for this class to invoke any methods.

loadWSDL

The loadWsdl method load WSDL definition from specific URL, parses, and collects all information from this definition. There is mandatory method to be used before using all other methods.

Inputs:

Parameter name

Type

Description

URL

string

Endpoint URL to proper WSDL definition.

callback

Function()

Function to retrieve indication WSDL document retrieved and parsed. It have no parameters; so you need to know which WSDLInfo  object exploded.

Outputs:

  • none

getServices

The getServices  method provides collection of all services from WSDL.

Inputs:

  • none

Outputs:

  • Collection of services from WSDL file.

getSchemaElements

The getSchemaElements  method provides collection of all XSD elements from WSDL Types sections.

Inputs:

  • none

Outputs:

  • Collection of SchemaElement objects from WSDL types sections.

getWSDL

The getWSDL  method returns reference to WSDL document.

Inputs:

  • none

Outputs:

  • reference to WSDL in XML form.

parseWSDL

The parseWsdl method works in the same manner as loadWSDL  method but uses XML structure instead of URL. It parses WSDL structure and fills it into WSDLInfo  instance.

Inputs:

Parameter name

Type

Description

URL

XML

WSDL definition.

Outputs:

  • none

findOperation

The findOperation  method finds operation from WSDLInfo current  instance.

Inputs:

Parameter name

Type

Description

operationName

string

Operation name to be finding.

portName

string

Port name at witch operation should be finding.

serviceName

string

Service name at witch port name should be finding.

Outputs:

  • Reference for WsdlOperation object or NULL.

schemaElements

The schemaElements collection that holds all schema elements for all document style operations defined in WSDL. It contains definituions for all complex types and arrays in WSDL (all xsd:type definitions). This collection contains SchemaElement  objects and is available as loadWsdl or parseWsdl methods invoked.

WsdlService

The WsdlService class holds information about certain service from WSDL definition. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns service name defined in WSDL.

Inputs:

  • none

Outputs:

  • Service name.

getPorts

The getPorts   method provides collection of ports for service.

Inputs:

  • none

Outputs:

  • Array of WsdlPort  objects.

WsdlPort

The WsdlPort class holds information for certain port of service. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns port name defined in WSDL.

Inputs:

  • none

Outputs:

  • Port name.

getWsdlPortType

The getWsdlPortType  method returns port type defined in WSDL.

Inputs:

  • none

Outputs:

  • Port type in WsdlType  form.

getAddressLocation

The getAddressLocation  method returns exact endpoint URL address defined in WSDL for this port.

Inputs:

  • none

Outputs:

  • Endpoint URL.

WsdlType

The WsdlType class holds port type information. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns port name defined in WSDL.

Inputs:

  • none

Outputs:

  • Port type name.

getOperations

The getOperations   method provides collection of operations for specific port, related to specific port type.

Inputs:

  • none

Outputs:

  • Array of WsdlOperation  objects.

findOperation  

The findOperation  method returns certain operation in port type, or NULL if no operation present.

Inputs:

Parameter name

Type

Description

opName

string

Operation name

Outputs:

  • NULL, if no operation present with that name
  • WsdlOperation  instance, otherwise.

WsdlOperation

The WsdlOperation  class holds information about certain operation from WSDL. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns operation name defined in WSDL.

Inputs:

  • none

Outputs:

  • Operation name.

getInput

The getInput  method returns input parameters defined in WSDL.

Inputs:

  • none

Outputs:

  • Array of input parameters in WsdlInput  form.

getOutput

The getOutput  method returns input parameters defined in WSDL.

Inputs:

  • none

Outputs:

  • Array of outputs in WsdlOutput  form.

getInputParts

The getInputParts  method returns input parts (parameters) defined in WSDL.

Inputs:

  • none

Outputs:

  • Array in WsdlPart  objects from WSDL for current operation.

getOutPutParts  

The getOutPutParts  method returns output parts (parameters) defined in WSDL.

Inputs:

  • none

Outputs:

  • Array in WsdlPart  objects from WSDL for current operation.

getInputParameterMap

The getInputParameterMap   method creates WSClientParameters instance with empty values for each input parameters.

Inputs:

  • none

Outputs:

  • WSClientParameters object for current operation.

Invoke

The invoke method provides generic way to call certain WebService  operation, with input parameters filled.

The invoke method is main way to call certain WebService  operation, with input parameters already filled and validated before call this method, and creates response.

Inputs:

Parameter name

Type

Description

Parameters

WSClientParameters

Optional, describes input parameter values if operation needs it. No specific validation against WSDL is performed here.

Asynchronous

bool

Optional, describes if you need callback function to handle response, or you need return value instead. In case asynchronous method is used and callback specified, this method will work in non-blocking mode and you’ll handle WebService  response as it will be delivered. In case no callback specified and “false” option passed, method will wait flow execution until WebService response received and parsed.

callback

Function(XML, string,Array)

Optional, is being used if asynchronous mode were selected (see above). If callback is not specified and asynchronous mode selected, it will be switched to blocking mode.

Outputs:

  • NULL, if asynchronous method were used
  • Array, if response from WebService  given
  • NULL, if any error occurs

WsdlInput

The WsdlInput  class holds meta-information about input parameters for operation. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns input parameter name defined in WSDL.

Inputs:

  • none

Outputs:

  • Parameter name.

getMessage

The getMessage method returns input parameters details defined in WSDL.

Inputs:

  • none

Outputs:

  • Input parameter definition in WsdlMessage  form.

WsdlOutput

The WsdlOutput  class holds meta-information about response structure for operation. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns output value name defined in WSDL.

Inputs:

  • none

Outputs:

  • Output value name.

getMessage

The getMessage method returns output value details defined in WSDL.

Inputs:

  • none

Outputs:

  • Output value definition in WsdlMessage  form.

WsdlMessage

The WsdlMessage  class holds information about proper types (both input parameters and output values) for input/output. It declares single parameter/output value information. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns message name defined in WSDL.

Inputs:

  • none

Outputs:

  • Message name.

getParts

The getParts method returns parts of message defined in WSDL.

Inputs:

  • none

Outputs:

  • Array of WsdlPart  objects.

WsdlPart

The WsdlPart   this class holds information about certain part for input/output message. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns part name defined in WSDL.

Inputs:

  • none

Outputs:

  • Part name.

getPartType

The getPartType method returns part type defined in WSDL.

Inputs:

  • none

Outputs:

  • Part type.

isDocumentStyle

The isDocumentStyle method returns information in which forms (RPC or document-style) were used to define this part of message.

Inputs:

  • none

Outputs:

  • true, if part defined in document style form
  • false, if RPC-style form were defined in WSDL.

getDocumentStyleElementNode

The getDocumentStyleElementNode  method returns XML element contains part definition, if document style were used.

Inputs:

  • none

Outputs:

  • NULL, if RPC style defined
  • XML element, otherwise.

getDocumentStyleElement

The getDocumentStyleElement  method returns DocumentStyle element contains part definition, if document style were used. This method is pretty similar to getDocumentStyleElementNode   but uses our wrapper instead of clean XML element.

Inputs:

  • none

Outputs:

  • NULL, if RPC style defined

  • DocumentStyle instance, otherwise.

DocumentElement

The DocumentElement  class holds information about message for input/output, in case document-style calls were defined in WSDL. The information is collected from WSDL and WSDLInfo  class responsible to create and fill  proper data.

getName

The getName  method returns element name.

Inputs:

  • none

Outputs:

  • Element name.

parseElement

The parseElement   provides analysis of document style definition in WSDL for this message part. Instead of all other data, you need invoke method this first to get an access to document-style definitions. All other data is being parsed on the fly, but not document style definitions as it is time consuming operation (it able to have rich XSD definitions here, with extensions, 3rd party namespaces and includes of 3rd party XSDs).

Inputs:

  • none.

Outputs:

  • none.

getChildren  

The getChildren  method returns sub-definitions for current element. With these methods you able to navigate for document style definitions for every element.

Inputs:

  • none

Outputs:

  • Array of DocumentElement  and objects.

SchemaElement

The SchemaElement   class holds information about all wsdl:type schema elements. These elements are collected and maintained by WSDLInfo  and collection schemaElements  in WSDLInfo object.

getName

The getName  method returns type name.

Inputs:

  • none

Outputs:

  • Type name.

fill

The fill  method parses current schema type and finds all sub-elements recursively. So by calling this method you’ll initialize schema definition for this type and for all sub-types.

Inputs:

  • none

Outputs:

  • none

getXmlElement

The getXmlElement  method returns XML node describes this XSD type.

Inputs:

  • none

Outputs:

  • XML node

getNamespace

The getNamespace  method returns custom namespace defined for this type, if exists.

Inputs:

  • none

Outputs:

  • Namespace in string form



AJAX WebService Component: Overview Download License Architecture Tutorial API Support
WebService Explorer Overview Download License Guide Support
    Copyright © SCAND LLC, 2007. All Rights Reserved.