axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14400] New: - wsdl2java generates stub using parameter names for operations
Date Fri, 08 Nov 2002 22:17:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14400>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14400

wsdl2java generates stub using parameter names for operations

           Summary: wsdl2java generates stub using parameter names for
                    operations
           Product: Axis
           Version: 1.0
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WSDL processing
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: misclists@email.com


Hi,

We have been using wsdl2java to generate client stub from a wsdl (relevant 
fraction has been pasted at the end of this message).  Since beta3, we have 
found the client stub generated looks like this:
    public void changeUserPassword(java.lang.String name, java.lang.String 
password, java.lang.String username, java.lang.String userPassword, 
java.lang.String confirmPassword) throws java.rmi.RemoteException, 
com.cysive.alertportal.wsdlclient.FaultResponse {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.addParameter(new javax.xml.namespace.QName("my-web-
service", "name"), new javax.xml.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        _call.addParameter(new javax.xml.namespace.QName("my-web-
service", "password"), new javax.xml.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        _call.addParameter(new javax.xml.namespace.QName("my-web-
service", "username"), new javax.xml.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        _call.addParameter(new javax.xml.namespace.QName("my-web-
service", "user-password"), new javax.xml.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        _call.addParameter(new javax.xml.namespace.QName("my-web-
service", "confirm-password"), new javax.xml.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        _call.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("ChangeUserPassword");
        _call.setOperationStyle("rpc");
        _call.setOperationName(new javax.xml.namespace.QName("alertportal-web-
service", "password"));

        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {name, 
password, username, userPassword, confirmPassword});

        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
    }

On the line where the client calls setOperationName, it is passing 
in "password" as the name, which however is actually one of the parameter names.

With the wsdl2java in beta2, the stub generated looked like this:

    public void changeUserPassword(java.lang.String name, java.lang.String 
password, java.lang.String username, java.lang.String userPassword, 
java.lang.String confirmPassword) throws java.rmi.RemoteException, 
com.cysive.alertportal.wsdlclient.FaultResponse{
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call call = createCall();
        javax.xml.rpc.namespace.QName p0QName = new 
javax.xml.rpc.namespace.QName("my-web-service", "name");
        call.addParameter(p0QName, new javax.xml.rpc.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        javax.xml.rpc.namespace.QName p1QName = new 
javax.xml.rpc.namespace.QName("my-web-service", "password");
        call.addParameter(p1QName, new javax.xml.rpc.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        javax.xml.rpc.namespace.QName p2QName = new 
javax.xml.rpc.namespace.QName("my-web-service", "username");
        call.addParameter(p2QName, new javax.xml.rpc.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        javax.xml.rpc.namespace.QName p3QName = new 
javax.xml.rpc.namespace.QName("my-web-service", "user-password");
        call.addParameter(p3QName, new javax.xml.rpc.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        javax.xml.rpc.namespace.QName p4QName = new 
javax.xml.rpc.namespace.QName("my-web-service", "confirm-password");
        call.addParameter(p4QName, new javax.xml.rpc.namespace.QName
("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, 
javax.xml.rpc.ParameterMode.IN);
        call.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
        call.setUseSOAPAction(true);
        call.setSOAPActionURI("ChangeUserPassword");
        call.setOperationStyle("rpc");
        call.setOperationName(new javax.xml.rpc.namespace.QName("alertportal-
web-service", "changeUserPassword"));

        Object resp = call.invoke(new Object[] {name, password, username, 
userPassword, confirmPassword});

        if (resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)resp;
        }
    }

Note that the operation name is set to "changePassword", which is not 
completely correctly either, because it should have been "ChangePassword" (with 
the first letter capitalized) because that is the soap action declared in the 
binding.

The relevant WSDL fraction goes here:

...
    <message name="changeUserPasswordMessage">
        <part name="name" element="tns:name"/>
        <part name="password" element="tns:password"/>
        <part name="username" element="tns:username"/>
        <part name="user-password" element="tns:user-password"/>
        <part name="confirm-password" element="tns:confirm-password"/>
    </message>
...
    <portType name="MyWebServicePortType">
...
        <operation name="changeUserPassword">
           <input message="tns:changeUserPasswordMessage"/>
           <output message="tns:successfulResponse"/>
           <fault name="changeUserPasswordFault" message="tns:faultResponse"/>
        </operation>
...
    </portType>
    <binding name="MyWebServiceSoapBinding" type="tns:MyWebServicePortType">
        <soap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
...
        <operation name="changeUserPassword">
            <soap:operation soapAction="ChangeUserPassword"/>
            <input>
                <soap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>
            <output>
                <soap:body use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
            <fault>
                <soap:fault name="changeUserPasswordFault" use="encoded" 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
           </fault>
        </operation>
...
    </binding>

Mime
View raw message