I encountered this exact issue some time ago [1] . I have fixed this issue
in the trunk. but sadly it was only after the 1.4 release (I found this bug
after 1.4 was released). Can you try this out with the nightly, that will
work for you.

Thanks,
Keith.

[1] https://issues.apache.org/jira/browse/AXIS2-3819

On Fri, Jun 20, 2008 at 10:01 AM, pierre betz <[EMAIL PROTECTED]> wrote:

> hi everyone, I have another question about the wsdl2java tool of axis2
> (1.3).
>
> I have this message for a request :
>
> <wsdl:message name="GetUserByContactInfoIdRequest">
>
>         <wsdl:part name="ContactInfoId" type="xsd:string">
>         </wsdl:part>
>
>        <wsdl:part name="ActiveUserOnly" type="xsd:boolean">
>             <wsdl:documentation>
>                 If true, returns only Object that are active objects !
>                 If False, returns all objects, even if they are
>                 desactivated
>             </wsdl:documentation>
>        </wsdl:part>
>
>  </wsdl:message>
>
> as you can see, there are 2 parameters :
> ContactInfoId : string
> ActiveUserOnly : boolean
>
> after using wsdl2java, implementing all the web service, I had an error
> when I tried to send a request for these service : Error unespected
> subelement ContactInfoId.
>
> In fact, I understood after some time the problem, it was because the
> GetUserByContactInfoIdRequest is defined in the wsdl by : ContactInfoId in
> first, and ActiveUserOnly  in second parameter.
>
> But, in the java files generated by axis2 ( GetUserByContactInfoId.java,
> which is used to send the request)
> I have the     public static GetUserByContactInfoId parse(....) function,
> which is not well defined according to the wsdl :
>
> while (!reader.isStartElement() && !reader.isEndElement())
>                     reader.next();
>
>                 if (reader.isStartElement() &&
>                         new javax.xml.namespace.QName("", "*ActiveUserOnly
> *").equals(
>                             reader.getName())) {
>                     java.lang.String content = reader.getElementText();
>
>
> object.setActiveUserOnly(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(
>                             content));
>
>                     reader.next();
>                 } // End of if for expected property start element
>
>                 else {
>                     // A start element we are not expecting indicates an
> invalid parameter was passed
>                     throw new org.apache.axis2.databinding.ADBException(
>                         "Unexpected subelement " + reader.getLocalName());
>                 }
>
>                 while (!reader.isStartElement() && !reader.isEndElement())
>                     reader.next();
>
>                 if (reader.isStartElement() &&
>                         new javax.xml.namespace.QName("", "*ContactInfoId*
> ").equals(
>                             reader.getName())) {
>                     java.lang.String content = reader.getElementText();
>
>
> object.setContactInfoId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
>                             content));
>
>                     reader.next();
>                 } // End of if for expected property start element
>
> _____________________________________
>
> I did not modify this file, and as you can see, the ContactInfoId and the
> ActiveUserId fields are in the opposite order. so, my request defined by the
> wsdl can't work until I inverse the fields.
> As I work for a very big web service, I just can't generate the files and
> modify all of them, it take to much time.. and it's the same for the wsdl, I
> must not modify it.
>
> Does someone have any idea why axis2, when generate the java files, inverse
> the fields of the request in the parse function ? it's very annoying for me
> and I have to find a solution.
>
> thanks a lot in advance,
> Pierre BETZ
>
>
>
>
>
>
>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Reply via email to