View Javadoc

1   /*******************************************************************************
2    *  Copyright (c) 2005, 2006, 2007 Imola Informatica.
3    *  All rights reserved. This program and the accompanying materials
4    *  are made available under the terms of the LGPL License v2.1
5    *  which accompanies this distribution, and is available at
6    *  http://www.gnu.org/licenses/lgpl.html
7    *******************************************************************************/
8   package it.imolinfo.jbi4cics.jbi.wsdl;
9   
10  import javax.wsdl.Definition;
11  import javax.wsdl.WSDLException;
12  import javax.wsdl.extensions.ExtensibilityElement;
13  import javax.wsdl.extensions.ExtensionDeserializer;
14  import javax.wsdl.extensions.ExtensionRegistry;
15  import javax.xml.namespace.QName;
16  
17  
18  import org.w3c.dom.Element;
19  
20  import com.ibm.wsdl.util.xml.DOMUtils;
21  
22  /**
23   * Deserializer for the Jbi4Corba WSDL Extension (addess element), according with JWSDL specs.
24   * See JSR 110.
25   * 
26   * @author marcopiraccini
27   */
28  public class Jbi4CicsAddressDeserializer implements ExtensionDeserializer {
29  
30  	/**
31  	 * void constructor.
32  	 */
33  	  public Jbi4CicsAddressDeserializer(){
34  		  super();
35  	  }
36  
37      /*
38       * (non-Javadoc)
39       * 
40       * @see javax.wsdl.extensions.ExtensionDeserializer#unmarshall(java.lang.Class,
41       *      javax.xml.namespace.QName, org.w3c.dom.Element,
42       *      javax.wsdl.Definition, javax.wsdl.extensions.ExtensionRegistry)
43       */
44      public ExtensibilityElement unmarshall(Class parentType, QName elementType,
45              Element el, Definition def, ExtensionRegistry extReg)
46      throws WSDLException {
47  
48          Jbi4CicsAddress jbi4CicsAddress = (Jbi4CicsAddress) extReg
49              .createExtension(parentType, elementType);                       
50  
51          jbi4CicsAddress.setUsername(DOMUtils.getAttribute(el,
52                  Jbi4CicsExtension.USERNAME_ATTRIBUTE));
53          
54          jbi4CicsAddress.setPassword(DOMUtils.getAttribute(el,
55                  Jbi4CicsExtension.PASSWORD_ATTRIBUTE));        
56                 
57          jbi4CicsAddress.setConnectionType(DOMUtils.getAttribute(el,
58                  Jbi4CicsExtension.CONNECTION_TYPE_ATTRIBUTE));        
59          
60          jbi4CicsAddress.setJNDIConnectionName(DOMUtils.getAttribute(el,
61                  Jbi4CicsExtension.JNDI_CONNECTION_NAME_ATTRIBUTE));      
62          
63          jbi4CicsAddress.setProgramName(DOMUtils.getAttribute(el,
64                  Jbi4CicsExtension.PROGRAM_NAME_ATTRIBUTE));
65          
66          jbi4CicsAddress.setTransactionName(DOMUtils.getAttribute(el,
67                  Jbi4CicsExtension.TRANSACTION_NAME_ATTRIBUTE));
68          
69          jbi4CicsAddress.setTpn(Boolean.valueOf(DOMUtils.getAttribute(el,
70                  Jbi4CicsExtension.TPN_ATTRIBUTE)));                        
71          
72          return jbi4CicsAddress;
73      }
74  
75  }