You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2003/04/28 16:02:38 UTC

cvs commit: xml-axis/java/test/RPCDispatch TestSerializedRPC.java

dims        2003/04/28 07:02:37

  Modified:    java/src/org/apache/axis/description ServiceDesc.java
               java/test/RPCDispatch TestSerializedRPC.java
  Log:
  Fix for Bug 18848 - Wrong WSDL generated from wrapped web service
  
  Notes:
  - Add a default namespace if if there is no <namespace> element in the WSDD file.
  
  Revision  Changes    Path
  1.76      +4 -0      xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
  
  Index: ServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- ServiceDesc.java	28 Apr 2003 01:55:51 -0000	1.75
  +++ ServiceDesc.java	28 Apr 2003 14:02:37 -0000	1.76
  @@ -70,6 +70,7 @@
   import org.apache.axis.utils.Messages;
   import org.apache.axis.utils.bytecode.ParamNameExtractor;
   import org.apache.axis.wsdl.Skeleton;
  +import org.apache.axis.wsdl.fromJava.Namespaces;
   import org.apache.commons.logging.Log;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
  @@ -1114,6 +1115,9 @@
               // If we have a default namespace mapping, require callers to
               // use that namespace.
               defaultNS = (String)namespaceMappings.get(0);
  +        }
  +        if(defaultNS.length() == 0) {
  +            defaultNS = Namespaces.makeNamespace(method.getDeclaringClass().getName());
           }
           operation.setElementQName(new QName(defaultNS, method.getName()));
           operation.setMethod(method);
  
  
  
  1.39      +8 -7      xml-axis/java/test/RPCDispatch/TestSerializedRPC.java
  
  Index: TestSerializedRPC.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/TestSerializedRPC.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- TestSerializedRPC.java	22 Apr 2003 17:40:06 -0000	1.38
  +++ TestSerializedRPC.java	28 Apr 2003 14:02:37 -0000	1.39
  @@ -46,8 +46,8 @@
       private SimpleProvider provider = new SimpleProvider();
       private AxisServer engine = new AxisServer(provider);
   
  -    String firstParamName = null;
  -    String secondParamName = null;
  +    QName firstParamName = null;
  +    QName secondParamName = null;
   
       private String SOAPAction = "urn:reverse";
   
  @@ -83,8 +83,8 @@
           OperationDesc oper = desc.getOperationByName("concatenate");
           assertNotNull(oper);
   
  -        firstParamName = oper.getParameter(0).getName();
  -        secondParamName = oper.getParameter(1).getName();
  +        firstParamName = oper.getParameter(0).getQName();
  +        secondParamName = oper.getParameter(1).getQName();
       }
   
       /**
  @@ -188,9 +188,10 @@
        * Test out-of-order parameters, using the names to match
        */
       public void testOutOfOrderParams() throws Exception {
  -        String body = "<" + secondParamName + ">world!</" +
  -                secondParamName + "><" + firstParamName + ">Hello, </" +
  -                firstParamName + ">";
  +        String body = "<" + secondParamName.getLocalPart() + " xmlns=\""+ secondParamName.getNamespaceURI() + "\">world!</" +
  +                      secondParamName.getLocalPart() + ">" +
  +                      "<" + firstParamName.getLocalPart() + " xmlns=\""+ firstParamName.getNamespaceURI() + "\">Hello, </" + 
  +                       firstParamName.getLocalPart() + ">";
           String expected = "Hello, world!";
           assertEquals("Concatenated value was wrong",
                        expected,