Chapter 4 XML Processing
137
}
}
Code Example 4.2
Sending an XML Document Through a Web Service Client Stub
public class SupplierServiceImpl implements SupplierService, ... {
public String submitOrder(Source supplierOrder)
throws InvalidOrderException, RemoteException {
SupplierOrderRcvr supplierOrderRcvr
= new SupplierOrderRcvr();
// Delegate the processing of the incoming document
return supplierOrderRcvr.receive(supplierOrder);
}
}
Code Example 4.3
Receiving an XML Document Through a Web Service Endpoint
JAX RPC passes XML documents that are attachments to SOAP messages as
abstract 
Source
 objects. Thus, you should assume no specific implementation 
StreamSource
, 
SAXSource
, or 
DOMSource
 for an incoming document. You should
also not assume that the underlying JAX RPC implementation will validate or
parse the document before passing it to the Web service endpoint. The developer
should programmatically ensure that the document is valid and conforms to an
expected schema. (See the next section for more information about validation.)
The developer should also ensure that the optimal API is used to bridge between
the specific 
Source
 implementation passed to the endpoint and the intended pro 
cessing model. See  Use the Most Appropriate API  on page 184. 
Producing XML documents that are to be passed as attachments to SOAP
operations can use any XML processing model, provided the resulting document
can be wrapped into a 
Source
 object. The underlying JAX RPC is in charge of
attaching the passed document to the SOAP response message. For example,
Code Example 4.4 and Code Example 4.5 show how to send and receive XML
documents through a JMS queue.
public class SupplierOrderRcvr {
private QueueConnectionFactory queueFactory; 






New Page 1








Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service

java web hosting

 

 

 Our partners: | PHP: Hypertext Preprocessor | Best Web Hosting | Java Web Hosting | Inexpensive Web Hosting |

Jsp Web Hosting | Cheapest Web Hosting | Jsp Hosting | Cheap Hosting

 

Virtualwebstudio. Business web hosting division of Web Design Plus. All rights reserved