KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > webservice > samples2 > OrderProcessWrappedImpl


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.test.webservice.samples2;
8
9 // $Id: OrderProcessWrappedImpl.java,v 1.1.2.1 2005/02/13 15:24:12 tdiesler Exp $
10

11 /**
12  * An example of a wrapped service endpoint impl
13  *
14  * @author Thomas.Diesler@jboss.org
15  * @since 26-Apr-2004
16  */

17 public class OrderProcessWrappedImpl implements OrderProcessWrapped
18 {
19    public OrderProcess_processOrder_ResponseStruct processOrder(OrderProcess_processOrder_RequestStruct req) throws OrderException
20    {
21       OrderItem[] items = req.getArrayOfOrderItem_1();
22       Person person = req.getPerson_2();
23
24       if (person == null || person.getName() == null)
25          throw new OrderException("Invalid person");
26
27       if (items == null)
28          throw new OrderException("Invalid order items");
29
30       if (items.length > 3)
31          throw new OrderException("Too many order items");
32
33       OrderResponse ordRes = new OrderResponse(items, "aproved");
34
35       OrderProcess_processOrder_ResponseStruct res = new OrderProcess_processOrder_ResponseStruct(ordRes);
36       return res;
37    }
38 }
39
Popular Tags