Revision 129071 of SOAP in Gecko-based Browsers

  • Revision slug: SOAP_in_Gecko-based_Browsers
  • Revision title: SOAP in Gecko-based Browsers
  • Revision id: 129071
  • Created:
  • Creator: JML
  • Is current revision? No
  • Comment

Revision Content

Transfering from devedge page
http://devedge-temp.mozilla.org/viewsource/2003/soap/01/index_en.html

Work in progress

This article shows how to access web services using the SOAP and JavaScript capabilities available in recent Gecko-based browsers.

  1. Introduction

Simple Object Access Protocol (SOAP) is the basis on which web services are built. It is an XML-based protocol used to communicate and interoperate with web services. With Mozilla 1.0 (upon which Netscape 7.0x is built), it is now possible for the browser to directly communicate with web services using its low-level SOAP implementation through JavaScript.

Gecko's JavaScript interface for establishing SOAP calls is a low-level API which requires one to build the SOAP envelope using several SOAP-specific JavaScript objects. This article will cover the basic SOAP operations, for a more detailed look at the low-level SOAP API in Gecko click here.(Find the equivalent to "soap scripts in mozilla")

Using JavaScript to talk to web services is subject to the same security policies as other scripts in terms of cross domain access. Therefore, accessing web services on a server other than the one where the JavaScript lives will violate the cross-domain policy. This article will show how to temporarily circumvent this for testing purposes.

  1. Setting Up a SOAP Call

The most basic object is SOAPCall, which is used to initiate and invoke a SOAP call.

Figure 1 : Basic setup and invocation of a SOAP Call

var mySOAPCall = new SOAPCall();
mySOAPCall.transportURI = "http-based service URI"
mySOAPCall.encode(0, "method name ", "target object namespaceURI ", 0, null, SOAPParameter array.length, SOAPParameter array);
var response = mySOAPCall.invoke();

A SOAPCall object has a member called transportURI, which is the URI of the location where it should send the SOAP call to. The encode method requires the name of the method to call at the web service, its namespaceURI, the amount of SOAPParameters passed in, and an array of SOAPParameters which contains all the parameters. All these parameters can be found in the WSDL file for the web service, which is discussed in the Example section.

SOAP parameters are created using the SOAPParameter object. They are name/value pairs that are passed to the web service.

Revision Source

<pre>Transfering from devedge page
http://devedge-temp.mozilla.org/viewsource/2003/soap/01/index_en.html

Work in progress
</pre>
<p>This article shows how to access web services using the SOAP and JavaScript capabilities available in recent Gecko-based browsers.</p>
<ol><li><b>Introduction</b>
</li></ol>
<p>Simple Object Access Protocol (SOAP) is the basis on which web services are built. It is an XML-based protocol used to communicate and interoperate with web services. With Mozilla 1.0 (upon which Netscape 7.0x is built), it is now possible for the browser to directly communicate with web services using its low-level SOAP implementation through JavaScript.</p>
<p>Gecko's JavaScript interface for establishing SOAP calls is a low-level API which requires one to build the SOAP envelope using several SOAP-specific JavaScript objects. This article will cover the basic SOAP operations, for a more detailed look at the low-level SOAP API in Gecko click here.(Find the equivalent to "soap scripts in mozilla")</p>
<p>Using JavaScript to talk to web services is subject to the same security policies as other scripts in terms of cross domain access. Therefore, accessing web services on a server other than the one where the JavaScript lives will violate the cross-domain policy. This article will show how to temporarily circumvent this for testing purposes. </p>
<ol><li><b>Setting Up a SOAP Call</b>
</li></ol>
<p>The most basic object is SOAPCall, which is used to initiate and invoke a SOAP call.</p>
<p>Figure 1 : Basic setup and invocation of a SOAP Call
</p>
<pre>var mySOAPCall = new SOAPCall();
mySOAPCall.transportURI = "http-based service URI"
mySOAPCall.encode(0, "method name ", "target object namespaceURI ", 0, null, SOAPParameter array.length, SOAPParameter array);
var response = mySOAPCall.invoke();
</pre>
<p> A SOAPCall object has a member called transportURI, which is the URI of the location where it should send the SOAP call to. The encode method requires the name of the method to call at the web service, its namespaceURI, the amount of SOAPParameters passed in, and an array of SOAPParameters which contains all the parameters. All these parameters can be found in the WSDL file for the web service, which is discussed in the Example section.</p>
<p>
SOAP parameters are created using the SOAPParameter object. They are name/value pairs that are passed to the web service. </p>
Revert to this revision