1 37 38 package com.sun.j2ee.blueprints.opc.webservicebroker.requestor; 39 40 import javax.xml.rpc.*; 41 import javax.naming.*; 42 43 import com.sun.j2ee.blueprints.opc.JNDINames; 44 45 public class LodgingSupplierClient implements WSClient { 46 47 public String sendRequest(String xmlDoc) { 48 String ret = null; 49 try { 50 InitialContext ic = new InitialContext(); 51 LodgingPurchaseOrderService svc = (LodgingPurchaseOrderService) 52 ic.lookup(JNDINames.LODGING_SERVICE_NAME); 53 String endpointURI = (String ) 54 ic.lookup(JNDINames.LODGING_SERVICE_URL); 55 LodgingPOIntf port=(LodgingPOIntf)svc.getPort(LodgingPOIntf.class); 56 57 ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, 60 endpointURI); 61 ret = port.submitLodgingReservationDetails(xmlDoc); 62 } catch(Exception ex) { 63 69 System.err.println(ex); 70 } 71 return ret; 72 } 73 } 74 | Popular Tags |