You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "anil.kpr" <er...@gmail.com> on 2010/06/22 07:58:27 UTC

Problem in autogenerated code from wsdl2java of cxf.

Hello all..
I am a beginner with cfx. I made an WebService in Axis2 then from it's WSDL
code, i used CXF utility WSDL2java to generate java code. Everything is
working fine except one thing.
In the auto generated code CXF generates all Bean classes with JAXB mappings
but while making these bean classes, it generates name the bean property
with first letter small.
	private String providerID;   ->      
@XmlElementRef(name = "providerID", namespace = "some url", type =
JAXBElement.class)
    protected JAXBElement<String> providerID;

so this is working fine becuse here the name of property already starts with
a small letter which is providerId, but i have some other properties which
are having capital letter's in their name like
private String CIN;  In this case CXF make its first letter small so proper
mapping is not possible
like     
@XmlElementRef(name = "cIN", namespace = "some url", type =
JAXBElement.class)
    protected JAXBElement<String> cin;

so when i try to run this from my system object is going to the service with
values of only few properties whose name is already start with small letter,
in case of capital letter value recieving is null.

Can anybody explain it... what is the issue here what should i do.
-- 
View this message in context: http://old.nabble.com/Problem-in-autogenerated-code-from-wsdl2java-of-cxf.-tp28956415p28956415.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Problem in autogenerated code from wsdl2java of cxf.

Posted by "anil.kpr" <er...@gmail.com>.
hello Dan
thanks for the reply.. i saw WSDL now, unfortunately in WSDL itself there is
cIN not CIN.
my mistake. It means when i exposing my code as WSDL at that time it is
changing its name from CIN to cIN..

I am using eclipse to generate WebService.. is there any solution to correct
from starting before making WSDL...

dkulp wrote:
> 
> 
> This is quite strange behavior.   It's really in JAXB, not CXF, as CXF
> just 
> calls into JAXB to generate these.
> 
> Can you double check that you are picking up the latest JAXB and not an
> older 
> version?  If using JDK 1.6, can you also try generating the code with the 
> wsimport and see if it has the same issue?
> 
> Dan
> 
> 
> On Tuesday 22 June 2010 1:58:27 am anil.kpr wrote:
>> Hello all..
>> I am a beginner with cfx. I made an WebService in Axis2 then from it's
>> WSDL
>> code, i used CXF utility WSDL2java to generate java code. Everything is
>> working fine except one thing.
>> In the auto generated code CXF generates all Bean classes with JAXB
>> mappings but while making these bean classes, it generates name the bean
>> property with first letter small.
>> 	private String providerID;   ->
>> @XmlElementRef(name = "providerID", namespace = "some url", type =
>> JAXBElement.class)
>>     protected JAXBElement<String> providerID;
>> 
>> so this is working fine becuse here the name of property already starts
>> with a small letter which is providerId, but i have some other properties
>> which are having capital letter's in their name like
>> private String CIN;  In this case CXF make its first letter small so
>> proper
>> mapping is not possible
>> like
>> @XmlElementRef(name = "cIN", namespace = "some url", type =
>> JAXBElement.class)
>>     protected JAXBElement<String> cin;
>> 
>> so when i try to run this from my system object is going to the service
>> with values of only few properties whose name is already start with small
>> letter, in case of capital letter value recieving is null.
>> 
>> Can anybody explain it... what is the issue here what should i do.
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-in-autogenerated-code-from-wsdl2java-of-cxf.-tp28956415p28966935.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Problem in autogenerated code from wsdl2java of cxf.

Posted by Daniel Kulp <dk...@apache.org>.
This is quite strange behavior.   It's really in JAXB, not CXF, as CXF just 
calls into JAXB to generate these.

Can you double check that you are picking up the latest JAXB and not an older 
version?  If using JDK 1.6, can you also try generating the code with the 
wsimport and see if it has the same issue?

Dan


On Tuesday 22 June 2010 1:58:27 am anil.kpr wrote:
> Hello all..
> I am a beginner with cfx. I made an WebService in Axis2 then from it's WSDL
> code, i used CXF utility WSDL2java to generate java code. Everything is
> working fine except one thing.
> In the auto generated code CXF generates all Bean classes with JAXB
> mappings but while making these bean classes, it generates name the bean
> property with first letter small.
> 	private String providerID;   ->
> @XmlElementRef(name = "providerID", namespace = "some url", type =
> JAXBElement.class)
>     protected JAXBElement<String> providerID;
> 
> so this is working fine becuse here the name of property already starts
> with a small letter which is providerId, but i have some other properties
> which are having capital letter's in their name like
> private String CIN;  In this case CXF make its first letter small so proper
> mapping is not possible
> like
> @XmlElementRef(name = "cIN", namespace = "some url", type =
> JAXBElement.class)
>     protected JAXBElement<String> cin;
> 
> so when i try to run this from my system object is going to the service
> with values of only few properties whose name is already start with small
> letter, in case of capital letter value recieving is null.
> 
> Can anybody explain it... what is the issue here what should i do.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog