KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > wsi > scm > retailer > RetailerSoapBindingImpl


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis.wsi.scm.retailer;
17
18 import java.math.BigDecimal JavaDoc;
19
20 import javax.xml.rpc.ServiceException JavaDoc;
21 import javax.xml.rpc.server.ServiceLifecycle JavaDoc;
22
23 import org.apache.axis.wsi.scm.retailer.catalog.CatalogItem;
24 import org.apache.axis.wsi.scm.retailer.catalog.CatalogType;
25
26 /**
27  * Implementation of RetailerPortType
28  *
29  * @author Ias (iasandcb@tmax.co.kr)
30  */

31 public class RetailerSoapBindingImpl implements org.apache.axis.wsi.scm.retailer.RetailerPortType, ServiceLifecycle JavaDoc {
32
33     CatalogType catalog = new CatalogType();
34
35     public org.apache.axis.wsi.scm.retailer.catalog.CatalogType getCatalog() throws java.rmi.RemoteException JavaDoc {
36         return catalog;
37     }
38
39     public org.apache.axis.wsi.scm.retailer.order.PartsOrderResponseType submitOrder(
40         org.apache.axis.wsi.scm.retailer.order.PartsOrderType partsOrder,
41         org.apache.axis.wsi.scm.retailer.order.CustomerDetailsType customerDetails,
42         org.apache.axis.wsi.scm.configuration.ConfigurationType configurationHeader)
43         throws
44             java.rmi.RemoteException JavaDoc,
45             org.apache.axis.wsi.scm.retailer.order.InvalidProductCodeType,
46             org.apache.axis.wsi.scm.retailer.BadOrderFault,
47             org.apache.axis.wsi.scm.configuration.ConfigurationFaultType {
48         return null;
49     }
50
51     /**
52      * @see javax.xml.rpc.server.ServiceLifecycle#init(java.lang.Object)
53      */

54     public void init(Object JavaDoc context) throws ServiceException JavaDoc {
55         CatalogItem[] items = new CatalogItem[10];
56         items[0] = new CatalogItem();
57         items[0].setName("TV, Brand1");
58         items[0].setDescription("24in, Color, Advanced Velocity Scan Modulation, Stereo");
59         items[0].setProductNumber(new java.math.BigInteger JavaDoc("605001"));
60         items[0].setCategory("TV");
61         items[0].setBrand("Brand1");
62         items[0].setPrice((new BigDecimal JavaDoc(299.95)).setScale(2, BigDecimal.ROUND_HALF_UP));
63
64         items[1] = new CatalogItem();
65         items[1].setName("TV, Brand2");
66         items[1].setDescription("32in, Super Slim Flat Panel Plasma");
67         items[1].setProductNumber(new java.math.BigInteger JavaDoc("605002"));
68         items[1].setCategory("TV");
69         items[1].setBrand("Brand2");
70         items[1].setPrice((new BigDecimal JavaDoc(1499.99)).setScale(2, BigDecimal.ROUND_HALF_UP));
71
72         items[2] = new CatalogItem();
73         items[2].setName("TV, Brand3");
74         items[2].setDescription("50in, Plasma Display");
75         items[2].setProductNumber(new java.math.BigInteger JavaDoc("605003"));
76         items[2].setCategory("TV");
77         items[2].setBrand("Brand3");
78         items[2].setPrice(new BigDecimal JavaDoc("5725.98"));
79
80         items[3] = new CatalogItem();
81         items[3].setName("Video, Brand1");
82         items[3].setDescription("S-VHS");
83         items[3].setProductNumber(new java.math.BigInteger JavaDoc("605004"));
84         items[3].setCategory("Video");
85         items[3].setBrand("Brand1");
86         items[3].setPrice(new BigDecimal JavaDoc("199.95"));
87
88         items[4] = new CatalogItem();
89         items[4].setName("Video, Brand2");
90         items[4].setDescription("HiFi, S-VHS");
91         items[4].setProductNumber(new java.math.BigInteger JavaDoc("605005"));
92         items[4].setCategory("Video");
93         items[4].setBrand("Brand2");
94         items[4].setPrice(new BigDecimal JavaDoc("400.00"));
95
96         items[5] = new CatalogItem();
97         items[5].setName("Video, Brand3");
98         items[5].setDescription("s-vhs, mindv");
99         items[5].setProductNumber(new java.math.BigInteger JavaDoc("605006"));
100         items[5].setCategory("Video");
101         items[5].setBrand("Brand3");
102         items[5].setPrice(new BigDecimal JavaDoc("949.99"));
103
104         items[6] = new CatalogItem();
105         items[6].setName("DVD, Brand1");
106         items[6].setDescription("DVD-Player W/Built-In Dolby Digital Decoder");
107         items[6].setProductNumber(new java.math.BigInteger JavaDoc("605007"));
108         items[6].setCategory("DVD");
109         items[6].setBrand("Brand1");
110         items[6].setPrice(new BigDecimal JavaDoc("100.00"));
111
112         items[7] = new CatalogItem();
113         items[7].setName("DVD, Brand2");
114         items[7].setDescription(
115             "Plays DVD-Video discs, CDs, stereo and multi-channel SACDs, and audio CD-Rs & CD-RWs, 27MHz/10-bit video DAC, ");
116         items[7].setProductNumber(new java.math.BigInteger JavaDoc("605008"));
117         items[7].setCategory("DVD");
118         items[7].setBrand("Brand2");
119         items[7].setPrice(new BigDecimal JavaDoc("200.00"));
120
121         items[8] = new CatalogItem();
122         items[8].setName("DVD, Brand3");
123         items[8].setDescription(
124             "DVD Player with SmoothSlow forward/reverse; Digital Video Enhancer; DVD/CD Text; Custom Parental Control (20-disc); Digital Cinema Sound modes");
125         items[8].setProductNumber(new java.math.BigInteger JavaDoc("605009"));
126         items[8].setCategory("DVD");
127         items[8].setBrand("Brand3");
128         items[8].setPrice(new BigDecimal JavaDoc("250.00"));
129
130         // This one is an invalid product
131
items[9] = new CatalogItem();
132         items[9].setName("TV, Brand4");
133         items[9].setDescription(
134             "Designated invalid product code that is allowed to appear in the catalog, but is unable to be ordered");
135         items[9].setProductNumber(new java.math.BigInteger JavaDoc("605010"));
136         items[9].setCategory("TV");
137         items[9].setBrand("Brand4");
138         items[9].setPrice(new BigDecimal JavaDoc("149.99"));
139         catalog.setItem(items);
140     }
141
142     /**
143      * @see javax.xml.rpc.server.ServiceLifecycle#destroy()
144      */

145     public void destroy() {
146     }
147
148 }
149
Popular Tags