View Javadoc

1   /*
2    * Copyright 2001-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.geronimo.ews.ws4j2ee.context.webservices.server.xmlbeans;
17  
18  import com.sun.java.xml.ns.j2Ee.IconType;
19  import com.sun.java.xml.ns.j2Ee.PortComponentType;
20  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.AbstractWSCFWebserviceDescription;
21  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFException;
22  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFPortComponent;
23  import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFWebserviceDescription;
24  
25  /***
26   * This represents a level 1 element in the Element tree :webservice-description. This is the concrete implementation of the
27   * WSCFWebServiceDescription interface
28   */
29  public class WSCFWebserviceDescriptionImpl extends AbstractWSCFWebserviceDescription implements WSCFWebserviceDescription {
30      public WSCFWebserviceDescriptionImpl(com.sun.java.xml.ns.j2Ee.WebserviceDescriptionType wsdes) throws WSCFException {
31          this.description = XMLBeansUtils.getStringValue(wsdes.getDescription());
32          this.displayName = XMLBeansUtils.getStringValue(wsdes.getDisplayName());
33          IconType icon = wsdes.getIcon();
34          if (icon != null) {
35              this.smallIcon = XMLBeansUtils.getStringValue(icon.getSmallIcon());
36              this.largeIcon = XMLBeansUtils.getStringValue(icon.getLargeIcon());
37          }
38          this.webserviceDescriptionName = XMLBeansUtils.getStringValue(wsdes.getWebserviceDescriptionName());
39          this.wsdlFile = XMLBeansUtils.getStringValue(wsdes.getWsdlFile());
40          this.jaxrpcMappingFile = XMLBeansUtils.getStringValue(wsdes.getJaxrpcMappingFile());
41          ;
42          PortComponentType[] list = wsdes.getPortComponentArray();
43          if (0 == list.length) {
44              throw new WSCFException("At least one port-component element should exist in the " + this.description + " webservices element.");
45          }
46          for (int i = 0; i < list.length; i++) {
47              WSCFPortComponent portComponent = new WSCFPortComponentImpl(list[i]);
48              this.portComponent.put(portComponent.getPortComponentName(), portComponent);
49          }
50      }
51  }