After the xsl transformation, try to convert the body again to String.

Henrique Viecili

On 19 September 2014 10:16, aioria3077 <aioria3...@gmail.com> wrote:

> *have a original Web Services, a proxy which has a transformation because
> you
> need to add data authentication, the request works fine, can consume the
> service, but I need to transform the response to the expectations created
> my
> webService proxy, the transformation applied in the same way which the
> request is armed, but I get an error:*
>
>
> 2014-09-18 17:27:46,714 | WARN | qtp1787857896-70 | PhaseInterceptorChain |
> ? ? | 164 - org.apache.cxf.cxf-api - 2.7.0.redhat-610379 | Interceptor for
> {http://www.ampersand.mx/FiestaRewardsServices";
> target="_blank">
> http://www.ampersand.mx/FiestaRewardsServices}PointsExchangeFR2CPPortTypeService#{http://www.ampersand.mx/FiestaRewardsServices
> "
> target="_blank">
> http://www.ampersand.mx/FiestaRewardsServices}PointsExchangeFR2CPOp
> has thrown exception, unwinding now
> java.lang.ClassCastException: java.io.ByteArrayInputStream cannot be cast
> to
> javax.xml.transform.Source
> at
>
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:79)[162:org.apache.cxf.cxf-rt-core:2.7.0.redhat-610379]
> at
>
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:54)[162:org.apache.cxf.cxf-rt-core:2.7.0.redhat-610379]
> at
>
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:100)[205:org.apache.camel.camel-cxf:2.12.0.redhat-610379]
> at
>
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:81)[205:org.apache.camel.camel-cxf:2.12.0.redhat-610379]
> at
>
> org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:123)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379]
> at
>
> org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379]
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379]
> at
>
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)[164:org.apache.cxf.cxf-api:2.7.0.redhat-610379]
>
>
> *this is my camel-context.xml*
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans
> xmlns:spring-security="http://www.springframework.org/schema/security";
>         xmlns="http://www.springframework.org/schema/beans";
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:camel="http://camel.apache.org/schema/spring";
> xmlns:osgi="http://www.springframework.org/schema/osgi";
> xmlns:cxf="http://camel.apache.org/schema/cxf";
> xmlns:poin="http://www.ampersand.mx/PointsExchangeFR2CPReq";
>         xsi:schemaLocation="
>            http://camel.apache.org/schema/spring/security
>
> http://camel.apache.org/schema/spring/security/camel-spring-security.xsd
>        http://www.springframework.org/schema/security
>        http://www.springframework.org/schema/security/spring-security.xsd
>        http://camel.apache.org/schema/security
> http://camel.apache.org/schema/security/camel-security.xsd
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://www.springframework.org/schema/osgi
>        http://www.springframework.org/schema/osgi/spring-osgi.xsd
>        http://camel.apache.org/schema/spring
>        http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://camel.apache.org/schema/cxf
>        http://camel.apache.org/schema/cxf/camel-cxf-2.8.3.xsd";>
>
>
>         <bean id="cleanerProcessor"
> class="mx.ampersand.processors.RequestCleanerProcessor" />
>
>
>         <cxf:cxfEndpoint id="PointsExchangeFR2CPProxy"
> address="/PointsExchangeFR2CPService"
>
> serviceClass="mx.ampersand.fiestarewardsservices.PointsExchangeFR2CPPortType">
>         </cxf:cxfEndpoint>
>
>
>         <cxf:cxfEndpoint id="ClubPremierEndpoint"
> address="
> http://cr5w5cptest.clubpremier.com/Mercator.CRIS.WebService.TESTCRIS/MemberWebService.asmx
> "
> wsdlURL="wsdl/MemberWebService.wsdl">
>                 <cxf:properties>
>                         <entry key="dataFormat" value="MESSAGE" />
>                 </cxf:properties>
>         </cxf:cxfEndpoint>
>
>         <camelContext
> id="mx.ampersand.fiestarewardsservices.PointsExchangeFR2CP-Proxy"
> xmlns="http://camel.apache.org/schema/spring";>
>                 <route id="proxy">
>                         <from
>
> uri="cxf:bean:PointsExchangeFR2CPProxy?dataFormat=PAYLOAD&amp;loggingFeatureEnabled=true"
> />
>                         <to uri="log:output?showAll=true" />
>
>                         <to uri="cleanerProcessor"/>
>
>                         <convertBodyTo type="java.lang.String" />
>
>                         <to uri="xslt:xslt/ClubPremier/request.xslt" />
>
>                         <setHeader headerName="operationName">
>                                 <constant>CreateAccrualActivity</constant>
>                         </setHeader>
>                         <setHeader headerName="SOAPAction">
>
> <constant>http://skywards.com/Mercator.CRIS.WS/CreateAccrualActivity
> </constant>
>                         </setHeader>
>
>                         <to uri="log:output?showAll=true"/>
>
>                         <log message="Request antes de enviar a CP:
> ${body}" />
>                         <to uri="cxf:bean:ClubPremierEndpoint" />
>                         <log message="lo que nos respondio CP: ${body}" />
>
>                         <log message="SE TERMINO DE CORRER"/>
>                         <convertBodyTo type="java.lang.String" />
>                         <to uri="xslt:xslt/ClubPremier/response.xslt" />
>
>                 </route>
>         </camelContext>
> </beans>
>
> *I repeat, the transformation was effected my proxyWebService correctly,
> the
> request asking the WebServiceOriginal, the problem is the response.
>
> appreciate your help*
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/please-help-with-transformation-of-a-response-by-xslt-tp5756711.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to