Hi,
concerning the same problem,
Is it possible with options in cxf-codegen-plugin
to not use the default : javax.xml.ws.wsaddressing.W3CEndpointReference
nor the old cxf one : org.apache.cxf.ws.addressing.EndpointReferenceType
I know how to do the first step (using
<noAddressBinding>true</noAddressBinding>)
but don't find how to do the second one.
I have tried to use a binding.xml file (using
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/jaxws-binding.xml</bindingFile>
</bindingFiles>) but without success.
How can i use my own generated files for WS-Addressing (being able to put
it in an independent package would be better) ?
Regards
Hervé
On Thu, Apr 19, 2012 at 12:48 PM, Hervé BARRAULT
<[email protected]>wrote:
> Hi, as i am using the package fuse-esb, i load the bundle cxf-bundle)
> which already include org.apache.cxf.ws.addressing.EndpointReferenceType
>
> I guess, on unmarshalling, JaxB will use the one provided by the
> cxf-bundle and not mine.
>
> Is anyone have an idea on how to deal with this problem ?
> I am looking to Import-Package and Export-Package with version in OSGI.
>
> Regards
>
>
>
>
> On Thu, Apr 19, 2012 at 10:25 AM, Hervé BARRAULT <[email protected]
> > wrote:
>
>> HI,
>> i have used the cxf-codegen-plugin to generate JaxB objects.
>>
>> With default generation, one of my element is defined as
>> "javax.xml.ws.wsaddressing.W3CEndpointReference"
>> As this class is not serializable and not simple tu use i have set an
>> option to use the cxf addressing.
>>
>> I used the following options :
>> <defaultOptions>
>> <bindingFiles>
>>
>> <bindingFile>${basedir}/src/main/resources/jaxws-binding.xml</bindingFile>
>> </bindingFiles>
>> <noAddressBinding>true</noAddressBinding>
>> </defaultOptions
>>
>> In my jaxws-binding.xml i force the generation to be serializable (i need
>> it).
>>
>>
>> I have the following generated class :
>>
>> package org.apache.cxf.ws.addressing;
>>
>> ...
>> public class EndpointReferenceType
>> implements Serializable {
>> private final static long serialVersionUID = 42L;
>> @XmlElement(name = "Address", required = true)
>> protected AttributedURIType address;
>> @XmlElement(name = "ReferenceParameters")
>> protected ReferenceParametersType referenceParameters;
>> @XmlElement(name = "Metadata")
>> protected MetadataType metadata;
>> @XmlAnyElement(lax = true)
>> protected List<Object> any;
>> @XmlAnyAttribute
>> private Map<QName, String> otherAttributes = new HashMap<QName,
>> String>();
>>
>> ...
>> }
>>
>> So I expect that org.apache.cxf.ws.addressing.EndpointReferenceType is
>> serializable.
>>
>> But when i try to serialize it, i have the following error :
>> java.io.NotSerializableException:
>> org.apache.cxf.ws.addressing.EndpointReferenceType
>> at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
>> at
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
>> at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
>> at
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
>> at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
>> at
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
>> at java.util.ArrayList.writeObject(ArrayList.java:570)
>>
>> Looking to stack trace i suppose that the List<Object> any is the problem.
>>
>> How can i resolve this ?
>>
>> Thanks for answers
>>
>> Regards
>>
>> Hervé
>>
>>
>>
>