1 package com.sun.j2ee.blueprints.supplier.webservice.invoicesender; 2 3 import java.io.*; 4 import java.net.*; 5 import java.rmi.*; 6 import javax.xml.transform.Source; 7 import javax.xml.transform.stream.StreamSource; 8 import javax.xml.rpc.*; 9 10 import com.sun.j2ee.blueprints.supplier.webservice.opcclient.*; 11 import com.sun.j2ee.blueprints.xmldocuments.*; 12 13 14 public class InvoiceSender { 15 public static final boolean TRACE = false; 16 private OPCServiceImpl opcService; 18 19 public InvoiceSender(URL serviceEndPointURL) { 20 try { 21 opcService = (new OPCServiceImplServiceLocator()).getOPCWebService(); 22 } catch (Exception se) { 23 se.printStackTrace(); 24 } 25 26 return; 29 } 30 31 public void submitInvoice(String invoiceDocument) throws RemoteException, InvalidInvoiceException { 32 if (TRACE) { 33 System.err.println("InvoiceSender.order: \n" + invoiceDocument); 34 } 35 submitInvoice(new StreamSource(new StringReader(invoiceDocument))); 36 return; 37 } 38 39 public void submitInvoice(Source invoiceDocument) throws RemoteException, InvalidInvoiceException { 40 opcService.submitInvoice(invoiceDocument); 41 return; 42 } 43 } 44 | Popular Tags |