You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Rafal Janik <ra...@softwaremind.pl> on 2012/01/05 14:01:55 UTC

double soap:Body and soap:envelope tags in cxf-bc response

Hi,

I've got a problem with double <soap:Envelope> and <soap:Body> tags in 
my cxf bc component.
The idea of my my sa is to translate a message from one soap format to 
another.
The cxfbc configuration:

<cxfbc:provider wsdl="classpath:service_v1.wsdl"
                     locationURI="http://localhost:8080/my-ws/ws"
                     interfaceName="aaa:ImplPort2"
                     service="aaa:myService"
                     endpoint="ImplPort"
                     useJBIWrapper="false"
                     useSOAPEnvelope="true">
</cxfbc:provider>


<cxfbc:consumer wsdl="classpath:service_v2.wsdl"
                     targetService="test:AdapterService"
                     targetEndpoint="myEndpoint"
                     useJBIWrapper="false"
                     useSOAPEnvelope="false"
                     locationURI="https://0.0.0.0:8190/test/testService/"
                     busCfg="ssl.xml">
</cxfbc:consumer>


Then I use camel and processors to translate the message:


  from("jbi:endpoint:http://test.pl/test/RoleAnalyzerAdapterService/RoleAnalyzerEndpoint")
                 .to("log:entrance")
                 .choice()
                 .when(xpath(PROPER_METHOD_INVOKED)))
                 .process(new MyTranslator())
                 .to("jbi:endpoint:{cxf-bc-provider_endpoint}")
                 .otherwise()
                 .to("log:wrong_request")
                 .setBody(constant(SoapResponseMessages.WRONG_METHOD));


and as a result I get almost good soap (but packed again in 
soap:Envelope/soap:Body):

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Envelope>
<soap:Body>
<!--response here  -->
</soap:Body>
</soap:Envelope>
</soap:Body>
</soap:Envelope>


Am I doing something wrong, maybe the component should be configured in 
other way or should I use a processor for getting the body from response 
and then send it back?

apache-servicemix 3.6.0-fuse-00-35





Re: double soap:Body and soap:envelope tags in cxf-bc response

Posted by Freeman Fang <fr...@gmail.com>.
Thanks for sharing your solution.

Regards
Freeman
On 2012-1-10, at 下午6:12, Rafal Janik wrote:

> Of course it was a problem with my understanding of xpath in camel.
>
>  local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest'  
> works but this xpath must be invoked on NameSpace object with soap  
> prefix defined:
>
>         Namespaces ns = new Namespaces("soap", "http://schemas.xmlsoap.org/soap/envelope/ 
> ");
>         ...
>         from(...)
>                 .choice()
>                 .when(ns.xpath( local-name(/soap:Envelope/soap:Body/ 
> *[1])='getCommunitiesRequest'))
>
> and now everything is ok...
>
>
>
> On 05.01.2012 15:02, Rafal Janik wrote:
>>
>> Thanks for your reply- it is reason why there are double tags.
>> I've done it that way because  when there is
>>                     useJBIWrapper="false"
>>                     useSOAPEnvelope="false"
>> in provider and consumer - the target of provider can't recognize  
>> the message - there are double tags in request.
>> In second case :
>>                     useJBIWrapper="false"
>>                     useSOAPEnvelope="true">
>> I don't know why my xpath expression doesn't work, there is a  
>> payload:
>>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ 
>> envelope/" xmlns:heal="http://myservice/ 
>> aaa"><soap:Body><heal:getCommunitiesRequest xmlns:heal="http://myservice/aaa 
>> ">
>>          <heal:dataSourceId>1</heal:dataSourceId>
>>       </heal:getCommunitiesRequest></soap:Body></soap:Envelope>
>>
>> org.apache.cxf.interceptor.Fault: Invalid xpath: local-name(/ 
>> soap:Envelope/soap:Body/*[1])='getCommunitiesRequest'. Reason:  
>> javax.xml.xpath.XPathExpressionException
>>
>> but local-name(/soap:Envelope/soap:Body/ 
>> *[1])='getCommunitiesRequest' I think is correct.
>>
>>
>> In my wrong configuration with false,false for consumer and  
>> false,true for provider  the payload  was just
>> <heal:getCommunitiesRequest xmlns:heal="http://myservice/aaa">
>>          <heal:dataSourceId>1</heal:dataSourceId>
>>       </heal:getCommunitiesRequest>
>>
>> so the xpath was simpler : local-name(/*[1])='getCommunitiesRequest'
>> and it worked...
>>
>> So what - am I doing something wrong with xpath?  should I do  
>> something else with soap namespaces in serviecemix and camel?
>>
>>
>>
>>
>>
>> On 05.01.2012 14:26, Freeman Fang wrote:
>>>
>>> Hi,
>>>
>>> Your cxfbc consumer and provider endpoint configuration mismatch,
>>> The provider is
>>>                    useJBIWrapper="false"
>>>                    useSOAPEnvelope="true"
>>> The consumer is
>>>                    useJBIWrapper="false"
>>>                    useSOAPEnvelope="false"
>>>
>>> You should keep those same.
>>>
>>> Freeman
>>> On 2012-1-5, at 下午9:01, Rafal Janik wrote:
>>>
>>>> Hi,
>>>>
>>>> I've got a problem with double <soap:Envelope> and <soap:Body>  
>>>> tags in my cxf bc component.
>>>> The idea of my my sa is to translate a message from one soap  
>>>> format to another.
>>>> The cxfbc configuration:
>>>>
>>>> <cxfbc:provider wsdl="classpath:service_v1.wsdl"
>>>>                    locationURI="http://localhost:8080/my-ws/ws"
>>>>                    interfaceName="aaa:ImplPort2"
>>>>                    service="aaa:myService"
>>>>                    endpoint="ImplPort"
>>>>                    useJBIWrapper="false"
>>>>                    useSOAPEnvelope="true">
>>>> </cxfbc:provider>
>>>>
>>>>
>>>> <cxfbc:consumer wsdl="classpath:service_v2.wsdl"
>>>>                    targetService="test:AdapterService"
>>>>                    targetEndpoint="myEndpoint"
>>>>                    useJBIWrapper="false"
>>>>                    useSOAPEnvelope="false"
>>>>                    locationURI="https://0.0.0.0:8190/test/testService/ 
>>>> "
>>>>                    busCfg="ssl.xml">
>>>> </cxfbc:consumer>
>>>>
>>>>
>>>> Then I use camel and processors to translate the message:
>>>>
>>>>
>>>> from("jbi:endpoint:http://test.pl/test/RoleAnalyzerAdapterService/RoleAnalyzerEndpoint 
>>>> ")
>>>>                .to("log:entrance")
>>>>                .choice()
>>>>                .when(xpath(PROPER_METHOD_INVOKED)))
>>>>                .process(new MyTranslator())
>>>>                .to("jbi:endpoint:{cxf-bc-provider_endpoint}")
>>>>                .otherwise()
>>>>                .to("log:wrong_request")
>>>>                .setBody 
>>>> (constant(SoapResponseMessages.WRONG_METHOD));
>>>>
>>>>
>>>> and as a result I get almost good soap (but packed again in  
>>>> soap:Envelope/soap:Body):
>>>>
>>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/ 
>>>> ">
>>>> <soap:Body>
>>>> <soap:Envelope>
>>>> <soap:Body>
>>>> <!--response here  -->
>>>> </soap:Body>
>>>> </soap:Envelope>
>>>> </soap:Body>
>>>> </soap:Envelope>
>>>>
>>>>
>>>> Am I doing something wrong, maybe the component should be  
>>>> configured in other way or should I use a processor for getting  
>>>> the body from response and then send it back?
>>>>
>>>> apache-servicemix 3.6.0-fuse-00-35
>>>>
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------
>>> Freeman Fang
>>>
>>> FuseSource
>>> Email:ffang@fusesource.com
>>> Web: fusesource.com
>>> Twitter: freemanfang
>>> Blog: http://freemanfang.blogspot.com
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>> -- 
>> <mime-attachment.gif>	
>>
>> Rafał Janik
>> Software Engineer
>> Software Mind SA
>> ul. Bociana 22A
>> 31-231 Krakow
>> Polska
>>
>> Tel. +48 12 252 34 00
>> Fax: +48 12 252 34 01
>> Mobile:+48 668 48 36 13
>> rafal.janik@softwaremind.pl
>> www.softwaremind.pl
>>
>> Software Mind SA z siedzibą w Krakowie przy ul. Bociana 22A, 31-231  
>> Krakow
>> NIP 9452012822, kapitał zakładowy PLN 500,000.00 (w całości  
>> wpłacony), KRS 0000300409
>> Sąd Rejonowy dla Krakowa Śródmieścia w Krakowie, XI Wydział  
>> Gospodarczy KRS
>>
>> Ta wiadomość może zawierać materiały poufne i objęte  
>> tajemnicą zawodową, do wyłącznego użytku odbiorcy (odbiorców).  
>> Surowo wzbronione są wszelkie zmiany, wykorzystywanie,  
>> przechowywanie, dystrybucja lub ujawnienie przez inne osoby. Jeśli  
>> nie jest Pan/Pani zamierzonym odbiorcą (lub osobą upoważnioną do  
>> odbioru w imieniu odbiorcy), prosimy o kontakt z nadawcą przez  
>> wiadomość zwrotną oraz usunięcie wszelkich kopii niniejszej  
>> wiadomości. Poza tym poczta elektroniczna jest podatna na  
>> uszkodzenia danych, przechwytywanie, sabotaż, nieupoważnione  
>> zmiany i wirusy. Wysyłamy i odbieramy wiadomości poczty  
>> elektronicznej wyłącznie na takiej zasadzie, że nie ponosimy  
>> odpowiedzialności za jakiekolwiek tego typu uszkodzenia,  
>> przechwycenia, sabotaż, zmiany lub wirusy, ani jakichkolwiek  
>> konsekwencje tego typu okoliczności.
>
>
> -- 
> <minism.gif>	
>
> Rafał Janik
> Software Engineer
> Software Mind SA
> ul. Bociana 22A
> 31-231 Krakow
> Polska
>
> Tel. +48 12 252 34 00
> Fax: +48 12 252 34 01
> Mobile:+48 668 48 36 13
> rafal.janik@softwaremind.pl
> www.softwaremind.pl
>
> Software Mind SA z siedzibą w Krakowie przy ul. Bociana 22A, 31-231  
> Krakow
> NIP 9452012822, kapitał zakładowy PLN 500,000.00 (w całości  
> wpłacony), KRS 0000300409
> Sąd Rejonowy dla Krakowa Śródmieścia w Krakowie, XI Wydział  
> Gospodarczy KRS
>
> Ta wiadomość może zawierać materiały poufne i objęte tajemnicą  
> zawodową, do wyłącznego użytku odbiorcy (odbiorców). Surowo  
> wzbronione są wszelkie zmiany, wykorzystywanie, przechowywanie,  
> dystrybucja lub ujawnienie przez inne osoby. Jeśli nie jest Pan/Pani  
> zamierzonym odbiorcą (lub osobą upoważnioną do odbioru w imieniu  
> odbiorcy), prosimy o kontakt z nadawcą przez wiadomość zwrotną  
> oraz usunięcie wszelkich kopii niniejszej wiadomości. Poza tym  
> poczta elektroniczna jest podatna na uszkodzenia danych,  
> przechwytywanie, sabotaż, nieupoważnione zmiany i wirusy. Wysyłamy  
> i odbieramy wiadomości poczty elektronicznej wyłącznie na takiej  
> zasadzie, że nie ponosimy odpowiedzialności za jakiekolwiek tego  
> typu uszkodzenia, przechwycenia, sabotaż, zmiany lub wirusy, ani  
> jakichkolwiek konsekwencje tego typu okoliczności.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: double soap:Body and soap:envelope tags in cxf-bc response

Posted by Rafal Janik <ra...@softwaremind.pl>.
Of course it was a problem with my understanding of xpath in camel.

  local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest' 
works but this xpath must be invoked on NameSpace object with soap 
prefix defined:

         Namespaces ns = new Namespaces("soap", 
"http://schemas.xmlsoap.org/soap/envelope/");
         ...
         from(...)
                 .choice()
                 .when(ns.xpath( 
local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest'))

and now everything is ok...



On 05.01.2012 15:02, Rafal Janik wrote:
> Thanks for your reply- it is reason why there are double tags.
> I've done it that way because  when there is
>                     useJBIWrapper="false"
>                     useSOAPEnvelope="false"
> in provider and consumer - the target of provider can't recognize the 
> message - there are double tags in request.
> In second case :
>                     useJBIWrapper="false"
>                     useSOAPEnvelope="true">
> I don't know why my xpath expression doesn't work, there is a payload:
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:heal="http://myservice/aaa"><soap:Body><heal:getCommunitiesRequest 
> xmlns:heal="http://myservice/aaa">
> <heal:dataSourceId>1</heal:dataSourceId>
> </heal:getCommunitiesRequest></soap:Body></soap:Envelope>
>
> org.apache.cxf.interceptor.Fault: Invalid xpath: 
> local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest'. 
> Reason: javax.xml.xpath.XPathExpressionException
>
> but local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest' 
> I think is correct.
>
>
> In my wrong configuration with false,false for consumer and false,true 
> for provider  the payload  was just
> <heal:getCommunitiesRequest xmlns:heal="http://myservice/aaa">
> <heal:dataSourceId>1</heal:dataSourceId>
> </heal:getCommunitiesRequest>
>
> so the xpath was simpler : local-name(/*[1])='getCommunitiesRequest'
> and it worked...
>
> So what - am I doing something wrong with xpath?  should I do 
> something else with soap namespaces in serviecemix and camel?
>
>
>
>
>
> On 05.01.2012 14:26, Freeman Fang wrote:
>> Hi,
>>
>> Your cxfbc consumer and provider endpoint configuration mismatch,
>> The provider is
>>                    useJBIWrapper="false"
>>                    useSOAPEnvelope="true"
>> The consumer is
>>                    useJBIWrapper="false"
>>                    useSOAPEnvelope="false"
>>
>> You should keep those same.
>>
>> Freeman
>> On 2012-1-5, at 下午9:01, Rafal Janik wrote:
>>
>>> Hi,
>>>
>>> I've got a problem with double <soap:Envelope> and <soap:Body> tags 
>>> in my cxf bc component.
>>> The idea of my my sa is to translate a message from one soap format 
>>> to another.
>>> The cxfbc configuration:
>>>
>>> <cxfbc:provider wsdl="classpath:service_v1.wsdl"
>>>                    locationURI="http://localhost:8080/my-ws/ws"
>>>                    interfaceName="aaa:ImplPort2"
>>>                    service="aaa:myService"
>>>                    endpoint="ImplPort"
>>>                    useJBIWrapper="false"
>>>                    useSOAPEnvelope="true">
>>> </cxfbc:provider>
>>>
>>>
>>> <cxfbc:consumer wsdl="classpath:service_v2.wsdl"
>>>                    targetService="test:AdapterService"
>>>                    targetEndpoint="myEndpoint"
>>>                    useJBIWrapper="false"
>>>                    useSOAPEnvelope="false"
>>>                    locationURI="https://0.0.0.0:8190/test/testService/"
>>>                    busCfg="ssl.xml">
>>> </cxfbc:consumer>
>>>
>>>
>>> Then I use camel and processors to translate the message:
>>>
>>>
>>> from("jbi:endpoint:http://test.pl/test/RoleAnalyzerAdapterService/RoleAnalyzerEndpoint") 
>>>
>>>                .to("log:entrance")
>>>                .choice()
>>>                .when(xpath(PROPER_METHOD_INVOKED)))
>>>                .process(new MyTranslator())
>>>                .to("jbi:endpoint:{cxf-bc-provider_endpoint}")
>>>                .otherwise()
>>>                .to("log:wrong_request")
>>>                .setBody(constant(SoapResponseMessages.WRONG_METHOD));
>>>
>>>
>>> and as a result I get almost good soap (but packed again in 
>>> soap:Envelope/soap:Body):
>>>
>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>>> <soap:Body>
>>> <soap:Envelope>
>>> <soap:Body>
>>> <!--response here  -->
>>> </soap:Body>
>>> </soap:Envelope>
>>> </soap:Body>
>>> </soap:Envelope>
>>>
>>>
>>> Am I doing something wrong, maybe the component should be configured 
>>> in other way or should I use a processor for getting the body from 
>>> response and then send it back?
>>>
>>> apache-servicemix 3.6.0-fuse-00-35
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------
>> Freeman Fang
>>
>> FuseSource
>> Email:ffang@fusesource.com
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
> -- 
> Software Mind 	
>
> *Rafał Janik*
> Software Engineer
> *Software Mind SA*
> ul. Bociana 22A
> 31-231 Krakow
> Polska
>
> 	Tel. +48 12 252 34 00
> Fax: +48 12 252 34 01
> Mobile:+48 668 48 36 13
> rafal.janik@softwaremind.pl <ma...@softwaremind.pl>
> www.softwaremind.pl <http://www.softwaremind.pl>
>
> Software Mind SA z siedzibą w Krakowie przy ul. Bociana 22A, 31-231 Krakow
> NIP 9452012822, kapitał zakładowy PLN 500,000.00 (w całości wpłacony), 
> KRS 0000300409
> Sąd Rejonowy dla Krakowa Śródmieścia w Krakowie, XI Wydział 
> Gospodarczy KRS
> Ta wiadomość może zawierać materiały poufne i objęte tajemnicą 
> zawodową, do wyłącznego użytku odbiorcy (odbiorców). Surowo wzbronione 
> są wszelkie zmiany, wykorzystywanie, przechowywanie, dystrybucja lub 
> ujawnienie przez inne osoby. Jeśli nie jest Pan/Pani zamierzonym 
> odbiorcą (lub osobą upoważnioną do odbioru w imieniu odbiorcy), 
> prosimy o kontakt z nadawcą przez wiadomość zwrotną oraz usunięcie 
> wszelkich kopii niniejszej wiadomości. Poza tym poczta elektroniczna 
> jest podatna na uszkodzenia danych, przechwytywanie, sabotaż, 
> nieupoważnione zmiany i wirusy. Wysyłamy i odbieramy wiadomości poczty 
> elektronicznej wyłącznie na takiej zasadzie, że nie ponosimy 
> odpowiedzialności za jakiekolwiek tego typu uszkodzenia, 
> przechwycenia, sabotaż, zmiany lub wirusy, ani jakichkolwiek 
> konsekwencje tego typu okoliczności.
>


-- 
Software Mind 	

*Rafał Janik*
Software Engineer
*Software Mind SA*
ul. Bociana 22A
31-231 Krakow
Polska

	Tel. +48 12 252 34 00
Fax: +48 12 252 34 01
Mobile:+48 668 48 36 13
rafal.janik@softwaremind.pl <ma...@softwaremind.pl>
www.softwaremind.pl <http://www.softwaremind.pl>

Software Mind SA z siedzibą w Krakowie przy ul. Bociana 22A, 31-231 Krakow
NIP 9452012822, kapitał zakładowy PLN 500,000.00 (w całości wpłacony), 
KRS 0000300409
Sąd Rejonowy dla Krakowa Śródmieścia w Krakowie, XI Wydział Gospodarczy KRS
Ta wiadomość może zawierać materiały poufne i objęte tajemnicą zawodową, 
do wyłącznego użytku odbiorcy (odbiorców). Surowo wzbronione są wszelkie 
zmiany, wykorzystywanie, przechowywanie, dystrybucja lub ujawnienie 
przez inne osoby. Jeśli nie jest Pan/Pani zamierzonym odbiorcą (lub 
osobą upoważnioną do odbioru w imieniu odbiorcy), prosimy o kontakt z 
nadawcą przez wiadomość zwrotną oraz usunięcie wszelkich kopii 
niniejszej wiadomości. Poza tym poczta elektroniczna jest podatna na 
uszkodzenia danych, przechwytywanie, sabotaż, nieupoważnione zmiany i 
wirusy. Wysyłamy i odbieramy wiadomości poczty elektronicznej wyłącznie 
na takiej zasadzie, że nie ponosimy odpowiedzialności za jakiekolwiek 
tego typu uszkodzenia, przechwycenia, sabotaż, zmiany lub wirusy, ani 
jakichkolwiek konsekwencje tego typu okoliczności.


Re: double soap:Body and soap:envelope tags in cxf-bc response

Posted by Rafal Janik <ra...@softwaremind.pl>.
Thanks for your reply- it is reason why there are double tags.
I've done it that way because  when there is
                     useJBIWrapper="false"
                     useSOAPEnvelope="false"
in provider and consumer - the target of provider can't recognize the 
message - there are double tags in request.
In second case :
                     useJBIWrapper="false"
                     useSOAPEnvelope="true">
I don't know why my xpath expression doesn't work, there is a payload:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:heal="http://myservice/aaa"><soap:Body><heal:getCommunitiesRequest 
xmlns:heal="http://myservice/aaa">
<heal:dataSourceId>1</heal:dataSourceId>
</heal:getCommunitiesRequest></soap:Body></soap:Envelope>

org.apache.cxf.interceptor.Fault: Invalid xpath: 
local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest'. 
Reason: javax.xml.xpath.XPathExpressionException

but local-name(/soap:Envelope/soap:Body/*[1])='getCommunitiesRequest' I 
think is correct.


In my wrong configuration with false,false for consumer and false,true 
for provider  the payload  was just
<heal:getCommunitiesRequest xmlns:heal="http://myservice/aaa">
<heal:dataSourceId>1</heal:dataSourceId>
</heal:getCommunitiesRequest>

so the xpath was simpler : local-name(/*[1])='getCommunitiesRequest'
and it worked...

So what - am I doing something wrong with xpath?  should I do something 
else with soap namespaces in serviecemix and camel?





On 05.01.2012 14:26, Freeman Fang wrote:
> Hi,
>
> Your cxfbc consumer and provider endpoint configuration mismatch,
> The provider is
>                    useJBIWrapper="false"
>                    useSOAPEnvelope="true"
> The consumer is
>                    useJBIWrapper="false"
>                    useSOAPEnvelope="false"
>
> You should keep those same.
>
> Freeman
> On 2012-1-5, at 下午9:01, Rafal Janik wrote:
>
>> Hi,
>>
>> I've got a problem with double <soap:Envelope> and <soap:Body> tags 
>> in my cxf bc component.
>> The idea of my my sa is to translate a message from one soap format 
>> to another.
>> The cxfbc configuration:
>>
>> <cxfbc:provider wsdl="classpath:service_v1.wsdl"
>>                    locationURI="http://localhost:8080/my-ws/ws"
>>                    interfaceName="aaa:ImplPort2"
>>                    service="aaa:myService"
>>                    endpoint="ImplPort"
>>                    useJBIWrapper="false"
>>                    useSOAPEnvelope="true">
>> </cxfbc:provider>
>>
>>
>> <cxfbc:consumer wsdl="classpath:service_v2.wsdl"
>>                    targetService="test:AdapterService"
>>                    targetEndpoint="myEndpoint"
>>                    useJBIWrapper="false"
>>                    useSOAPEnvelope="false"
>>                    locationURI="https://0.0.0.0:8190/test/testService/"
>>                    busCfg="ssl.xml">
>> </cxfbc:consumer>
>>
>>
>> Then I use camel and processors to translate the message:
>>
>>
>> from("jbi:endpoint:http://test.pl/test/RoleAnalyzerAdapterService/RoleAnalyzerEndpoint") 
>>
>>                .to("log:entrance")
>>                .choice()
>>                .when(xpath(PROPER_METHOD_INVOKED)))
>>                .process(new MyTranslator())
>>                .to("jbi:endpoint:{cxf-bc-provider_endpoint}")
>>                .otherwise()
>>                .to("log:wrong_request")
>>                .setBody(constant(SoapResponseMessages.WRONG_METHOD));
>>
>>
>> and as a result I get almost good soap (but packed again in 
>> soap:Envelope/soap:Body):
>>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>> <soap:Body>
>> <soap:Envelope>
>> <soap:Body>
>> <!--response here  -->
>> </soap:Body>
>> </soap:Envelope>
>> </soap:Body>
>> </soap:Envelope>
>>
>>
>> Am I doing something wrong, maybe the component should be configured 
>> in other way or should I use a processor for getting the body from 
>> response and then send it back?
>>
>> apache-servicemix 3.6.0-fuse-00-35
>>
>>
>>
>>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
>
>
>
>
>
>
>
>
>
>


-- 
Software Mind 	

*Rafał Janik*
Software Engineer
*Software Mind SA*
ul. Bociana 22A
31-231 Krakow
Polska

	Tel. +48 12 252 34 00
Fax: +48 12 252 34 01
Mobile:+48 668 48 36 13
rafal.janik@softwaremind.pl <ma...@softwaremind.pl>
www.softwaremind.pl <http://www.softwaremind.pl>

Software Mind SA z siedzibą w Krakowie przy ul. Bociana 22A, 31-231 Krakow
NIP 9452012822, kapitał zakładowy PLN 500,000.00 (w całości wpłacony), 
KRS 0000300409
Sąd Rejonowy dla Krakowa Śródmieścia w Krakowie, XI Wydział Gospodarczy KRS
Ta wiadomość może zawierać materiały poufne i objęte tajemnicą zawodową, 
do wyłącznego użytku odbiorcy (odbiorców). Surowo wzbronione są wszelkie 
zmiany, wykorzystywanie, przechowywanie, dystrybucja lub ujawnienie 
przez inne osoby. Jeśli nie jest Pan/Pani zamierzonym odbiorcą (lub 
osobą upoważnioną do odbioru w imieniu odbiorcy), prosimy o kontakt z 
nadawcą przez wiadomość zwrotną oraz usunięcie wszelkich kopii 
niniejszej wiadomości. Poza tym poczta elektroniczna jest podatna na 
uszkodzenia danych, przechwytywanie, sabotaż, nieupoważnione zmiany i 
wirusy. Wysyłamy i odbieramy wiadomości poczty elektronicznej wyłącznie 
na takiej zasadzie, że nie ponosimy odpowiedzialności za jakiekolwiek 
tego typu uszkodzenia, przechwycenia, sabotaż, zmiany lub wirusy, ani 
jakichkolwiek konsekwencje tego typu okoliczności.


Re: double soap:Body and soap:envelope tags in cxf-bc response

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Your cxfbc consumer and provider endpoint configuration mismatch,
The provider is
                    useJBIWrapper="false"
                    useSOAPEnvelope="true"
The consumer is
                    useJBIWrapper="false"
                    useSOAPEnvelope="false"

You should keep those same.

Freeman
On 2012-1-5, at 下午9:01, Rafal Janik wrote:

> Hi,
>
> I've got a problem with double <soap:Envelope> and <soap:Body> tags  
> in my cxf bc component.
> The idea of my my sa is to translate a message from one soap format  
> to another.
> The cxfbc configuration:
>
> <cxfbc:provider wsdl="classpath:service_v1.wsdl"
>                    locationURI="http://localhost:8080/my-ws/ws"
>                    interfaceName="aaa:ImplPort2"
>                    service="aaa:myService"
>                    endpoint="ImplPort"
>                    useJBIWrapper="false"
>                    useSOAPEnvelope="true">
> </cxfbc:provider>
>
>
> <cxfbc:consumer wsdl="classpath:service_v2.wsdl"
>                    targetService="test:AdapterService"
>                    targetEndpoint="myEndpoint"
>                    useJBIWrapper="false"
>                    useSOAPEnvelope="false"
>                    locationURI="https://0.0.0.0:8190/test/ 
> testService/"
>                    busCfg="ssl.xml">
> </cxfbc:consumer>
>
>
> Then I use camel and processors to translate the message:
>
>
> from("jbi:endpoint:http://test.pl/test/RoleAnalyzerAdapterService/RoleAnalyzerEndpoint 
> ")
>                .to("log:entrance")
>                .choice()
>                .when(xpath(PROPER_METHOD_INVOKED)))
>                .process(new MyTranslator())
>                .to("jbi:endpoint:{cxf-bc-provider_endpoint}")
>                .otherwise()
>                .to("log:wrong_request")
>                .setBody(constant(SoapResponseMessages.WRONG_METHOD));
>
>
> and as a result I get almost good soap (but packed again in  
> soap:Envelope/soap:Body):
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <soap:Envelope>
> <soap:Body>
> <!--response here  -->
> </soap:Body>
> </soap:Envelope>
> </soap:Body>
> </soap:Envelope>
>
>
> Am I doing something wrong, maybe the component should be configured  
> in other way or should I use a processor for getting the body from  
> response and then send it back?
>
> apache-servicemix 3.6.0-fuse-00-35
>
>
>
>

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com