You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Rajesh_lakhotia <la...@gmail.com> on 2009/06/01 16:20:12 UTC

Re: CXF Consumer and optional soap headers

here is the error log :
INFO  - ServiceUnitLifeCycle           - Starting service unit:
tutorial-camel-su
INFO  - ServiceUnitLifeCycle           - Starting service unit: cxf-ipds-su
INFO  - JBIContainer                   - ServiceMix JBI Container
(ServiceMix) started
INFO  - JDBCAdapterFactory             - Database driver recognized:
[apache_derby_embedded_jdbc_driver]
INFO  - LogTask                        - Logging system reconfigured using
file: file:/C:/apache-servicemix-3.3/conf/log4j.xml
Jun 1, 2009 9:16:52 AM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Missing required header element:
{http://XXXXXXXXXXXXXXXXXXX/service/headers}Codespace
        at
org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.processHeader(JbiInWsdl1Interceptor.java:207)
        at
org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:180)
        at
org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:59)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278)




Freeman Fang wrote:
> 
> Rajesh_lakhotia wrote:
>> Hi Freeman,
>> Its an external service (written using axis2) and being hosted at
>> external
>> server.
>> I dont know how and why do i need to wsdl2java since I am not writing a
>> client for that.
>> All I want to do is use CXF-BC consumer - provider along with camel
>> router
>> to route clients to some destination.
>>
>> my set up would look like this..
>> client ----> cxf-BC consumer ---> camel router ( dynamic routing)---->
>> cxf
>> BC provider---> external service---> response to client
>>
>> so I have configured consumer and and it does send a jbi message to camel
>> router..but the problems are headers.
>>
>>   
> Do you see any exception stacktrace in the log? I'd like to see where 
> throw the exception
>> Why CXF-BC consumer fails If client is not sending headers.
>> Has any one else  encountered this ? or the wsdl given by service
>> producer
>> is wrong ?
>> I believe you have already seen the wsdl, do you want me to change the
>> wsdl
>> ?
>>   
> Before I totally figure out the problem, I don't want you to change the 
> wsdl (btw, the wsdl is ok for me with implicit soap header)
> But your wsdl is incomplete, all imported xsd file is missing, so that I 
> can't get it a try myself, that' why I ask you provide a working 
> testcase for your workflow (client ----> cxf-BC consumer ---> camel 
> router ( dynamic routing)----> cxf BC provider---> external service), 
> which is easy for me to reproduce the problem...
>> please advice.
>> appreciate you devoting time on this.
>>
>>
>>
>> Freeman Fang wrote:
>>   
>>> Hi,
>>>  From your wsdl, actually you are using so-called implicit soap headers, 
>>> which means unless you use -exsh flag for wsdl2java tool, your soap 
>>> header won't be generated as java method parameter.  What exactly the 
>>> exception you get? Can you append a working testcase, which is more 
>>> helpful for me to reproduce the problem.
>>> Thanks
>>> Freeman
>>> //
>>>
>>> Rajesh_lakhotia wrote:
>>>     
>>>> Hi,
>>>> Please see inline.
>>>>
>>>> ---Several questions
>>>> 1. you mean it works fine directly with/without headers, what's kind of 
>>>> server are you use in this case?  Is it cxf standalone server?
>>>>
>>>> Its an stand alone App server where this Service (axis2 aar packaged in
>>>> an
>>>> ear with other libs and classes) is deployed.
>>>> I use a soap ui client and hit that service directly. Thats what I have
>>>> been
>>>> doing before planning to use an ESB (serviceMix) in between.
>>>>
>>>> 2. How you send client message? use some tool like soapUI?
>>>> Yes Soap UI.
>>>>
>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>> message
>>>> wsdl is uploaded ( some nsamespaces were changed for privacy)
>>>> Please advice if you need messages.xsd too.
>>>>
>>>> thanks.
>>>>
>>>>
>>>> Thanks
>>>> Freeman http://www.nabble.com/file/p23780277/services.wsdl
>>>> services.wsdl 
>>>>
>>>> Freeman Fang wrote:
>>>>   
>>>>       
>>>>> Hi,
>>>>>
>>>>> Several questions
>>>>> 1. you mean it works fine directly with/without headers, what's kind
>>>>> of 
>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>> 2. How you send client message? use some tool like soapUI?
>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>> message
>>>>>
>>>>> Thanks
>>>>> Freeman
>>>>> Rajesh_lakhotia wrote:
>>>>>     
>>>>>         
>>>>>> Hi,
>>>>>> have a wsdl which have some headers defined for an operation ..
>>>>>> ........other junk...
>>>>>> .....
>>>>>> <!-- GetFeature -->
>>>>>>         <wsdl:operation name="GetFeature">
>>>>>>             <soap:operation soapAction="GetFeature"/>
>>>>>>             <wsdl:input>
>>>>>>                 <!-- WS-Security -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:wssSecurity"/>
>>>>>>                 <!-- WS-Addressing -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:wsaMessageId"/>
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:wsaTo"/>
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:wsaAction"/>
>>>>>>                 <!-- Client Application Headers -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxUserAgent"/>
>>>>>>                 <!-- Routing Headers -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxDataFormatVersion"/>
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxCodespace"/>
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxFeatureType"/>
>>>>>>                 <!-- Soap Body -->
>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>             </wsdl:input>
>>>>>>             <wsdl:output>
>>>>>>                 <!-- WS-Security -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:wssSecurity"/>
>>>>>>                 <!-- WS-Addressing -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:wsaMessageId"/>
>>>>>>                 <!-- Server Application Headers -->
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxServer"/>
>>>>>>                 <soap:header part="header" use="literal"
>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>                 <!-- Soap Body -->
>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>             </wsdl:output>
>>>>>>             <wsdl:fault name="ServiceException">
>>>>>>             	<soap:fault name="ServiceException"/>
>>>>>>             </wsdl:fault>
>>>>>>         </wsdl:operation>
>>>>>> ...
>>>>>> ...
>>>>>> when this wsdl is used to configure cxf-BC consumer 
>>>>>> 	<cxfbc:consumer wsdl="classpath:wsdl/services.wsdl"
>>>>>>                     service="ns1:rajEsbService"
>>>>>>                     endpoint="rajConsumer"
>>>>>>                     targetService="myns:CamelEsbService">
>>>>>> 	</cxfbc:consumer>
>>>>>> Now this cxf-bc consumer setup  wants all headers be passed.
>>>>>> If I miss any header, this setup returns a soap fault back.
>>>>>>
>>>>>> The service works fine if I invoke it directly ( without serviceMIX)
>>>>>> with
>>>>>> or
>>>>>> without any headers.
>>>>>> Is there a property which configures CXf-BC consumer correctly to
>>>>>> avoid
>>>>>> such
>>>>>> error ?
>>>>>>
>>>>>> Appreciate your help.
>>>>>>   
>>>>>>       
>>>>>>           
>>>>> -- 
>>>>> Freeman Fang
>>>>> ------------------------
>>>>> Open Source SOA: http://fusesource.com
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>         
>>>>   
>>>>       
>>> -- 
>>> Freeman Fang
>>> ------------------------
>>> Open Source SOA: http://fusesource.com
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/CXF-Consumer-and-optional-soap-headers-tp23768652p23815693.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF Consumer and optional soap headers

Posted by Freeman Fang <fr...@gmail.com>.
Rajesh_lakhotia wrote:
> Thanks Freeman for quick fix.
>
> I am not using maven .....for quik testing , my plan is just to grab the
> jars you have changed and put them in lib/hotdeploy folder of serviceMix 3.3
> will that do ?
>   
yes
> Now how/where do I download servicemix-cxf-bc-2009.02  or the latest version
> with this fix. ? 
>
>   
Generally you can grap the latest one from [1], but I  don't think my 
fix already get published  to that folder so soon...
The most quick way to pick up the lastest fix  is you grap the latest 
source code with svn and build it yourself with maven

[1]http://repository.apache.org/snapshots/org/apache/servicemix/servicemix-cxf-bc/2009.02-SNAPSHOT/servicemix-cxf-bc-2009.02-SNAPSHOT-installer.zip

Freeman
> thanks.
>
>
>
> Freeman Fang wrote:
>   
>> Hi,
>>
>> Create jira [1] to track this issue and just commit fix, could you 
>> verify it works for your case?
>> [1]https://issues.apache.org/activemq/browse/SMXCOMP-557
>> Freeman
>>
>> Rajesh_lakhotia wrote:
>>     
>>> here is the error log :
>>> INFO  - ServiceUnitLifeCycle           - Starting service unit:
>>> tutorial-camel-su
>>> INFO  - ServiceUnitLifeCycle           - Starting service unit:
>>> cxf-ipds-su
>>> INFO  - JBIContainer                   - ServiceMix JBI Container
>>> (ServiceMix) started
>>> INFO  - JDBCAdapterFactory             - Database driver recognized:
>>> [apache_derby_embedded_jdbc_driver]
>>> INFO  - LogTask                        - Logging system reconfigured
>>> using
>>> file: file:/C:/apache-servicemix-3.3/conf/log4j.xml
>>> Jun 1, 2009 9:16:52 AM org.apache.cxf.phase.PhaseInterceptorChain
>>> doIntercept
>>> INFO: Interceptor has thrown exception, unwinding now
>>> org.apache.cxf.interceptor.Fault: Missing required header element:
>>> {http://XXXXXXXXXXXXXXXXXXX/service/headers}Codespace
>>>         at
>>> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.processHeader(JbiInWsdl1Interceptor.java:207)
>>>         at
>>> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:180)
>>>         at
>>> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:59)
>>>         at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>>>         at
>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
>>>         at
>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278)
>>>
>>>
>>>
>>>
>>> Freeman Fang wrote:
>>>   
>>>       
>>>> Rajesh_lakhotia wrote:
>>>>     
>>>>         
>>>>> Hi Freeman,
>>>>> Its an external service (written using axis2) and being hosted at
>>>>> external
>>>>> server.
>>>>> I dont know how and why do i need to wsdl2java since I am not writing a
>>>>> client for that.
>>>>> All I want to do is use CXF-BC consumer - provider along with camel
>>>>> router
>>>>> to route clients to some destination.
>>>>>
>>>>> my set up would look like this..
>>>>> client ----> cxf-BC consumer ---> camel router ( dynamic routing)---->
>>>>> cxf
>>>>> BC provider---> external service---> response to client
>>>>>
>>>>> so I have configured consumer and and it does send a jbi message to
>>>>> camel
>>>>> router..but the problems are headers.
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>> Do you see any exception stacktrace in the log? I'd like to see where 
>>>> throw the exception
>>>>     
>>>>         
>>>>> Why CXF-BC consumer fails If client is not sending headers.
>>>>> Has any one else  encountered this ? or the wsdl given by service
>>>>> producer
>>>>> is wrong ?
>>>>> I believe you have already seen the wsdl, do you want me to change the
>>>>> wsdl
>>>>> ?
>>>>>   
>>>>>       
>>>>>           
>>>> Before I totally figure out the problem, I don't want you to change the 
>>>> wsdl (btw, the wsdl is ok for me with implicit soap header)
>>>> But your wsdl is incomplete, all imported xsd file is missing, so that I 
>>>> can't get it a try myself, that' why I ask you provide a working 
>>>> testcase for your workflow (client ----> cxf-BC consumer ---> camel 
>>>> router ( dynamic routing)----> cxf BC provider---> external service), 
>>>> which is easy for me to reproduce the problem...
>>>>     
>>>>         
>>>>> please advice.
>>>>> appreciate you devoting time on this.
>>>>>
>>>>>
>>>>>
>>>>> Freeman Fang wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Hi,
>>>>>>  From your wsdl, actually you are using so-called implicit soap
>>>>>> headers, 
>>>>>> which means unless you use -exsh flag for wsdl2java tool, your soap 
>>>>>> header won't be generated as java method parameter.  What exactly the 
>>>>>> exception you get? Can you append a working testcase, which is more 
>>>>>> helpful for me to reproduce the problem.
>>>>>> Thanks
>>>>>> Freeman
>>>>>> //
>>>>>>
>>>>>> Rajesh_lakhotia wrote:
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>> Hi,
>>>>>>> Please see inline.
>>>>>>>
>>>>>>> ---Several questions
>>>>>>> 1. you mean it works fine directly with/without headers, what's kind
>>>>>>> of 
>>>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>>>>
>>>>>>> Its an stand alone App server where this Service (axis2 aar packaged
>>>>>>> in
>>>>>>> an
>>>>>>> ear with other libs and classes) is deployed.
>>>>>>> I use a soap ui client and hit that service directly. Thats what I
>>>>>>> have
>>>>>>> been
>>>>>>> doing before planning to use an ESB (serviceMix) in between.
>>>>>>>
>>>>>>> 2. How you send client message? use some tool like soapUI?
>>>>>>> Yes Soap UI.
>>>>>>>
>>>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>>>> message
>>>>>>> wsdl is uploaded ( some nsamespaces were changed for privacy)
>>>>>>> Please advice if you need messages.xsd too.
>>>>>>>
>>>>>>> thanks.
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>> Freeman http://www.nabble.com/file/p23780277/services.wsdl
>>>>>>> services.wsdl 
>>>>>>>
>>>>>>> Freeman Fang wrote:
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Several questions
>>>>>>>> 1. you mean it works fine directly with/without headers, what's kind
>>>>>>>> of 
>>>>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>>>>> 2. How you send client message? use some tool like soapUI?
>>>>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>>>>> message
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Freeman
>>>>>>>> Rajesh_lakhotia wrote:
>>>>>>>>     
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>>>> Hi,
>>>>>>>>> have a wsdl which have some headers defined for an operation ..
>>>>>>>>> ........other junk...
>>>>>>>>> .....
>>>>>>>>> <!-- GetFeature -->
>>>>>>>>>         <wsdl:operation name="GetFeature">
>>>>>>>>>             <soap:operation soapAction="GetFeature"/>
>>>>>>>>>             <wsdl:input>
>>>>>>>>>                 <!-- WS-Security -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:wssSecurity"/>
>>>>>>>>>                 <!-- WS-Addressing -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:wsaMessageId"/>
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:wsaTo"/>
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:wsaAction"/>
>>>>>>>>>                 <!-- Client Application Headers -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxUserAgent"/>
>>>>>>>>>                 <!-- Routing Headers -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxDataFormatVersion"/>
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxCodespace"/>
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxFeatureType"/>
>>>>>>>>>                 <!-- Soap Body -->
>>>>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>>>>             </wsdl:input>
>>>>>>>>>             <wsdl:output>
>>>>>>>>>                 <!-- WS-Security -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:wssSecurity"/>
>>>>>>>>>                 <!-- WS-Addressing -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:wsaMessageId"/>
>>>>>>>>>                 <!-- Server Application Headers -->
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxServer"/>
>>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>>>>                 <!-- Soap Body -->
>>>>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>>>>             </wsdl:output>
>>>>>>>>>             <wsdl:fault name="ServiceException">
>>>>>>>>>             	<soap:fault name="ServiceException"/>
>>>>>>>>>             </wsdl:fault>
>>>>>>>>>         </wsdl:operation>
>>>>>>>>> ...
>>>>>>>>> ...
>>>>>>>>> when this wsdl is used to configure cxf-BC consumer 
>>>>>>>>> 	<cxfbc:consumer wsdl="classpath:wsdl/services.wsdl"
>>>>>>>>>                     service="ns1:rajEsbService"
>>>>>>>>>                     endpoint="rajConsumer"
>>>>>>>>>                     targetService="myns:CamelEsbService">
>>>>>>>>> 	</cxfbc:consumer>
>>>>>>>>> Now this cxf-bc consumer setup  wants all headers be passed.
>>>>>>>>> If I miss any header, this setup returns a soap fault back.
>>>>>>>>>
>>>>>>>>> The service works fine if I invoke it directly ( without
>>>>>>>>> serviceMIX)
>>>>>>>>> with
>>>>>>>>> or
>>>>>>>>> without any headers.
>>>>>>>>> Is there a property which configures CXf-BC consumer correctly to
>>>>>>>>> avoid
>>>>>>>>> such
>>>>>>>>> error ?
>>>>>>>>>
>>>>>>>>> Appreciate your help.
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>           
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>> -- 
>>>>>>>> Freeman Fang
>>>>>>>> ------------------------
>>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>> -- 
>>>>>> Freeman Fang
>>>>>> ------------------------
>>>>>> Open Source SOA: http://fusesource.com
>>>>>>
>>>>>>
>>>>>>
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>   
>>>>>       
>>>>>           
>>>> -- 
>>>> Freeman Fang
>>>> ------------------------
>>>> Open Source SOA: http://fusesource.com
>>>>
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>>
>>
>>     
>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: CXF Consumer and optional soap headers

Posted by Rajesh_lakhotia <la...@gmail.com>.
Thanks Freeman for quick fix.

I am not using maven .....for quik testing , my plan is just to grab the
jars you have changed and put them in lib/hotdeploy folder of serviceMix 3.3
will that do ?
Now how/where do I download servicemix-cxf-bc-2009.02  or the latest version
with this fix. ? 

thanks.



Freeman Fang wrote:
> 
> Hi,
> 
> Create jira [1] to track this issue and just commit fix, could you 
> verify it works for your case?
> [1]https://issues.apache.org/activemq/browse/SMXCOMP-557
> Freeman
> 
> Rajesh_lakhotia wrote:
>> here is the error log :
>> INFO  - ServiceUnitLifeCycle           - Starting service unit:
>> tutorial-camel-su
>> INFO  - ServiceUnitLifeCycle           - Starting service unit:
>> cxf-ipds-su
>> INFO  - JBIContainer                   - ServiceMix JBI Container
>> (ServiceMix) started
>> INFO  - JDBCAdapterFactory             - Database driver recognized:
>> [apache_derby_embedded_jdbc_driver]
>> INFO  - LogTask                        - Logging system reconfigured
>> using
>> file: file:/C:/apache-servicemix-3.3/conf/log4j.xml
>> Jun 1, 2009 9:16:52 AM org.apache.cxf.phase.PhaseInterceptorChain
>> doIntercept
>> INFO: Interceptor has thrown exception, unwinding now
>> org.apache.cxf.interceptor.Fault: Missing required header element:
>> {http://XXXXXXXXXXXXXXXXXXX/service/headers}Codespace
>>         at
>> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.processHeader(JbiInWsdl1Interceptor.java:207)
>>         at
>> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:180)
>>         at
>> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:59)
>>         at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>>         at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
>>         at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278)
>>
>>
>>
>>
>> Freeman Fang wrote:
>>   
>>> Rajesh_lakhotia wrote:
>>>     
>>>> Hi Freeman,
>>>> Its an external service (written using axis2) and being hosted at
>>>> external
>>>> server.
>>>> I dont know how and why do i need to wsdl2java since I am not writing a
>>>> client for that.
>>>> All I want to do is use CXF-BC consumer - provider along with camel
>>>> router
>>>> to route clients to some destination.
>>>>
>>>> my set up would look like this..
>>>> client ----> cxf-BC consumer ---> camel router ( dynamic routing)---->
>>>> cxf
>>>> BC provider---> external service---> response to client
>>>>
>>>> so I have configured consumer and and it does send a jbi message to
>>>> camel
>>>> router..but the problems are headers.
>>>>
>>>>   
>>>>       
>>> Do you see any exception stacktrace in the log? I'd like to see where 
>>> throw the exception
>>>     
>>>> Why CXF-BC consumer fails If client is not sending headers.
>>>> Has any one else  encountered this ? or the wsdl given by service
>>>> producer
>>>> is wrong ?
>>>> I believe you have already seen the wsdl, do you want me to change the
>>>> wsdl
>>>> ?
>>>>   
>>>>       
>>> Before I totally figure out the problem, I don't want you to change the 
>>> wsdl (btw, the wsdl is ok for me with implicit soap header)
>>> But your wsdl is incomplete, all imported xsd file is missing, so that I 
>>> can't get it a try myself, that' why I ask you provide a working 
>>> testcase for your workflow (client ----> cxf-BC consumer ---> camel 
>>> router ( dynamic routing)----> cxf BC provider---> external service), 
>>> which is easy for me to reproduce the problem...
>>>     
>>>> please advice.
>>>> appreciate you devoting time on this.
>>>>
>>>>
>>>>
>>>> Freeman Fang wrote:
>>>>   
>>>>       
>>>>> Hi,
>>>>>  From your wsdl, actually you are using so-called implicit soap
>>>>> headers, 
>>>>> which means unless you use -exsh flag for wsdl2java tool, your soap 
>>>>> header won't be generated as java method parameter.  What exactly the 
>>>>> exception you get? Can you append a working testcase, which is more 
>>>>> helpful for me to reproduce the problem.
>>>>> Thanks
>>>>> Freeman
>>>>> //
>>>>>
>>>>> Rajesh_lakhotia wrote:
>>>>>     
>>>>>         
>>>>>> Hi,
>>>>>> Please see inline.
>>>>>>
>>>>>> ---Several questions
>>>>>> 1. you mean it works fine directly with/without headers, what's kind
>>>>>> of 
>>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>>>
>>>>>> Its an stand alone App server where this Service (axis2 aar packaged
>>>>>> in
>>>>>> an
>>>>>> ear with other libs and classes) is deployed.
>>>>>> I use a soap ui client and hit that service directly. Thats what I
>>>>>> have
>>>>>> been
>>>>>> doing before planning to use an ESB (serviceMix) in between.
>>>>>>
>>>>>> 2. How you send client message? use some tool like soapUI?
>>>>>> Yes Soap UI.
>>>>>>
>>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>>> message
>>>>>> wsdl is uploaded ( some nsamespaces were changed for privacy)
>>>>>> Please advice if you need messages.xsd too.
>>>>>>
>>>>>> thanks.
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>> Freeman http://www.nabble.com/file/p23780277/services.wsdl
>>>>>> services.wsdl 
>>>>>>
>>>>>> Freeman Fang wrote:
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> Hi,
>>>>>>>
>>>>>>> Several questions
>>>>>>> 1. you mean it works fine directly with/without headers, what's kind
>>>>>>> of 
>>>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>>>> 2. How you send client message? use some tool like soapUI?
>>>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>>>> message
>>>>>>>
>>>>>>> Thanks
>>>>>>> Freeman
>>>>>>> Rajesh_lakhotia wrote:
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> Hi,
>>>>>>>> have a wsdl which have some headers defined for an operation ..
>>>>>>>> ........other junk...
>>>>>>>> .....
>>>>>>>> <!-- GetFeature -->
>>>>>>>>         <wsdl:operation name="GetFeature">
>>>>>>>>             <soap:operation soapAction="GetFeature"/>
>>>>>>>>             <wsdl:input>
>>>>>>>>                 <!-- WS-Security -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:wssSecurity"/>
>>>>>>>>                 <!-- WS-Addressing -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:wsaMessageId"/>
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:wsaTo"/>
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:wsaAction"/>
>>>>>>>>                 <!-- Client Application Headers -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxUserAgent"/>
>>>>>>>>                 <!-- Routing Headers -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxDataFormatVersion"/>
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxCodespace"/>
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxFeatureType"/>
>>>>>>>>                 <!-- Soap Body -->
>>>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>>>             </wsdl:input>
>>>>>>>>             <wsdl:output>
>>>>>>>>                 <!-- WS-Security -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:wssSecurity"/>
>>>>>>>>                 <!-- WS-Addressing -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:wsaMessageId"/>
>>>>>>>>                 <!-- Server Application Headers -->
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxServer"/>
>>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>>>                 <!-- Soap Body -->
>>>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>>>             </wsdl:output>
>>>>>>>>             <wsdl:fault name="ServiceException">
>>>>>>>>             	<soap:fault name="ServiceException"/>
>>>>>>>>             </wsdl:fault>
>>>>>>>>         </wsdl:operation>
>>>>>>>> ...
>>>>>>>> ...
>>>>>>>> when this wsdl is used to configure cxf-BC consumer 
>>>>>>>> 	<cxfbc:consumer wsdl="classpath:wsdl/services.wsdl"
>>>>>>>>                     service="ns1:rajEsbService"
>>>>>>>>                     endpoint="rajConsumer"
>>>>>>>>                     targetService="myns:CamelEsbService">
>>>>>>>> 	</cxfbc:consumer>
>>>>>>>> Now this cxf-bc consumer setup  wants all headers be passed.
>>>>>>>> If I miss any header, this setup returns a soap fault back.
>>>>>>>>
>>>>>>>> The service works fine if I invoke it directly ( without
>>>>>>>> serviceMIX)
>>>>>>>> with
>>>>>>>> or
>>>>>>>> without any headers.
>>>>>>>> Is there a property which configures CXf-BC consumer correctly to
>>>>>>>> avoid
>>>>>>>> such
>>>>>>>> error ?
>>>>>>>>
>>>>>>>> Appreciate your help.
>>>>>>>>   
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>> -- 
>>>>>>> Freeman Fang
>>>>>>> ------------------------
>>>>>>> Open Source SOA: http://fusesource.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>   
>>>>>>       
>>>>>>           
>>>>> -- 
>>>>> Freeman Fang
>>>>> ------------------------
>>>>> Open Source SOA: http://fusesource.com
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>         
>>>>   
>>>>       
>>> -- 
>>> Freeman Fang
>>> ------------------------
>>> Open Source SOA: http://fusesource.com
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/CXF-Consumer-and-optional-soap-headers-tp23768652p23836972.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF Consumer and optional soap headers

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

Create jira [1] to track this issue and just commit fix, could you 
verify it works for your case?
[1]https://issues.apache.org/activemq/browse/SMXCOMP-557
Freeman

Rajesh_lakhotia wrote:
> here is the error log :
> INFO  - ServiceUnitLifeCycle           - Starting service unit:
> tutorial-camel-su
> INFO  - ServiceUnitLifeCycle           - Starting service unit: cxf-ipds-su
> INFO  - JBIContainer                   - ServiceMix JBI Container
> (ServiceMix) started
> INFO  - JDBCAdapterFactory             - Database driver recognized:
> [apache_derby_embedded_jdbc_driver]
> INFO  - LogTask                        - Logging system reconfigured using
> file: file:/C:/apache-servicemix-3.3/conf/log4j.xml
> Jun 1, 2009 9:16:52 AM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Missing required header element:
> {http://XXXXXXXXXXXXXXXXXXX/service/headers}Codespace
>         at
> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.processHeader(JbiInWsdl1Interceptor.java:207)
>         at
> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:180)
>         at
> org.apache.servicemix.cxfbc.interceptors.JbiInWsdl1Interceptor.handleMessage(JbiInWsdl1Interceptor.java:59)
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>         at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
>         at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278)
>
>
>
>
> Freeman Fang wrote:
>   
>> Rajesh_lakhotia wrote:
>>     
>>> Hi Freeman,
>>> Its an external service (written using axis2) and being hosted at
>>> external
>>> server.
>>> I dont know how and why do i need to wsdl2java since I am not writing a
>>> client for that.
>>> All I want to do is use CXF-BC consumer - provider along with camel
>>> router
>>> to route clients to some destination.
>>>
>>> my set up would look like this..
>>> client ----> cxf-BC consumer ---> camel router ( dynamic routing)---->
>>> cxf
>>> BC provider---> external service---> response to client
>>>
>>> so I have configured consumer and and it does send a jbi message to camel
>>> router..but the problems are headers.
>>>
>>>   
>>>       
>> Do you see any exception stacktrace in the log? I'd like to see where 
>> throw the exception
>>     
>>> Why CXF-BC consumer fails If client is not sending headers.
>>> Has any one else  encountered this ? or the wsdl given by service
>>> producer
>>> is wrong ?
>>> I believe you have already seen the wsdl, do you want me to change the
>>> wsdl
>>> ?
>>>   
>>>       
>> Before I totally figure out the problem, I don't want you to change the 
>> wsdl (btw, the wsdl is ok for me with implicit soap header)
>> But your wsdl is incomplete, all imported xsd file is missing, so that I 
>> can't get it a try myself, that' why I ask you provide a working 
>> testcase for your workflow (client ----> cxf-BC consumer ---> camel 
>> router ( dynamic routing)----> cxf BC provider---> external service), 
>> which is easy for me to reproduce the problem...
>>     
>>> please advice.
>>> appreciate you devoting time on this.
>>>
>>>
>>>
>>> Freeman Fang wrote:
>>>   
>>>       
>>>> Hi,
>>>>  From your wsdl, actually you are using so-called implicit soap headers, 
>>>> which means unless you use -exsh flag for wsdl2java tool, your soap 
>>>> header won't be generated as java method parameter.  What exactly the 
>>>> exception you get? Can you append a working testcase, which is more 
>>>> helpful for me to reproduce the problem.
>>>> Thanks
>>>> Freeman
>>>> //
>>>>
>>>> Rajesh_lakhotia wrote:
>>>>     
>>>>         
>>>>> Hi,
>>>>> Please see inline.
>>>>>
>>>>> ---Several questions
>>>>> 1. you mean it works fine directly with/without headers, what's kind of 
>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>>
>>>>> Its an stand alone App server where this Service (axis2 aar packaged in
>>>>> an
>>>>> ear with other libs and classes) is deployed.
>>>>> I use a soap ui client and hit that service directly. Thats what I have
>>>>> been
>>>>> doing before planning to use an ESB (serviceMix) in between.
>>>>>
>>>>> 2. How you send client message? use some tool like soapUI?
>>>>> Yes Soap UI.
>>>>>
>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>> message
>>>>> wsdl is uploaded ( some nsamespaces were changed for privacy)
>>>>> Please advice if you need messages.xsd too.
>>>>>
>>>>> thanks.
>>>>>
>>>>>
>>>>> Thanks
>>>>> Freeman http://www.nabble.com/file/p23780277/services.wsdl
>>>>> services.wsdl 
>>>>>
>>>>> Freeman Fang wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Hi,
>>>>>>
>>>>>> Several questions
>>>>>> 1. you mean it works fine directly with/without headers, what's kind
>>>>>> of 
>>>>>> server are you use in this case?  Is it cxf standalone server?
>>>>>> 2. How you send client message? use some tool like soapUI?
>>>>>> 3. Could you provide your whole wsdl? include the xsd part for your
>>>>>> message
>>>>>>
>>>>>> Thanks
>>>>>> Freeman
>>>>>> Rajesh_lakhotia wrote:
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>> Hi,
>>>>>>> have a wsdl which have some headers defined for an operation ..
>>>>>>> ........other junk...
>>>>>>> .....
>>>>>>> <!-- GetFeature -->
>>>>>>>         <wsdl:operation name="GetFeature">
>>>>>>>             <soap:operation soapAction="GetFeature"/>
>>>>>>>             <wsdl:input>
>>>>>>>                 <!-- WS-Security -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:wssSecurity"/>
>>>>>>>                 <!-- WS-Addressing -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:wsaMessageId"/>
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:wsaTo"/>
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:wsaAction"/>
>>>>>>>                 <!-- Client Application Headers -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxUserAgent"/>
>>>>>>>                 <!-- Routing Headers -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxDataFormatVersion"/>
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxCodespace"/>
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxFeatureType"/>
>>>>>>>                 <!-- Soap Body -->
>>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>>             </wsdl:input>
>>>>>>>             <wsdl:output>
>>>>>>>                 <!-- WS-Security -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:wssSecurity"/>
>>>>>>>                 <!-- WS-Addressing -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:wsaMessageId"/>
>>>>>>>                 <!-- Server Application Headers -->
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxServer"/>
>>>>>>>                 <soap:header part="header" use="literal"
>>>>>>> message="tns:xxxInterfaceVersion"/>
>>>>>>>                 <!-- Soap Body -->
>>>>>>>                 <soap:body parts="body" use="literal"/>
>>>>>>>             </wsdl:output>
>>>>>>>             <wsdl:fault name="ServiceException">
>>>>>>>             	<soap:fault name="ServiceException"/>
>>>>>>>             </wsdl:fault>
>>>>>>>         </wsdl:operation>
>>>>>>> ...
>>>>>>> ...
>>>>>>> when this wsdl is used to configure cxf-BC consumer 
>>>>>>> 	<cxfbc:consumer wsdl="classpath:wsdl/services.wsdl"
>>>>>>>                     service="ns1:rajEsbService"
>>>>>>>                     endpoint="rajConsumer"
>>>>>>>                     targetService="myns:CamelEsbService">
>>>>>>> 	</cxfbc:consumer>
>>>>>>> Now this cxf-bc consumer setup  wants all headers be passed.
>>>>>>> If I miss any header, this setup returns a soap fault back.
>>>>>>>
>>>>>>> The service works fine if I invoke it directly ( without serviceMIX)
>>>>>>> with
>>>>>>> or
>>>>>>> without any headers.
>>>>>>> Is there a property which configures CXf-BC consumer correctly to
>>>>>>> avoid
>>>>>>> such
>>>>>>> error ?
>>>>>>>
>>>>>>> Appreciate your help.
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>> -- 
>>>>>> Freeman Fang
>>>>>> ------------------------
>>>>>> Open Source SOA: http://fusesource.com
>>>>>>
>>>>>>
>>>>>>
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>   
>>>>>       
>>>>>           
>>>> -- 
>>>> Freeman Fang
>>>> ------------------------
>>>> Open Source SOA: http://fusesource.com
>>>>
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>>
>>
>>     
>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com