This UML drawing shows the basic structure of the client application.
resp.setContentType("text/html");
String responseURL = null;
String fullURL =
req.getRequestURI();
// get the screen name
String selectedURL = null;
int lastPathSeparator =
fullURL.lastIndexOf("/") + 1;
if (lastPathSeparator != -1)
{
selectedURL = fullURL.substring(lastPathSeparator, fullURL.length());
}
responseURL =
getResponseURL(selectedURL);
if
(selectedURL.equals("invokeservice.do")) {
try {
handler.handle(req,resp);
}
catch (RequestHandlerException re) {
req.setAttribute("error_message", re.getMessage());
responseURL = getResponseURL("error.do");
}
}
getServletConfig().getServletContext()
.getRequestDispatcher(responseURL).forward(req, resp);
Code Example 1: Snippet From FrontController.java
if(request.getParameter("type").equals("String")){
ret = stringPOService.submitPO(po);
}
else if(request.getParameter("type").equals("Object")){
ret = schemaPOService.submitPO(po);
}
else if(request.getParameter("type").equals("AnyType")){
ret = anyTypePOService.submitPO(po);
}
else if(request.getParameter("type").equals("Any")){
ret = anyPOService.submitPO(po);
}
else if(request.getParameter("type").equals("Attachment")){
ret = attachmentPOService.submitPO(po);
}
request.setAttribute("result",
ret);
Code Example 2: Snippet From RequestHandler.java
SchemaDefinedPurchaseOrderServiceSEI port =
(SchemaDefinedPurchaseOrderServiceSEI)
serviceLocator.getServicePort(JNDINames.SCHEMA_SERVICE_REF,
SchemaDefinedPurchaseOrderServiceSEI.class);
...
String ret = port.submitPO(order);
Code Example 3: Snippet From SchemaPOServiceBD.java
<service-ref>
<description>Schema defined Purchase Order
Service Client</description>
<service-ref-name>service/SchemaDefinedPurchaseOrderService</service-ref-name>
<service-interface>
com.sun.j2ee.blueprints.docoriented.client.objectposervice.SchemaDefinedPurchaseOrderService
</service-interface>
<wsdl-file>WEB-INF/wsdl/SchemaDefinedPurchaseOrderService.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/schemadefinedpurchaseorderservice-mapping.xml</jaxrpc-mapping-file>
<service-qname
xmlns:servicens="urn:SchemaDefinedPurchaseOrderService">servicens:SchemaDefinedPurchaseOrderService
</service-qname>
</service-ref>
Code Example 4: Snippet From web.xml
Document as a String |
WSDL for the StringPurchaseOrderService |
Document as a Schema-defined type |
WSDL
for the SchemaDefinedPurchaseOrderService |
Document as xsd:anyType |
WSDL
for the AnyTypePurchaseOrderService |
Document as a xsd:any |
WSDL
for the AnyPurchaseOrderService |
Document as attachment |
WSDL
for the AttachmentPurchaseOrderService |