Step 1: Test the WSDL2JS

    1. Store the WSDL file locally on the server.

    2. Start the WSDL to JS utility and enter, file://<fully qualified path to the file>.wsdl

    3. Click Proceed.

If the JavaScript file for the Web service is generated without error messages and ends with:

lib.SOAP.init();
/// End ----------------

… then the WSDL to JS program was able to interpret the WSDL file.

To correctly write the JavaScript functions to call this Web service and generated JavaScript, check the generated JavaScript for the function you want to use, in this case:

this.SOAPOperations[ "RetrieveIncident" ]
 = new soap_Operation( "RetrieveIncident", "Retrieve","document", 
  "RetrieveIncidentRequest",  
  "RetrieveIncidentResponse" );
 

The request can be found within that line and refers to the request function further down:

function RetrieveIncidentRequest(  ) 
{
  this.$$nsPrefix = "ns";
  this.$$attributes = new Array();
  this.$$xmlNames = new Array();
  this.$$objNames = new Array();
  this.$$minOccurs = new Array();
  this.getName = getName;
  this.getXmlName = getXmlName;
  this.setContent = setContent;
  this.addContent = addContent;
  this.getContent = getContent;
  this.isFault = isFault;
  this.$$elementChildren = new Array();
  this.$$name = "RetrieveIncidentRequest";
  this.$$xmlNames[ "RetrieveIncidentRequest" ] = "ns:RetrieveIncidentRequest";
  this.attachmentInfo = new Boolean();
  this.$$attributes.push( "attachmentInfo" );
  this.attachmentData = new Boolean();
  this.$$attributes.push( "attachmentData" );
  this.ignoreEmptyElements = new Boolean("true");
  this.$$attributes.push( "ignoreEmptyElements" );
  this.xmlns = new String("http://servicecenter.peregrine.com/PWS");
  this.$$attributes.push( "xmlns" );
  this.model = new RetrieveIncidentRequest_IncidentModelType();
  this.$$elementChildren.push( "model" );