Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 57 58 package com.myeis; 59 60 import java.io.*; 61 import org.apache.wsif.providers.jca.toolplugin.*; 62 import com.myeis.repository.*; 63 import com.myeis.services.*; 64 import com.myeis.services.internal.*; 65 66 public class MyEIS { 67 68 public byte[] doIt(byte[] input) { 69 70 74 75 try { 76 ByteArrayInputStream inputStream = new ByteArrayInputStream(input); 77 78 ObjectInputStream headerInputStream = new ObjectInputStream(inputStream); 80 String functionName = (String )headerInputStream.readObject(); 81 82 if (functionName.equals("IMPORT_PORTTYPES")) { 83 ObjectInputStream payloadInputStream = new ObjectInputStream(inputStream); 85 String queryString = (String )payloadInputStream.readObject(); 86 PortTypeArray portTypeArray = (new Repository()).getPortTypes(queryString); 87 88 ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 89 ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); 90 objectOutputStream.writeObject(portTypeArray); 91 objectOutputStream.flush(); 92 93 return outputStream.toByteArray(); 94 } 95 if (functionName.equals("IMPORT_DEFINITION")) { 96 ObjectInputStream payloadInputStream = new ObjectInputStream(inputStream); 98 PortTypeSelection selection = (PortTypeSelection)payloadInputStream.readObject(); 99 ImportDefinition importDefinition = (new Repository()).getDefinition(selection); 100 101 ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 102 ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); 103 objectOutputStream.writeObject(importDefinition); 104 objectOutputStream.flush(); 105 106 return outputStream.toByteArray(); 107 } 108 if (functionName.equals("IMPORT_RAWMETADATA")) { 109 ObjectInputStream payloadInputStream = new ObjectInputStream(inputStream); 111 String queryString = (String )payloadInputStream.readObject(); 112 byte[] result = (new Repository()).getRawEISMetaData(queryString); 113 114 return result; 115 } 116 if (functionName.equals("CUSTOMERINFO_getCustomer")) { 117 ObjectInputStream payloadInputStream = new ObjectInputStream(inputStream); 119 String number = (String )payloadInputStream.readObject(); 120 CustomerDataObject customer = (new CustomerInfo()).getCustomer(number); 121 122 ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 123 ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); 124 objectOutputStream.writeObject(customer); 125 objectOutputStream.flush(); 126 127 return outputStream.toByteArray(); 128 } 129 if (functionName.equals("PURCHASEORDERINFO_getPurchaseOrder")) { 130 ObjectInputStream payloadInputStream = new ObjectInputStream(inputStream); 132 String number = (String )payloadInputStream.readObject(); 133 PurchaseOrderDataObject purchaseOrder = (new PurchaseOrderInfo()).getPurchaseOrder(number); 134 135 ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 136 ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); 137 objectOutputStream.writeObject(purchaseOrder); 138 objectOutputStream.flush(); 139 140 return outputStream.toByteArray(); 141 } 142 143 if (functionName.equals("CUSTOMERINFO_getAddress")) { 144 ObjectInputStream payloadInputStream = new ObjectInputStream(inputStream); 146 String number = (String )payloadInputStream.readObject(); 147 AddressDataObject address = (new CustomerInfo()).getAddress(number); 148 149 ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); 150 ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); 151 objectOutputStream.writeObject(address); 152 objectOutputStream.flush(); 153 154 return outputStream.toByteArray(); 155 } 156 158 } catch (Exception e) { 159 e.printStackTrace(); 160 } 161 162 return null; 163 } 164 165 } 166 167
| Popular Tags
|