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 AirlineSupplierClient implements WSClient { 46 47 public String sendRequest(String xmlDoc) { 48 String ret = null; 49 try { 50 InitialContext ic = new InitialContext(); 51 AirlinePurchaseOrderService svc = (AirlinePurchaseOrderService) 52 ic.lookup(JNDINames.AIRLINE_SERVICE_NAME); 53 String endpointURI = (String ) 54 ic.lookup(JNDINames.AIRLINE_SERVICE_URL); 55 AirlinePOIntf port=(AirlinePOIntf)svc.getPort(AirlinePOIntf.class); 56 57 ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, 60 endpointURI); 61 ret = port.submitAirlineReservationDetails(xmlDoc); 62 } catch (Exception ex) { 63 69 System.err.println(ex); 70 } 71 return ret; 72 } 73 } 74 | Popular Tags |