The SOAP Sender Xbean

Note

The SOAP based Xbean support in the current release is limited. Only an RPC style sender is included. This will expand in the future. We document what is in the current release here.

Function

The SOAP Sender is a sink Xbean that sends a DOM document describing an RPC style SOAP request to a Web Service . The SOAP Sender is also a source Xbean. It receives the result DOM document from the Web Service and passes it on to the next Xbean in the Xbean channel.

The SOAP Xbeans have been developed to work with Apache SOAP. 

SOAP Sender XBean Properties

id The URL of the Web Service to receive the SOAP request. 
 compression Compression is not supported by SOAP. This property is ignored. 
DOMListener As with all source Xbeans, the DOMListener property is the next Xbean in the channel. The DOMListener receives the DOM produced as a result of invoking an RPC style request on the Web Service.

Using the SOAP Sender

The sender Xbean is in the org.xbeans.communication.corba.sender package. The sender can be imported into Java source code as follows:

import org.xbeans.communication.soap.sender.SenderBean;

Creating a sender Xbean is accomplished by instantiating the class:

SenderBean sender = new SenderBean();

Note that if you are using a Java Bean design tools found in many Java Integrated Development Environments, the above code is generated automatically when you drag and drop a sender Xbean into your application.

After creating the sender Xbean, you must set the id property. For example:

sender.setId("http://services.xmethods.com:80/soap/servlet/rpcrouter");

You need to get a DOM document by registering the sender with the previous Xbean in the channel.

previousXbean.setDOMListener(sender);

Again, if you are using a Java Bean design tool, the above calls to set properties may be automatically generated for you.

Finally, the sender needs to pass on the DOM document that it received from the Web Service. This is accomplished by setting the sender's DOMListener property.

sender.setDOMListener(viewer);

Source files

source/org/xbeans/communication/soap/*.java
  

Note

The SOAP sender depends on the Apache SOAP implementation. The soap.jar file is included with the Xbeans Communication Pack. However, the soap.jar file depends on mail.jar and activation.jar. So if you are using the SOAP sender you also need to obtain the mail.jar and activation.jar from Sun. You can obtain those two files here and here.