WSDL dynamic generation behavior

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

WSDL dynamic generation behavior

Jean-Baptiste Onofré
 Hi all,

 I use ServiceMix 3.3 (with 2008.01 components).

 I have a CXF-SE component using a POJO. The xbean.xml of this
component is the following :

 <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
 xmlns:nanthrax="http://www.nanthrax.net/">

 <cxfse:endpoint>
 <cxfse:service>nanthrax:my-service</cxfse:service>
 <cxfse:endpoint>MyServiceImpl</cxfse:endpoint>
 <cxfse:pojo>
 <bean class="net.nanthrax.smx.services.MyServiceImpl">
 </bean>
 </cxfse:pojo>
 <cxfse:endpoint>

 </beans>

 I have MyService and MyServiceImpl which use @WebService annotation.

 Now I would like to expose this CXF-SE bean using a HTTP WebService.

 I have notice the following behavior around WSDL generation :

 1/ Using the "old" HTTP component (with soap=true)

 I have created a HTTP "old" component with this xbean.xml :

 <beans xmlns:http="http://servicemix.apache.org/http/1.0"
 xmlns:nanthrax="http://www.nanthrax.net/">

 <http:endpoint service="nanthrax:my-service-http"
 endpoint="MyServiceSoap"
 role="consumer"
 targetService="nanthrax:my-service"
 targetEndpoint="MyServiceImpl"
 locationURI="http://0.0.0.0:8282/myService/"
 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
 soap="true"/>

 </beans>

 Using this component, the WSDL is generated correctly corresponding
to my POJO implementation.
 But, at runtime, when I try to use it, I have this error :
 Nov 27, 2008 3:50:32 PM
org.apache.cxf.transport.jbi.JBITransportFactory setDeliveryChannel
 INFO: configuring DeliveryChannel:
org.apache.servicemix.common.EndpointDeliveryChannel@1471dd2
 Nov 27, 2008 3:50:32 PM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
 INFO: Interceptor has thrown exception, unwinding now
 org.apache.cxf.interceptor.Fault: no jbi message element
 at
org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:96)
 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.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
 at
org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:283)
 at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600)
 at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554)
 at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510)
 at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
 at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
 at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
 at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
 at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
 at java.lang.Thread.run(Thread.java:595)

 2/ Using "old" HTTP component (with soap=false)

 I use exactly the same thing but I turn the soap attribute to false.

 In this case, the WSDL is not correctly generated (the binding node
is empty) but, this time, at runtime, it works good.

 3/ Using "new" HTTP component

 Using this component, I need to define the WSDL by myself (using the
wsdl attribute). It works but it's not the good solution for me as I
want that the WSDL is generated at runtime (not at compilation time).

 It's the same if I use CXF BC component.

 So :
 - what's the component and solution to use to expose CXF SE
component and generate the WSDL at runtime ?
 - Is there example around this ?

 Thanks,
 Regards
 JB
 --
 Jean-Baptiste Onofré
 [hidden email]
 BuildProcess/AutoDeploy Project Leader
 http://buildprocess.sourceforge.net

Reply | Threaded
Open this post in threaded view
|

Re: WSDL dynamic generation behavior

Guillaume Nodet
Administrator
I have been working some days ago on improving servicemix-http new
components to support WS-Addressing and found the need to
automatically generate the binding in such case.
It still need some work, but once its done, it should be very easy to
add this automatic generation to the main endpoint itself if the
target endpoint has a WSDL description.

On Thu, Nov 27, 2008 at 5:11 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

>  Hi all,
>
>  I use ServiceMix 3.3 (with 2008.01 components).
>
>  I have a CXF-SE component using a POJO. The xbean.xml of this
> component is the following :
>
>  <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>  xmlns:nanthrax="http://www.nanthrax.net/">
>
>  <cxfse:endpoint>
>  <cxfse:service>nanthrax:my-service</cxfse:service>
>  <cxfse:endpoint>MyServiceImpl</cxfse:endpoint>
>  <cxfse:pojo>
>  <bean class="net.nanthrax.smx.services.MyServiceImpl">
>  </bean>
>  </cxfse:pojo>
>  <cxfse:endpoint>
>
>  </beans>
>
>  I have MyService and MyServiceImpl which use @WebService annotation.
>
>  Now I would like to expose this CXF-SE bean using a HTTP WebService.
>
>  I have notice the following behavior around WSDL generation :
>
>  1/ Using the "old" HTTP component (with soap=true)
>
>  I have created a HTTP "old" component with this xbean.xml :
>
>  <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>  xmlns:nanthrax="http://www.nanthrax.net/">
>
>  <http:endpoint service="nanthrax:my-service-http"
>  endpoint="MyServiceSoap"
>  role="consumer"
>  targetService="nanthrax:my-service"
>  targetEndpoint="MyServiceImpl"
>  locationURI="http://0.0.0.0:8282/myService/"
>  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>  soap="true"/>
>
>  </beans>
>
>  Using this component, the WSDL is generated correctly corresponding
> to my POJO implementation.
>  But, at runtime, when I try to use it, I have this error :
>  Nov 27, 2008 3:50:32 PM
> org.apache.cxf.transport.jbi.JBITransportFactory setDeliveryChannel
>  INFO: configuring DeliveryChannel:
> org.apache.servicemix.common.EndpointDeliveryChannel@1471dd2
>  Nov 27, 2008 3:50:32 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
>  INFO: Interceptor has thrown exception, unwinding now
>  org.apache.cxf.interceptor.Fault: no jbi message element
>  at
> org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:96)
>  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.jbi.JBIDispatcherUtil.dispatch(JBIDispatcherUtil.java:156)
>  at
> org.apache.servicemix.cxfse.CxfSeEndpoint.process(CxfSeEndpoint.java:283)
>  at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600)
>  at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554)
>  at
> org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510)
>  at
> org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
>  at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
>  at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
>  at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
>  at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>  at java.lang.Thread.run(Thread.java:595)
>
>  2/ Using "old" HTTP component (with soap=false)
>
>  I use exactly the same thing but I turn the soap attribute to false.
>
>  In this case, the WSDL is not correctly generated (the binding node
> is empty) but, this time, at runtime, it works good.
>
>  3/ Using "new" HTTP component
>
>  Using this component, I need to define the WSDL by myself (using the
> wsdl attribute). It works but it's not the good solution for me as I
> want that the WSDL is generated at runtime (not at compilation time).
>
>  It's the same if I use CXF BC component.
>
>  So :
>  - what's the component and solution to use to expose CXF SE
> component and generate the WSDL at runtime ?
>  - Is there example around this ?
>
>  Thanks,
>  Regards
>  JB
>  --
>  Jean-Baptiste Onofré
>  [hidden email]
>  BuildProcess/AutoDeploy Project Leader
>  http://buildprocess.sourceforge.net
>
>



--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com