Author: apatel
Date: Fri Jun 22 22:15:10 2007
New Revision: 550009
URL: http://svn.apache.org/viewvc?view=rev&rev=550009
Log:
modified service for showShipment to accept stream.
Modified:
ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml
Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml?view=diff&rev=550009&r1=550008&r2=550009
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/oagis/servicedef/services.xml Fri Jun 22
22:15:10 2007
@@ -49,5 +49,10 @@
<auto-attributes mode="IN" include="pk" optional="false"/>
<auto-attributes mode="IN" include="nonpk" optional="true"/>
</service>
+ <service name="showShipment" engine="java" transaction-timeout="300"
+ location="org.ofbiz.oagis.OagisShipmentServices"
invoke="showShipment" auth="false">
+ <description>Process incoming shipment message</description>
+ <implements service="serviceStreamInterface"/>
+ </service>
</services>
Modified:
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=550009&r1=550008&r2=550009
==============================================================================
---
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
(original)
+++
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
Fri Jun 22 22:15:10 2007
@@ -18,16 +18,36 @@
specific language governing permissions and limitations
under the License.
**/
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
import java.util.Map;
+import org.w3c.dom.Document;
+
import org.ofbiz.service.DispatchContext;
import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.base.util.*;
public class OagisShipmentServices {
public static final String module = OagisShipmentServices.class.getName();
public static Map showShipment(DispatchContext ctx, Map context) {
- return ServiceUtil.returnError("Service not Implemented");
+ InputStream in = (InputStream) context.get("inputStream");
+ OutputStream out = (OutputStream) context.get("outputStream");
+ try{
+ Document doc = UtilXml.readXmlDocument(in, true, "ShowShipment");
+ }catch (Exception e){
+ Debug.logError(e, module);
+ }
+ PrintWriter writer = new PrintWriter(new OutputStreamWriter(out));
+ writer.println("Service not Implemented");
+ writer.flush();
+ Map result = ServiceUtil.returnError("Service not Implemented");
+ return result;
+
}
+
}
Modified: ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml?view=diff&rev=550009&r1=550008&r2=550009
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml
(original)
+++ ofbiz/trunk/specialpurpose/oagis/webapp/oagis/WEB-INF/controller.xml Fri
Jun 22 22:15:10 2007
@@ -29,6 +29,7 @@
<handler name="soap" type="request"
class="org.ofbiz.webapp.event.SOAPEventHandler"/>
<handler name="service" type="request"
class="org.ofbiz.webapp.event.ServiceEventHandler"/>
<handler name="simple" type="request"
class="org.ofbiz.webapp.event.SimpleEventHandler"/>
+ <handler name="stream" type="request"
class="org.ofbiz.webapp.event.ServiceStreamHandler"/>
<!-- view handlers -->
<handler name="jsp" type="view"
class="org.ofbiz.webapp.view.JspViewHandler"/>
@@ -179,6 +180,12 @@
<response name="success" type="view" value="UploadOagisMessage" />
<response name="error" type="view" value="UploadOagisMessage"/>
</request-map>
+
+ <request-map uri="showShipment">
+ <event type="stream" invoke="showShipment"/>
+ <response name="success" type="none"/>
+ </request-map>
+
<!-- end of request mappings -->