001: /*
002: * Copyright 2002-2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.axis.wsi.scm.retailer;
017:
018: import java.math.BigDecimal;
019:
020: import javax.xml.rpc.ServiceException;
021: import javax.xml.rpc.server.ServiceLifecycle;
022:
023: import org.apache.axis.wsi.scm.retailer.catalog.CatalogItem;
024: import org.apache.axis.wsi.scm.retailer.catalog.CatalogType;
025:
026: /**
027: * Implementation of RetailerPortType
028: *
029: * @author Ias (iasandcb@tmax.co.kr)
030: */
031: public class RetailerSoapBindingImpl implements
032: org.apache.axis.wsi.scm.retailer.RetailerPortType,
033: ServiceLifecycle {
034:
035: CatalogType catalog = new CatalogType();
036:
037: public org.apache.axis.wsi.scm.retailer.catalog.CatalogType getCatalog()
038: throws java.rmi.RemoteException {
039: return catalog;
040: }
041:
042: public org.apache.axis.wsi.scm.retailer.order.PartsOrderResponseType submitOrder(
043: org.apache.axis.wsi.scm.retailer.order.PartsOrderType partsOrder,
044: org.apache.axis.wsi.scm.retailer.order.CustomerDetailsType customerDetails,
045: org.apache.axis.wsi.scm.configuration.ConfigurationType configurationHeader)
046: throws java.rmi.RemoteException,
047: org.apache.axis.wsi.scm.retailer.order.InvalidProductCodeType,
048: org.apache.axis.wsi.scm.retailer.BadOrderFault,
049: org.apache.axis.wsi.scm.configuration.ConfigurationFaultType {
050: return null;
051: }
052:
053: /**
054: * @see javax.xml.rpc.server.ServiceLifecycle#init(java.lang.Object)
055: */
056: public void init(Object context) throws ServiceException {
057: CatalogItem[] items = new CatalogItem[10];
058: items[0] = new CatalogItem();
059: items[0].setName("TV, Brand1");
060: items[0]
061: .setDescription("24in, Color, Advanced Velocity Scan Modulation, Stereo");
062: items[0].setProductNumber(new java.math.BigInteger("605001"));
063: items[0].setCategory("TV");
064: items[0].setBrand("Brand1");
065: items[0].setPrice((new BigDecimal(299.95)).setScale(2,
066: BigDecimal.ROUND_HALF_UP));
067:
068: items[1] = new CatalogItem();
069: items[1].setName("TV, Brand2");
070: items[1].setDescription("32in, Super Slim Flat Panel Plasma");
071: items[1].setProductNumber(new java.math.BigInteger("605002"));
072: items[1].setCategory("TV");
073: items[1].setBrand("Brand2");
074: items[1].setPrice((new BigDecimal(1499.99)).setScale(2,
075: BigDecimal.ROUND_HALF_UP));
076:
077: items[2] = new CatalogItem();
078: items[2].setName("TV, Brand3");
079: items[2].setDescription("50in, Plasma Display");
080: items[2].setProductNumber(new java.math.BigInteger("605003"));
081: items[2].setCategory("TV");
082: items[2].setBrand("Brand3");
083: items[2].setPrice(new BigDecimal("5725.98"));
084:
085: items[3] = new CatalogItem();
086: items[3].setName("Video, Brand1");
087: items[3].setDescription("S-VHS");
088: items[3].setProductNumber(new java.math.BigInteger("605004"));
089: items[3].setCategory("Video");
090: items[3].setBrand("Brand1");
091: items[3].setPrice(new BigDecimal("199.95"));
092:
093: items[4] = new CatalogItem();
094: items[4].setName("Video, Brand2");
095: items[4].setDescription("HiFi, S-VHS");
096: items[4].setProductNumber(new java.math.BigInteger("605005"));
097: items[4].setCategory("Video");
098: items[4].setBrand("Brand2");
099: items[4].setPrice(new BigDecimal("400.00"));
100:
101: items[5] = new CatalogItem();
102: items[5].setName("Video, Brand3");
103: items[5].setDescription("s-vhs, mindv");
104: items[5].setProductNumber(new java.math.BigInteger("605006"));
105: items[5].setCategory("Video");
106: items[5].setBrand("Brand3");
107: items[5].setPrice(new BigDecimal("949.99"));
108:
109: items[6] = new CatalogItem();
110: items[6].setName("DVD, Brand1");
111: items[6]
112: .setDescription("DVD-Player W/Built-In Dolby Digital Decoder");
113: items[6].setProductNumber(new java.math.BigInteger("605007"));
114: items[6].setCategory("DVD");
115: items[6].setBrand("Brand1");
116: items[6].setPrice(new BigDecimal("100.00"));
117:
118: items[7] = new CatalogItem();
119: items[7].setName("DVD, Brand2");
120: items[7]
121: .setDescription("Plays DVD-Video discs, CDs, stereo and multi-channel SACDs, and audio CD-Rs & CD-RWs, 27MHz/10-bit video DAC, ");
122: items[7].setProductNumber(new java.math.BigInteger("605008"));
123: items[7].setCategory("DVD");
124: items[7].setBrand("Brand2");
125: items[7].setPrice(new BigDecimal("200.00"));
126:
127: items[8] = new CatalogItem();
128: items[8].setName("DVD, Brand3");
129: items[8]
130: .setDescription("DVD Player with SmoothSlow forward/reverse; Digital Video Enhancer; DVD/CD Text; Custom Parental Control (20-disc); Digital Cinema Sound modes");
131: items[8].setProductNumber(new java.math.BigInteger("605009"));
132: items[8].setCategory("DVD");
133: items[8].setBrand("Brand3");
134: items[8].setPrice(new BigDecimal("250.00"));
135:
136: // This one is an invalid product
137: items[9] = new CatalogItem();
138: items[9].setName("TV, Brand4");
139: items[9]
140: .setDescription("Designated invalid product code that is allowed to appear in the catalog, but is unable to be ordered");
141: items[9].setProductNumber(new java.math.BigInteger("605010"));
142: items[9].setCategory("TV");
143: items[9].setBrand("Brand4");
144: items[9].setPrice(new BigDecimal("149.99"));
145: catalog.setItem(items);
146: }
147:
148: /**
149: * @see javax.xml.rpc.server.ServiceLifecycle#destroy()
150: */
151: public void destroy() {
152: }
153:
154: }
|