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 "Ronald Aaronson (JIRA)" <ax...@ws.apache.org> on 2005/07/29 01:45:20 UTC

[jira] Created: (AXIS-2152) Runtime wsdl has invalid element name.

Runtime wsdl has invalid element name.
--------------------------------------

         Key: AXIS-2152
         URL: http://issues.apache.org/jira/browse/AXIS-2152
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.2.1    
 Environment: Tomcat 5.0.28 under Windows XP
    Reporter: Ronald Aaronson


I ran Java2Wsdl against a server interface class to produce IpmServer.wsdl file:

<java2wsdl output="IpmServer.wsdl"
        className="com.hypertechsolutions.ipm.webservices.IpmServer"
        namespace="urn:ipmwebservice"
        style="WRAPPED"
        use="LITERAL"
        location="http://localhost:8000/mywebapp/services/IpmServer">
   <complextype
            classname="com.hypertechsolutions.ipm.webservices.IpmServerException"
            namespace="urn:ipmwebservice" />
</java2wsdl>

I am trying to use WRAPPED/LITERAL style/encoding.  The service can throw an IpmServerException and I had to specify the <complextype> element when using WRAPPED/LITERAL.  The wsdl generated seems to be find.  I use WSDL2Java to generate the classes and deploy the service.  However, the wsdl produced at runtime via "http://localhost:8000/mywebapp/services/IpmServer?wsdl" is different (and invalid) compared to the wsdl created by Java2Wsdl step.  The difference is in describing a "login" method:

   <element name="login">
    <complexType>
     <sequence>
      <element name="&gt;login&gt;in0" type="xsd:string"/>
      <element name="&gt;login&gt;in1" type="xsd:string"/>
      <element name="&gt;login&gt;in2" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>

This should be:

   <element name="login">
    <complexType>
     <sequence>
      <element name="in0" type="xsd:string"/>
      <element name="in1" type="xsd:string"/>
      <element name="in2" type="xsd:string"/>
     </sequence>
    </complexType>


File IpmServer.java:

package com.hypertechsolutions.ipm.webservices;

public interface IpmServer extends java.rmi.Remote {
    public void login(java.lang.String loginIn0, java.lang.String loginIn1, java.lang.String loginIn2) throws java.rmi.RemoteException, com.hypertechsolutions.ipm.webservices.IpmServerException;
    public int doit() throws java.rmi.RemoteException, com.hypertechsolutions.ipm.webservices.IpmServerException;
    public void logout() throws java.rmi.RemoteException, com.hypertechsolutions.ipm.webservices.IpmServerException;
}

Complete correct wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:ipmwebservice" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:ipmwebservice" xmlns:intf="urn:ipmwebservice" xmlns:tns1="http://www.w3.org/1999/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2alpha
Built on Dec 01, 2003 (04:33:24 EST)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="urn:ipmwebservice" xmlns="http://www.w3.org/2001/XMLSchema">
   <complexType name="IpmServerException">
    <sequence>
     <element name="reasonCode" type="xsd:int"/>
     <element name="originalStackTrace" nillable="true" type="xsd:string"/>
     <element name="message" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <element name="login">
    <complexType>
     <sequence>
      <element name="in0" type="xsd:string"/>
      <element name="in1" type="xsd:string"/>
      <element name="in2" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="loginResponse">
    <complexType/>
   </element>
   <element name="fault" type="impl:IpmServerException"/>
   <element name="doit">
    <complexType/>
   </element>
   <element name="doitResponse">
    <complexType>
     <sequence>
      <element name="doitReturn" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
   <element name="logout">
    <complexType/>
   </element>
   <element name="logoutResponse">
    <complexType/>
   </element>
  </schema>
 </wsdl:types>

   <wsdl:message name="doitResponse">

      <wsdl:part element="impl:doitResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="doitRequest">

      <wsdl:part element="impl:doit" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="IpmServerException">

      <wsdl:part element="impl:fault" name="fault"/>

   </wsdl:message>

   <wsdl:message name="loginRequest">

      <wsdl:part element="impl:login" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="loginResponse">

      <wsdl:part element="impl:loginResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="logoutRequest">

      <wsdl:part element="impl:logout" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="logoutResponse">

      <wsdl:part element="impl:logoutResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:portType name="IpmServer">

      <wsdl:operation name="login" parameterOrder="">

         <wsdl:input message="impl:loginRequest" name="loginRequest"/>

         <wsdl:output message="impl:loginResponse" name="loginResponse"/>

         <wsdl:fault message="impl:IpmServerException" name="IpmServerException"/>

      </wsdl:operation>

      <wsdl:operation name="doit">

         <wsdl:input message="impl:doitRequest" name="doitRequest"/>

         <wsdl:output message="impl:doitResponse" name="doitResponse"/>

         <wsdl:fault message="impl:IpmServerException" name="IpmServerException"/>

      </wsdl:operation>

      <wsdl:operation name="logout">

         <wsdl:input message="impl:logoutRequest" name="logoutRequest"/>

         <wsdl:output message="impl:logoutResponse" name="logoutResponse"/>

         <wsdl:fault message="impl:IpmServerException" name="IpmServerException"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="IpmServerSoapBinding" type="impl:IpmServer">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="login">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="loginRequest">

            <wsdlsoap:body namespace="urn:ipmwebservice" use="literal"/>

         </wsdl:input>

         <wsdl:output name="loginResponse">

            <wsdlsoap:body namespace="urn:ipmwebservice" use="literal"/>

         </wsdl:output>

         <wsdl:fault name="IpmServerException">

            <wsdlsoap:fault name="IpmServerException" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="doit">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="doitRequest">

            <wsdlsoap:body namespace="urn:ipmwebservice" use="literal"/>

         </wsdl:input>

         <wsdl:output name="doitResponse">

            <wsdlsoap:body namespace="urn:ipmwebservice" use="literal"/>

         </wsdl:output>

         <wsdl:fault name="IpmServerException">

            <wsdlsoap:fault name="IpmServerException" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="logout">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="logoutRequest">

            <wsdlsoap:body namespace="urn:ipmwebservice" use="literal"/>

         </wsdl:input>

         <wsdl:output name="logoutResponse">

            <wsdlsoap:body namespace="urn:ipmwebservice" use="literal"/>

         </wsdl:output>

         <wsdl:fault name="IpmServerException">

            <wsdlsoap:fault name="IpmServerException" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="IpmServerService">

      <wsdl:port binding="impl:IpmServerSoapBinding" name="IpmServer">

         <wsdlsoap:address location="http://localhost:8000/mywebapp/services/IpmServer"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira