You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Glen Mazza <gm...@talend.com> on 2011/11/01 13:58:17 UTC

Re: Generating Java from WSDL

Harry, these questions should be asked on the CXF-USER's list -- many 
more people, including the CXF devs on CXF-DEV,
are on it.

bindings.xjb I believe is just for JAXB (your POJOs that handle the 
request and responses)-- it shouldn't have an effect on JAX-WS method 
mappings, which are defined in the JAX-WS specification (which CXF 
implements) and most probably mandate the removal of the underscore.  
(You'd have the same issue if you used Metro: 
http://www.jroller.com/gmazza/entry/soap_client_tutorial)  I'm not sure 
there's anything we can do about that.

Glen

On 11/01/2011 03:33 AM, harry wrote:
> When I try to generate java code from WSDL, underscore(_) is missing from
> method name. Example getGetType_Machine() changes to getGetType_Machine().
> Though in the WSDL method name is ok. I tried using bindings.xjb with global
> bindings for underscore but that didn't help.
> So if you guys could please help me.
> Thanks in advance.
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Generating-Java-from-WSDL-tp4954507p4954507.html
> Sent from the cxf-issues mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend - http://www.talend.com/apache
Blog - http://www.jroller.com/gmazza/
Twitter - glenmazza


Re: Generating Java from WSDL

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, November 03, 2011 9:50:02 AM harry wrote:
> Glen,
> 
> Thanks for your response. Sorry for posting this on cxf-dev.
> 
> Can you point me to where in the JAX-WS it mentions that methods can not
> have underscores? I can't find it.

Section 2.8 of the JAX-WS spec basically delegates the XML Name mapping to 
Appendix C of the JAXB 1.0 spec except for a few alterations (like not adding 
"get/set" to the beginning).   However, in the more recent JAXB specs (JAXB  
2.1 spec for example), it's moved to Appendix D.   If you grab that spec and 
look at it, it's a 9 page appendix describing how XML names get mapped for 
various usages.   For method names and class names, the "_" gets dropped and 
the letter immediately following it gets capitalized.   

As Glen alluded, the JAXB global binding for the underscore handling wouldn't 
apply to this part as this mapping is part of the JAX-WS spec, not really 
JAXB.  (I know, it's confusing)   You CAN use a JAX-WS binding file (Chapter 8 
of JAX-WS spec) to map the operation names differently, but it's a "per 
operation" mapping.  There isn't a global setting for it.


Dan



> 
> The reason I ask, is because if that is the case then maybe the WSDL should
> not be allowed to have underscores to begin with. Also, AXIS2 works fine and
> generates methods with the underscores intact.
> 
> I want to understand if this is a bug in metro/cxf or mandated by the
> standard. If it is mandated in the standard, I think there is a disconnect
> between the WSDL definition standard and JAX-WS specification.
> 
> tia,
> harry
> 
> Glen Mazza (Talend) wrote:
> > Harry, these questions should be asked on the CXF-USER's list -- many
> > more people, including the CXF devs on CXF-DEV,
> > are on it.
> > 
> > bindings.xjb I believe is just for JAXB (your POJOs that handle the
> > request and responses)-- it shouldn't have an effect on JAX-WS method
> > mappings, which are defined in the JAX-WS specification (which CXF
> > implements) and most probably mandate the removal of the underscore.
> > (You'd have the same issue if you used Metro:
> > http://www.jroller.com/gmazza/entry/soap_client_tutorial)  I'm not sure
> > there's anything we can do about that.
> > 
> > Glen
> > 
> > On 11/01/2011 03:33 AM, harry wrote:
> >> When I try to generate java code from WSDL, underscore(_) is missing
> >> from method name. Example getGetType_Machine() changes to
> >> getGetType_Machine().
> >> Though in the WSDL method name is ok. I tried using bindings.xjb with
> >> global
> >> bindings for underscore but that didn't help.
> >> So if you guys could please help me.
> >> Thanks in advance.
> >> 
> >> --
> >> View this message in context:
> >> http://cxf.547215.n5.nabble.com/Generating-Java-from-WSDL-tp4954507p49
> >> 54507.html Sent from the cxf-issues mailing list archive at
> >> Nabble.com.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Re-Generating-Java-from-WSDL-tp4955109p4961
> 639.html Sent from the cxf-dev mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Generating Java from WSDL

Posted by harry <hi...@gmail.com>.
Glen,

Thanks for your response. Sorry for posting this on cxf-dev.

Can you point me to where in the JAX-WS it mentions that methods can not
have underscores? I can't find it.

The reason I ask, is because if that is the case then maybe the WSDL should
not be allowed to have underscores to begin with. Also, AXIS2 works fine and
generates methods with the underscores intact.

I want to understand if this is a bug in metro/cxf or mandated by the
standard. If it is mandated in the standard, I think there is a disconnect
between the WSDL definition standard and JAX-WS specification.

tia,
harry


Glen Mazza (Talend) wrote:
> 
> Harry, these questions should be asked on the CXF-USER's list -- many 
> more people, including the CXF devs on CXF-DEV,
> are on it.
> 
> bindings.xjb I believe is just for JAXB (your POJOs that handle the 
> request and responses)-- it shouldn't have an effect on JAX-WS method 
> mappings, which are defined in the JAX-WS specification (which CXF 
> implements) and most probably mandate the removal of the underscore.  
> (You'd have the same issue if you used Metro: 
> http://www.jroller.com/gmazza/entry/soap_client_tutorial)  I'm not sure 
> there's anything we can do about that.
> 
> Glen
> 
> On 11/01/2011 03:33 AM, harry wrote:
>> When I try to generate java code from WSDL, underscore(_) is missing from
>> method name. Example getGetType_Machine() changes to
>> getGetType_Machine().
>> Though in the WSDL method name is ok. I tried using bindings.xjb with
>> global
>> bindings for underscore but that didn't help.
>> So if you guys could please help me.
>> Thanks in advance.
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Generating-Java-from-WSDL-tp4954507p4954507.html
>> Sent from the cxf-issues mailing list archive at Nabble.com.
> 
> 
> -- 
> Glen Mazza
> Talend - http://www.talend.com/apache
> Blog - http://www.jroller.com/gmazza/
> Twitter - glenmazza
> 


--
View this message in context: http://cxf.547215.n5.nabble.com/Re-Generating-Java-from-WSDL-tp4955109p4961639.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Generating Java from WSDL

Posted by Hitesh S <hi...@gmail.com>.
Dear Glen,

Thanks for your quick and good response. This response helps me a lot.

Thanks once again,

On Tue, Nov 1, 2011 at 8:58 AM, Glen Mazza <gm...@talend.com> wrote:

> Harry, these questions should be asked on the CXF-USER's list -- many more
> people, including the CXF devs on CXF-DEV,
> are on it.
>
> bindings.xjb I believe is just for JAXB (your POJOs that handle the
> request and responses)-- it shouldn't have an effect on JAX-WS method
> mappings, which are defined in the JAX-WS specification (which CXF
> implements) and most probably mandate the removal of the underscore.
>  (You'd have the same issue if you used Metro:
> http://www.jroller.com/gmazza/**entry/soap_client_tutorial<http://www.jroller.com/gmazza/entry/soap_client_tutorial>)
>  I'm not sure there's anything we can do about that.
>
> Glen
>
>
> On 11/01/2011 03:33 AM, harry wrote:
>
>> When I try to generate java code from WSDL, underscore(_) is missing from
>> method name. Example getGetType_Machine() changes to getGetType_Machine().
>> Though in the WSDL method name is ok. I tried using bindings.xjb with
>> global
>> bindings for underscore but that didn't help.
>> So if you guys could please help me.
>> Thanks in advance.
>>
>> --
>> View this message in context: http://cxf.547215.n5.nabble.**
>> com/Generating-Java-from-WSDL-**tp4954507p4954507.html<http://cxf.547215.n5.nabble.com/Generating-Java-from-WSDL-tp4954507p4954507.html>
>> Sent from the cxf-issues mailing list archive at Nabble.com.
>>
>
>
> --
> Glen Mazza
> Talend - http://www.talend.com/apache
> Blog - http://www.jroller.com/gmazza/
> Twitter - glenmazza
>
>


-- 
Regards,
Hitesh S. Vaid
Tel: (409)273-5711
Email: hiteshsvaid@gmail.com