[ 
https://issues.apache.org/jira/browse/CAMEL-4254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oliver Jelinski updated CAMEL-4254:
-----------------------------------

    Description: 
Because the variable "elementNameStrategyRef" in 
org.apache.camel.dataformat.soap.SoapJaxbDataFormat can't be set, it is always 
null. Therefore declaring the data format with spring-dsl leads to an automatic 
fallback to the default strategy "TypeNameStrategy" in 
org.apache.camel.dataformat.soap.SoapJaxbDataFormat.checkElementNameStrategy(Exchange
 exchange). This further leads to wrong results when marshalling.

So the following declararion does not work correctly:
...
    <bean id="myStrategy" 
class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy">
        <constructor-arg value="my.package.MyServiceInterface"/>
        <constructor-arg value="true"/>
    </bean>
...
    <camelContext xmlns="http://camel.apache.org/schema/spring";>
...
                <dataFormats>
                        <soapjaxb id="mySoap" 
                              contextPath="my.package" 
                              elementNameStrategyRef="myStrategy"/>
                </dataFormats>
...
                <route>
                        <from 
uri="cxf:/MyService?serviceClass=my.package.MyServiceInterface" />
...
                        <convertBodyTo type="my.package.MyType"/>
                        <marshal ref="mySoap"/>
...

  was:
Because the variable "elementNameStrategyRef" in SoapJaxbDataFormat can't be 
set, it is always null. Therefore declaring the data format with spring-dsl 
leads to an automatic fallback to the default strategy "TypeNameStrategy" in 
SoapJaxbDataFormat.checkElementNameStrategy(Exchange exchange).

So the following declararion does not work correctly:
...
    <bean id="myStrategy" 
class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy">
        <constructor-arg value="my.package.MyServiceInterface"/>
        <constructor-arg value="true"/>
    </bean>
...
    <camelContext xmlns="http://camel.apache.org/schema/spring";>
...
                <dataFormats>
                        <soapjaxb id="mySoap" 
                              contextPath="my.package" 
                              elementNameStrategyRef="myStrategy"/>
                </dataFormats>
...


> Missing setter or constructor-argument for elementNameStrategyRef in 
> SoapJaxbDataFormat
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4254
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4254
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.7.0, 2.7.3
>            Reporter: Oliver Jelinski
>
> Because the variable "elementNameStrategyRef" in 
> org.apache.camel.dataformat.soap.SoapJaxbDataFormat can't be set, it is 
> always null. Therefore declaring the data format with spring-dsl leads to an 
> automatic fallback to the default strategy "TypeNameStrategy" in 
> org.apache.camel.dataformat.soap.SoapJaxbDataFormat.checkElementNameStrategy(Exchange
>  exchange). This further leads to wrong results when marshalling.
> So the following declararion does not work correctly:
> ...
>     <bean id="myStrategy" 
> class="org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy">
>       <constructor-arg value="my.package.MyServiceInterface"/>
>       <constructor-arg value="true"/>
>     </bean>
> ...
>     <camelContext xmlns="http://camel.apache.org/schema/spring";>
> ...
>               <dataFormats>
>                       <soapjaxb id="mySoap" 
>                               contextPath="my.package" 
>                               elementNameStrategyRef="myStrategy"/>
>               </dataFormats>
> ...
>                 <route>
>                       <from 
> uri="cxf:/MyService?serviceClass=my.package.MyServiceInterface" />
> ...
>                       <convertBodyTo type="my.package.MyType"/>
>                       <marshal ref="mySoap"/>
> ...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to