axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject cvs commit: xml-axis-wsif/java/test/docStyle NWBankTest.java ZipCodeAxisTest.java
Date Fri, 13 Dec 2002 12:17:52 GMT
antelder    2002/12/13 04:17:52

  Modified:    java/src/org/apache/wsif/providers/soap/apacheaxis
                        WSIFOperation_ApacheAxis.java
               java/test/docStyle NWBankTest.java ZipCodeAxisTest.java
  Added:       java/test/docStyle/zipCodeNW ShortZipCode.java
                        ShortZipCodeResponse.java
                        ZipCodeResolverLocator.java ZipCodeResolver.java
                        ZipCodeResolverSoap.java
                        ZipCodeResolverTestCase.java
                        ZipCodeResolverSoapStub.java
  Log:
  Fix AXIS provider to work with non-unwrapped doc style requests and add a testcase for this
  
  Revision  Changes    Path
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ShortZipCode.java
  
  Index: ShortZipCode.java
  ===================================================================
  /**
   * ShortZipCode.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public class ShortZipCode  implements java.io.Serializable {
      private java.lang.String accessCode;
      private java.lang.String address;
      private java.lang.String city;
      private java.lang.String state;
  
      public ShortZipCode() {
      }
  
      public java.lang.String getAccessCode() {
          return accessCode;
      }
  
      public void setAccessCode(java.lang.String accessCode) {
          this.accessCode = accessCode;
      }
  
      public java.lang.String getAddress() {
          return address;
      }
  
      public void setAddress(java.lang.String address) {
          this.address = address;
      }
  
      public java.lang.String getCity() {
          return city;
      }
  
      public void setCity(java.lang.String city) {
          this.city = city;
      }
  
      public java.lang.String getState() {
          return state;
      }
  
      public void setState(java.lang.String state) {
          this.state = state;
      }
  
      private java.lang.Object __equalsCalc = null;
      public synchronized boolean equals(java.lang.Object obj) {
          if (!(obj instanceof ShortZipCode)) return false;
          ShortZipCode other = (ShortZipCode) obj;
          if (obj == null) return false;
          if (this == obj) return true;
          if (__equalsCalc != null) {
              return (__equalsCalc == obj);
          }
          __equalsCalc = obj;
          boolean _equals;
          _equals = true && 
              ((accessCode==null && other.getAccessCode()==null) || 
               (accessCode!=null &&
                accessCode.equals(other.getAccessCode()))) &&
              ((address==null && other.getAddress()==null) || 
               (address!=null &&
                address.equals(other.getAddress()))) &&
              ((city==null && other.getCity()==null) || 
               (city!=null &&
                city.equals(other.getCity()))) &&
              ((state==null && other.getState()==null) || 
               (state!=null &&
                state.equals(other.getState())));
          __equalsCalc = null;
          return _equals;
      }
  
      private boolean __hashCodeCalc = false;
      public synchronized int hashCode() {
          if (__hashCodeCalc) {
              return 0;
          }
          __hashCodeCalc = true;
          int _hashCode = 1;
          if (getAccessCode() != null) {
              _hashCode += getAccessCode().hashCode();
          }
          if (getAddress() != null) {
              _hashCode += getAddress().hashCode();
          }
          if (getCity() != null) {
              _hashCode += getCity().hashCode();
          }
          if (getState() != null) {
              _hashCode += getState().hashCode();
          }
          __hashCodeCalc = false;
          return _hashCode;
      }
  
      // Type metadata
      private static org.apache.axis.description.TypeDesc typeDesc =
          new org.apache.axis.description.TypeDesc(ShortZipCode.class);
  
      static {
          org.apache.axis.description.FieldDesc field = new org.apache.axis.description.ElementDesc();
          field.setFieldName("accessCode");
          field.setXmlName(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"accessCode"));
          field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
          typeDesc.addFieldDesc(field);
          field = new org.apache.axis.description.ElementDesc();
          field.setFieldName("address");
          field.setXmlName(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"address"));
          field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
          typeDesc.addFieldDesc(field);
          field = new org.apache.axis.description.ElementDesc();
          field.setFieldName("city");
          field.setXmlName(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"city"));
          field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
          typeDesc.addFieldDesc(field);
          field = new org.apache.axis.description.ElementDesc();
          field.setFieldName("state");
          field.setXmlName(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"state"));
          field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
          typeDesc.addFieldDesc(field);
      };
  
      /**
       * Return type metadata object
       */
      public static org.apache.axis.description.TypeDesc getTypeDesc() {
          return typeDesc;
      }
  
      /**
       * Get Custom Serializer
       */
      public static org.apache.axis.encoding.Serializer getSerializer(
             java.lang.String mechType, 
             java.lang.Class _javaType,  
             javax.xml.namespace.QName _xmlType) {
          return 
            new  org.apache.axis.encoding.ser.BeanSerializer(
              _javaType, _xmlType, typeDesc);
      }
  
      /**
       * Get Custom Deserializer
       */
      public static org.apache.axis.encoding.Deserializer getDeserializer(
             java.lang.String mechType, 
             java.lang.Class _javaType,  
             javax.xml.namespace.QName _xmlType) {
          return 
            new  org.apache.axis.encoding.ser.BeanDeserializer(
              _javaType, _xmlType, typeDesc);
      }
  
  }
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ShortZipCodeResponse.java
  
  Index: ShortZipCodeResponse.java
  ===================================================================
  /**
   * ShortZipCodeResponse.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public class ShortZipCodeResponse  implements java.io.Serializable {
      private java.lang.String shortZipCodeResult;
  
      public ShortZipCodeResponse() {
      }
  
      public java.lang.String getShortZipCodeResult() {
          return shortZipCodeResult;
      }
  
      public void setShortZipCodeResult(java.lang.String shortZipCodeResult) {
          this.shortZipCodeResult = shortZipCodeResult;
      }
  
      private java.lang.Object __equalsCalc = null;
      public synchronized boolean equals(java.lang.Object obj) {
          if (!(obj instanceof ShortZipCodeResponse)) return false;
          ShortZipCodeResponse other = (ShortZipCodeResponse) obj;
          if (obj == null) return false;
          if (this == obj) return true;
          if (__equalsCalc != null) {
              return (__equalsCalc == obj);
          }
          __equalsCalc = obj;
          boolean _equals;
          _equals = true && 
              ((shortZipCodeResult==null && other.getShortZipCodeResult()==null) ||

               (shortZipCodeResult!=null &&
                shortZipCodeResult.equals(other.getShortZipCodeResult())));
          __equalsCalc = null;
          return _equals;
      }
  
      private boolean __hashCodeCalc = false;
      public synchronized int hashCode() {
          if (__hashCodeCalc) {
              return 0;
          }
          __hashCodeCalc = true;
          int _hashCode = 1;
          if (getShortZipCodeResult() != null) {
              _hashCode += getShortZipCodeResult().hashCode();
          }
          __hashCodeCalc = false;
          return _hashCode;
      }
  
      // Type metadata
      private static org.apache.axis.description.TypeDesc typeDesc =
          new org.apache.axis.description.TypeDesc(ShortZipCodeResponse.class);
  
      static {
          org.apache.axis.description.FieldDesc field = new org.apache.axis.description.ElementDesc();
          field.setFieldName("shortZipCodeResult");
          field.setXmlName(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"ShortZipCodeResult"));
          field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
          typeDesc.addFieldDesc(field);
      };
  
      /**
       * Return type metadata object
       */
      public static org.apache.axis.description.TypeDesc getTypeDesc() {
          return typeDesc;
      }
  
      /**
       * Get Custom Serializer
       */
      public static org.apache.axis.encoding.Serializer getSerializer(
             java.lang.String mechType, 
             java.lang.Class _javaType,  
             javax.xml.namespace.QName _xmlType) {
          return 
            new  org.apache.axis.encoding.ser.BeanSerializer(
              _javaType, _xmlType, typeDesc);
      }
  
      /**
       * Get Custom Deserializer
       */
      public static org.apache.axis.encoding.Deserializer getDeserializer(
             java.lang.String mechType, 
             java.lang.Class _javaType,  
             javax.xml.namespace.QName _xmlType) {
          return 
            new  org.apache.axis.encoding.ser.BeanDeserializer(
              _javaType, _xmlType, typeDesc);
      }
  
  }
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ZipCodeResolverLocator.java
  
  Index: ZipCodeResolverLocator.java
  ===================================================================
  /**
   * ZipCodeResolverLocator.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public class ZipCodeResolverLocator extends org.apache.axis.client.Service implements docStyle.zipCodeNW.ZipCodeResolver
{
  
      /**
       * Given a valid street address, city, and state, this service returns
       * the proper ZIP code, ZIP code+4, or USPS corrected address. NOTE:
       * This service is meant for non-commercial, personal use only.
       */
  
      // Use to get a proxy class for ZipCodeResolverSoap
      private final java.lang.String ZipCodeResolverSoap_address = "http://webservices.eraserver.net/zipcoderesolver/zipcoderesolver.asmx";
  //    private final java.lang.String ZipCodeResolverSoap_address = "http://localhost:8080/soap/servlet/rpcrouter";
  
      public java.lang.String getZipCodeResolverSoapAddress() {
          return ZipCodeResolverSoap_address;
      }
  
      // The WSDD service name defaults to the port name.
      private java.lang.String ZipCodeResolverSoapWSDDServiceName = "ZipCodeResolverSoap";
  
      public java.lang.String getZipCodeResolverSoapWSDDServiceName() {
          return ZipCodeResolverSoapWSDDServiceName;
      }
  
      public void setZipCodeResolverSoapWSDDServiceName(java.lang.String name) {
          ZipCodeResolverSoapWSDDServiceName = name;
      }
  
      public docStyle.zipCodeNW.ZipCodeResolverSoap getZipCodeResolverSoap() throws javax.xml.rpc.ServiceException
{
         java.net.URL endpoint;
          try {
              endpoint = new java.net.URL(ZipCodeResolverSoap_address);
          }
          catch (java.net.MalformedURLException e) {
              return null; // unlikely as URL was validated in WSDL2Java
          }
          return getZipCodeResolverSoap(endpoint);
      }
  
      public docStyle.zipCodeNW.ZipCodeResolverSoap getZipCodeResolverSoap(java.net.URL portAddress)
throws javax.xml.rpc.ServiceException {
          try {
              docStyle.zipCodeNW.ZipCodeResolverSoapStub _stub = new docStyle.zipCodeNW.ZipCodeResolverSoapStub(portAddress,
this);
              _stub.setPortName(getZipCodeResolverSoapWSDDServiceName());
              return _stub;
          }
          catch (org.apache.axis.AxisFault e) {
              return null;
          }
      }
  
      /**
       * For the given interface, get the stub implementation.
       * If this service has no port for the given interface,
       * then ServiceException is thrown.
       */
      public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException
{
          try {
              if (docStyle.zipCodeNW.ZipCodeResolverSoap.class.isAssignableFrom(serviceEndpointInterface))
{
                  docStyle.zipCodeNW.ZipCodeResolverSoapStub _stub = new docStyle.zipCodeNW.ZipCodeResolverSoapStub(new
java.net.URL(ZipCodeResolverSoap_address), this);
                  _stub.setPortName(getZipCodeResolverSoapWSDDServiceName());
                  return _stub;
              }
          }
          catch (java.lang.Throwable t) {
              throw new javax.xml.rpc.ServiceException(t);
          }
          throw new javax.xml.rpc.ServiceException("There is no stub implementation for the
interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
      }
  
      /**
       * For the given interface, get the stub implementation.
       * If this service has no port for the given interface,
       * then ServiceException is thrown.
       */
      public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface)
throws javax.xml.rpc.ServiceException {
          java.rmi.Remote _stub = getPort(serviceEndpointInterface);
          ((org.apache.axis.client.Stub) _stub).setPortName(portName);
          return _stub;
      }
  
      public javax.xml.namespace.QName getServiceName() {
          return new javax.xml.namespace.QName("http://webservices.eraserver.net/", "ZipCodeResolver");
      }
  
      private java.util.HashSet ports = null;
  
      public java.util.Iterator getPorts() {
          if (ports == null) {
              ports = new java.util.HashSet();
              ports.add(new javax.xml.namespace.QName("ZipCodeResolverSoap"));
          }
          return ports.iterator();
      }
  
  }
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ZipCodeResolver.java
  
  Index: ZipCodeResolver.java
  ===================================================================
  /**
   * ZipCodeResolver.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public interface ZipCodeResolver extends javax.xml.rpc.Service {
  
      /**
       * Given a valid street address, city, and state, this service returns
       * the proper ZIP code, ZIP code+4, or USPS corrected address. NOTE:
       * This service is meant for non-commercial, personal use only.
       */
      public java.lang.String getZipCodeResolverSoapAddress();
  
      public docStyle.zipCodeNW.ZipCodeResolverSoap getZipCodeResolverSoap() throws javax.xml.rpc.ServiceException;
  
      public docStyle.zipCodeNW.ZipCodeResolverSoap getZipCodeResolverSoap(java.net.URL portAddress)
throws javax.xml.rpc.ServiceException;
  }
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ZipCodeResolverSoap.java
  
  Index: ZipCodeResolverSoap.java
  ===================================================================
  /**
   * ZipCodeResolverSoap.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public interface ZipCodeResolverSoap extends java.rmi.Remote {
  
      /**
       * Given a valid street address, city, and state, returns the ZIP code
       * in NNNNN format. If an error occurs, returns 00000 instead. Use accessCode
       * of '0' or '9999' for testing.
       */
      public docStyle.zipCodeNW.ShortZipCodeResponse shortZipCode(docStyle.zipCodeNW.ShortZipCode
parameters) throws java.rmi.RemoteException;
  }
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ZipCodeResolverTestCase.java
  
  Index: ZipCodeResolverTestCase.java
  ===================================================================
  /**
   * ZipCodeResolverTestCase.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public class ZipCodeResolverTestCase extends junit.framework.TestCase {
      public ZipCodeResolverTestCase(java.lang.String name) {
          super(name);
      }
      public void test1ZipCodeResolverSoapShortZipCode() {
          docStyle.zipCodeNW.ZipCodeResolverSoap binding;
          try {
              binding = new docStyle.zipCodeNW.ZipCodeResolverLocator().getZipCodeResolverSoap();
          }
          catch (javax.xml.rpc.ServiceException jre) {
              if(jre.getLinkedCause()!=null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught:
" + jre);
          }
          assertTrue("binding is null", binding != null);
  
          try {
              docStyle.zipCodeNW.ShortZipCode zc = new docStyle.zipCodeNW.ShortZipCode();
              zc.setAccessCode("9999");
              zc.setAddress("607 Trinity");
              zc.setCity("Austin");
              zc.setState("TX");
  
              docStyle.zipCodeNW.ShortZipCodeResponse value = null;
              value = binding.shortZipCode(zc);
  
              System.out.println("zipcode=" + value.getShortZipCodeResult());
  
          }
          catch (java.rmi.RemoteException re) {
              throw new junit.framework.AssertionFailedError("Remote Exception caught: " +
re);
          }
      }
  
      public static void main(String[] args) {
     
          ZipCodeResolverTestCase t = new ZipCodeResolverTestCase("KJH");
          t.test1ZipCodeResolverSoapShortZipCode();
      	
      }
  
  }
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/zipCodeNW/ZipCodeResolverSoapStub.java
  
  Index: ZipCodeResolverSoapStub.java
  ===================================================================
  /**
   * ZipCodeResolverSoapStub.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package docStyle.zipCodeNW;
  
  public class ZipCodeResolverSoapStub extends org.apache.axis.client.Stub implements docStyle.zipCodeNW.ZipCodeResolverSoap
{
      private java.util.Vector cachedSerClasses = new java.util.Vector();
      private java.util.Vector cachedSerQNames = new java.util.Vector();
      private java.util.Vector cachedSerFactories = new java.util.Vector();
      private java.util.Vector cachedDeserFactories = new java.util.Vector();
  
      public ZipCodeResolverSoapStub() throws org.apache.axis.AxisFault {
           this(null);
      }
  
      public ZipCodeResolverSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service)
throws org.apache.axis.AxisFault {
           this(service);
           super.cachedEndpoint = endpointURL;
      }
  
      public ZipCodeResolverSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
{
          if (service == null) {
              super.service = new org.apache.axis.client.Service();
          } else {
              super.service = service;
          }
              java.lang.Class cls;
              javax.xml.namespace.QName qName;
              java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
              java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
              java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
              java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
              java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
              java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
              java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
              java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
              qName = new javax.xml.namespace.QName("http://webservices.eraserver.net/", ">ShortZipCodeResponse");
              cachedSerQNames.add(qName);
              cls = docStyle.zipCodeNW.ShortZipCodeResponse.class;
              cachedSerClasses.add(cls);
              cachedSerFactories.add(beansf);
              cachedDeserFactories.add(beandf);
  
              qName = new javax.xml.namespace.QName("http://webservices.eraserver.net/", ">ShortZipCode");
              cachedSerQNames.add(qName);
              cls = docStyle.zipCodeNW.ShortZipCode.class;
              cachedSerClasses.add(cls);
              cachedSerFactories.add(beansf);
              cachedDeserFactories.add(beandf);
  
      }
  
      private org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
          try {
              org.apache.axis.client.Call _call =
                      (org.apache.axis.client.Call) super.service.createCall();
              if (super.maintainSessionSet) {
                  _call.setMaintainSession(super.maintainSession);
              }
              if (super.cachedUsername != null) {
                  _call.setUsername(super.cachedUsername);
              }
              if (super.cachedPassword != null) {
                  _call.setPassword(super.cachedPassword);
              }
              if (super.cachedEndpoint != null) {
                  _call.setTargetEndpointAddress(super.cachedEndpoint);
              }
              if (super.cachedTimeout != null) {
                  _call.setTimeout(super.cachedTimeout);
              }
              if (super.cachedPortName != null) {
                  _call.setPortName(super.cachedPortName);
              }
              java.util.Enumeration keys = super.cachedProperties.keys();
              while (keys.hasMoreElements()) {
                  java.lang.String key = (java.lang.String) keys.nextElement();
                  if(_call.isPropertySupported(key))
                      _call.setProperty(key, super.cachedProperties.get(key));
                  else
                      _call.setScopedProperty(key, super.cachedProperties.get(key));
              }
              // All the type mapping information is registered
              // when the first call is made.
              // The type mapping information is actually registered in
              // the TypeMappingRegistry of the service, which
              // is the reason why registration is only needed for the first call.
              synchronized (this) {
                  if (firstCall()) {
                      // must set encoding style before registering serializers
                      _call.setEncodingStyle(null);
                      for (int i = 0; i < cachedSerFactories.size(); ++i) {
                          java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
                          javax.xml.namespace.QName qName =
                                  (javax.xml.namespace.QName) cachedSerQNames.get(i);
                          java.lang.Class sf = (java.lang.Class)
                                   cachedSerFactories.get(i);
                          java.lang.Class df = (java.lang.Class)
                                   cachedDeserFactories.get(i);
                          _call.registerTypeMapping(cls, qName, sf, df, false);
                      }
                  }
              }
              return _call;
          }
          catch (java.lang.Throwable t) {
              throw new org.apache.axis.AxisFault("Failure trying to get the Call object",
t);
          }
      }
  
      public docStyle.zipCodeNW.ShortZipCodeResponse shortZipCode(docStyle.zipCodeNW.ShortZipCode
parameters) throws java.rmi.RemoteException {
          if (super.cachedEndpoint == null) {
              throw new org.apache.axis.NoEndPointException();
          }
          org.apache.axis.client.Call _call = createCall();
          _call.addParameter(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"ShortZipCode"), new javax.xml.namespace.QName("http://webservices.eraserver.net/", ">ShortZipCode"),
docStyle.zipCodeNW.ShortZipCode.class, javax.xml.rpc.ParameterMode.IN);
          _call.setReturnType(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
">ShortZipCodeResponse"), docStyle.zipCodeNW.ShortZipCodeResponse.class);
          _call.setUseSOAPAction(true);
          _call.setSOAPActionURI("http://webservices.eraserver.net/ShortZipCode");
          _call.setEncodingStyle(null);
          _call.setScopedProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
          _call.setScopedProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
          _call.setOperationStyle("document");
          _call.setOperationName(new javax.xml.namespace.QName("http://webservices.eraserver.net/",
"ShortZipCode"));
  
          java.lang.Object _resp = _call.invoke(new java.lang.Object[] {parameters});
  
          if (_resp instanceof java.rmi.RemoteException) {
              throw (java.rmi.RemoteException)_resp;
          }
          else {
              try {
                  return (docStyle.zipCodeNW.ShortZipCodeResponse) _resp;
              } catch (java.lang.Exception _exception) {
                  return (docStyle.zipCodeNW.ShortZipCodeResponse) org.apache.axis.utils.JavaUtils.convert(_resp,
docStyle.zipCodeNW.ShortZipCodeResponse.class);
              }
          }
      }
  
  }
  
  
  
  1.46      +10 -4     xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFOperation_ApacheAxis.java
  
  Index: WSIFOperation_ApacheAxis.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFOperation_ApacheAxis.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- WSIFOperation_ApacheAxis.java	12 Dec 2002 20:17:33 -0000	1.45
  +++ WSIFOperation_ApacheAxis.java	13 Dec 2002 12:17:52 -0000	1.46
  @@ -1518,6 +1518,12 @@
   			Part p = (Part) soapParts.get(i);
   			String partName = p.getName();
   		    if (!inJmsProps.containsKey(partName)) {
  +		    	if (WSIFAXISConstants.STYLE_DOCUMENT.equals(operationStyle)) {
  +		    		QName qn = p.getElementName();
  +		    		if (qn != null) {
  +		    		    partName = qn.getLocalPart();
  +		    		}
  +		    	}
   			    QName name = new QName(inputNamespace, partName);
   			    QName type = getPartType(p);
   			    call.addParameter(name, type, ParameterMode.IN);
  @@ -1605,15 +1611,15 @@
   			setInputNamespace(bindingQN.getNamespaceURI());
   		}
   
  -//		if (inputSOAPParts == null) {
  -			prepare(call);
  -//		}
  -
   		call.setSOAPActionURI(getSoapActionURI());
   		call.setTargetEndpointAddress(wsifPort.getEndPoint());
   		call.setEncodingStyle(null);
   		inputEncodingStyle = "";
   		outputEncodingStyle = "";
  +
  +//		if (inputSOAPParts == null) {
  +			prepare(call);
  +//		}
   
           // confusingly AXIS style="wrapped" is when there are multiple
           // input parts, 1 for each unwrapped element, and style="document"
  
  
  
  1.6       +2 -2      xml-axis-wsif/java/test/docStyle/NWBankTest.java
  
  Index: NWBankTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/docStyle/NWBankTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NWBankTest.java	12 Dec 2002 11:53:15 -0000	1.5
  +++ NWBankTest.java	13 Dec 2002 12:17:52 -0000	1.6
  @@ -275,7 +275,7 @@
   			String xmlString = "<?xml version=\"1.0\"?>\n" + inputDocument;
   			parser.parse(new InputSource(new StringReader(xmlString)));
   			Element element = parser.getDocument().getDocumentElement();
  -			printElement(element);
  +			//printElement(element);
   
   			inMsg.setObjectPart("parameters", element);
   			
  @@ -289,7 +289,7 @@
   
   			Element responseElement =
   				(Element) outMsg.getObjectPart("parameters");
  -			printElement(responseElement);
  +			//printElement(responseElement);
   			assertTrue("return element is null!!", responseElement != null);
   
   
  
  
  
  1.5       +74 -0     xml-axis-wsif/java/test/docStyle/ZipCodeAxisTest.java
  
  Index: ZipCodeAxisTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/docStyle/ZipCodeAxisTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ZipCodeAxisTest.java	7 Dec 2002 12:34:03 -0000	1.4
  +++ ZipCodeAxisTest.java	13 Dec 2002 12:17:52 -0000	1.5
  @@ -78,6 +78,8 @@
   import org.xml.sax.InputSource;
   
   import docStyle.wsifservice.ZipCodeResolverSoap;
  +import docStyle.zipCodeNW.ShortZipCode;
  +import docStyle.zipCodeNW.ShortZipCodeResponse;
   
   import util.TestUtilities;
   
  @@ -113,6 +115,9 @@
   		TestUtilities.setUpExtensionsAndProviders();
   	}
   
  +	public void testDynamicAxisNW() {
  +		doitDynNW("ZipCodeResolverSoap", "axis");
  +	}
   	public void testDynamicAxis() {
   		doitDyn("ZipCodeResolverSoap", "axis");
   	}
  @@ -166,6 +171,75 @@
   
   			assertTrue("operation returned false!!", ok);
   			String s = (String) outMsg.getObjectPart("ShortZipCodeResult");
  +			assertTrue("wrong zipcode: " + s + "!!", "78701".equals(s));
  +
  +		} catch (Exception ex) {
  +			ex.printStackTrace();
  +			assertTrue(
  +				"AddressBookTest("
  +					+ portName
  +					+ ") caught exception "
  +					+ ex.getLocalizedMessage(),
  +				false);
  +		}
  +	}
  +
  +	private void doitDynNW(String portName, String protocol) {
  +		if (portName.toUpperCase().indexOf("JMS") != -1
  +			&& !TestUtilities.areWeTesting("jms"))
  +			return;
  +
  +		TestUtilities.setProviderForProtocol(protocol);
  +
  +		try {
  +			WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
  +			WSIFService service =
  +				factory.getService(
  +					wsdlLocation,
  +					null,
  +					null,
  +					"http://webservices.eraserver.net/",
  +					"ZipCodeResolverSoap");
  +
  +            service.mapType(
  +               new javax.xml.namespace.QName(
  +                   "http://webservices.eraserver.net/", 
  +                   "ShortZipCode"),
  +               ShortZipCode.class );
  +            service.mapType(
  +               new javax.xml.namespace.QName(
  +                   "http://webservices.eraserver.net/", 
  +                   "ShortZipCodeResponse"),
  +               ShortZipCodeResponse.class );
  +
  +			WSIFPort port = service.getPort(portName);
  +
  +			WSIFOperation operation = port.createOperation("ShortZipCode");
  +
  +			WSIFMessage inMsg = operation.createInputMessage();
  +			WSIFMessage outMsg = operation.createOutputMessage();
  +			WSIFMessage faultMsg = operation.createFaultMessage();
  +
  +            ShortZipCode zc = new ShortZipCode();
  +            zc.setAccessCode("9999");
  +            zc.setAddress("607 Trinity");
  +            zc.setCity("Austin");
  +            zc.setState("TX");
  +
  +			inMsg.setObjectPart("parameters", zc);
  +
  +			boolean ok =
  +				operation.executeRequestResponseOperation(
  +					inMsg,
  +					outMsg,
  +					faultMsg);
  +
  +			assertTrue("operation returned false!!", ok);
  +
  +            ShortZipCodeResponse zcResp =
  +			   (ShortZipCodeResponse) outMsg.getObjectPart("parameters");
  +
  +            String s = zcResp.getShortZipCodeResult();
   			assertTrue("wrong zipcode: " + s + "!!", "78701".equals(s));
   
   		} catch (Exception ex) {
  
  
  

Mime
View raw message