Code Fragment 3

private void acceptPOJAXB() throws JAXBException{
     service.addPort(qname, HTTPBinding.HTTP_BINDING, url + "acceptPO");
     Dispatch<Object> dispatcher = service.createDispatch(qname, jc,        
                                     Service.Mode.PAYLOAD);
     Map<String, Object> requestContext = dispatcher.getRequestContext();
     requestContext.put(MessageContext.HTTP_REQUEST_METHOD, "POST");
     JAXBElement<PurchaseOrder> order = new 
                                  ObjectFactory().createPurchaseOrderDocument(createPO());
     JAXBElement<PurchaseOrderStatus> response = 
                                 (JAXBElement<PurchaseOrderStatus>)dispatcher.invoke(order);
     PurchaseOrderStatus result= response.getValue();
     System.out.println("Order id is : " + result.getOrderid());
     System.out.println("Timestamp is : " + result.getTimestamp());
 }