01: package com.sun.j2ee.blueprints.supplier.webservice.invoicesender;
02:
03: import java.io.*;
04: import java.net.*;
05: import java.rmi.*;
06: import javax.xml.transform.Source;
07: import javax.xml.transform.stream.StreamSource;
08: import javax.xml.rpc.*;
09:
10: import com.sun.j2ee.blueprints.supplier.webservice.opcclient.*;
11: import com.sun.j2ee.blueprints.xmldocuments.*;
12:
13: public class InvoiceSender {
14: public static final boolean TRACE = false;
15: // private OPCService_Stub opcService;
16: private OPCServiceImpl opcService;
17:
18: public InvoiceSender(URL serviceEndPointURL) {
19: try {
20: opcService = (new OPCServiceImplServiceLocator())
21: .getOPCWebService();
22: } catch (Exception se) {
23: se.printStackTrace();
24: }
25:
26: //opcService = (OPCService_Stub) new OPCWebService_Impl().getOPCServicePort();
27: //opcService._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, serviceEndPointURL.toString());
28: return;
29: }
30:
31: public void submitInvoice(String invoiceDocument)
32: throws RemoteException, InvalidInvoiceException {
33: if (TRACE) {
34: System.err.println("InvoiceSender.order: \n"
35: + invoiceDocument);
36: }
37: submitInvoice(new StreamSource(
38: new StringReader(invoiceDocument)));
39: return;
40: }
41:
42: public void submitInvoice(Source invoiceDocument)
43: throws RemoteException, InvalidInvoiceException {
44: opcService.submitInvoice(invoiceDocument);
45: return;
46: }
47: }
|