You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Juanjo Vázquez <jv...@apache.org> on 2008/04/19 19:05:09 UTC

CXF SE: Error with dispatch/provider web services

Hi,

Lately, I have been deploying JAX-WS web services into the ServiceMix CXF-SE
component and publishing them with the CXF-BC component. Everything was ok
until I tried to deploy a web service in a dispatch/provider style. My goal
is to work with message oriented synchronous exchanges between client and
server [1].

My basic code is the JAX-WS Dispatch/Provider Demo from the CXF distribution
[2]. The service unit´s configuration (xbean.xml) is more or less like this:

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

    <cxfse:endpoint>
        <cxfse:pojo>
          <bean class="demo.hwDispatch.server.GreeterSoapMessageProvider" />
        </cxfse:pojo>
    </cxfse:endpoint>

</beans>

where GreeterSoapMessageProvider [3] should be the web service implementor.

The communication between BC SU and SE SU seems to be ok, but when a client
sends a soap message I get a null pointer exception in CXF SE Endpoint
(process method). I have debugged and it seems to fault the jbi destination
resolution.

I don´t know if this is a bug, future improvement or a configuration
mistake. Please, any ideas are welcome.

Thanks in advance,

Juanjo

[1] http://cwiki.apache.org/CXF20DOC/provider-services.html
[2]
http://svn.apache.org/repos/asf/incubator/cxf/tags/cxf-2.0.5-incubator/distribution/src/main/release/samples/jaxws_dispatch_provider
[3]
http://svn.apache.org/repos/asf/incubator/cxf/tags/cxf-2.0.5-incubator/distribution/src/main/release/samples/jaxws_dispatch_provider/src/demo/hwDispatch/server/GreeterSoapMessageProvider.java

Re: CXF SE: Error with dispatch/provider web services

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
Hi Freeman,

Thank you for replying so quickly!.

>> "First of all, since what you use is soap message provider, the provider
expect the message payload is soap, so you need and useJBIWrapper="false"
for both your bc and se"

I suspected that it had to be so.

>> "here is also a little tricky here, your package of
GreeterSoapMessageProvider is demo.hwDispatch.server, so the related
namespace of this package should be
http://server.hwDispatch.demo<http://server.hwdispatch.demo/>.
You need add a namespace declaration like xmlns:myProvider="
http://server.hwDispatch.demo <http://server.hwdispatch.demo/>" in your
configuration"

Yes, I agree with you, it´s a little bit tricky. Anyway, this works for me.
Only a little correction: the namespace has to be
"http://server.hwDispatch.demo <http://server.hwdispatch.demo/>/" (with the
last slash).

>>"All this could make your provider get invoked and you can handle the raw
soap message there"

Pay attention with the response and delete all spaces between soap message
elements, otherwise JbiOutWsdl1Interceptor throws a ClassCastException
"org.apache.xerces.dom.DeferredTextImpl cannot be cast to
org.w3c.dom.Element".

Thank you for your support.

Regards,

Juanjo

On Sun, Apr 20, 2008 at 6:12 AM, Freeman Fang <fr...@gmail.com>
wrote:

> Hi Juanjo,
> Good question.
> That's configuration problem.
>
> First of all, since what you use is soap message provider, the provider
> expect the message payload is soap, so you need and useJBIWrapper="false"
> for both your bc and se, this is new feature after servicemix 3.2.1 release,
> so you need use 3.2.2 snapshot. [1] for more details about this
> configuration
> Next,  provider has no explicit SEI (service endpoint interface), all its
> method is  "invoke", so you need specify your targetInterface of your cxf bc
> consumer configuration, not use SEI as usual (since there is no actual SEI
> at all), just use GreeterSoapMessageProvider itself. There is also a little
> tricky here, your package of GreeterSoapMessageProvider is
> demo.hwDispatch.server, so the related namespace of this package should be
> http://server.hwDispatch.demo. You need add a namespace declaration like
> xmlns:myProvider="http://server.hwDispatch.demo" in your configuration
> and then
> specify your cxf bc consumer
> targetInterface="myProvider:GreeterSoapMessageProvider"
>
> All this could make your provider get invoked and you can handle the raw
> soap message there.
>
> [1]
> http://svn.apache.org/repos/asf/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml
>
> Regards
>
> Freeman
>
>
> Juanjo Vázquez wrote:
>
> > Hi,
> >
> > Lately, I have been deploying JAX-WS web services into the ServiceMix
> > CXF-SE
> > component and publishing them with the CXF-BC component. Everything was
> > ok
> > until I tried to deploy a web service in a dispatch/provider style. My
> > goal
> > is to work with message oriented synchronous exchanges between client
> > and
> > server [1].
> >
> > My basic code is the JAX-WS Dispatch/Provider Demo from the CXF
> > distribution
> > [2]. The service unit´s configuration (xbean.xml) is more or less like
> > this:
> >
> > <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
> >
> >    <cxfse:endpoint>
> >        <cxfse:pojo>
> >          <bean class="demo.hwDispatch.server.GreeterSoapMessageProvider"
> > />
> >        </cxfse:pojo>
> >    </cxfse:endpoint>
> >
> > </beans>
> >
> > where GreeterSoapMessageProvider [3] should be the web service
> > implementor.
> >
> > The communication between BC SU and SE SU seems to be ok, but when a
> > client
> > sends a soap message I get a null pointer exception in CXF SE Endpoint
> > (process method). I have debugged and it seems to fault the jbi
> > destination
> > resolution.
> >
> > I don´t know if this is a bug, future improvement or a configuration
> > mistake. Please, any ideas are welcome.
> >
> > Thanks in advance,
> >
> > Juanjo
> >
> > [1] http://cwiki.apache.org/CXF20DOC/provider-services.html
> > [2]
> >
> > http://svn.apache.org/repos/asf/incubator/cxf/tags/cxf-2.0.5-incubator/distribution/src/main/release/samples/jaxws_dispatch_provider
> > [3]
> >
> > http://svn.apache.org/repos/asf/incubator/cxf/tags/cxf-2.0.5-incubator/distribution/src/main/release/samples/jaxws_dispatch_provider/src/demo/hwDispatch/server/GreeterSoapMessageProvider.java
> >
> >
> >
>
>

Re: CXF SE: Error with dispatch/provider web services

Posted by Freeman Fang <fr...@gmail.com>.
Hi Juanjo,
Good question.
That's configuration problem.

First of all, since what you use is soap message provider, the provider 
expect the message payload is soap, so you need and 
useJBIWrapper="false" for both your bc and se, this is new feature after 
servicemix 3.2.1 release, so you need use 3.2.2 snapshot. [1] for more 
details about this configuration
Next,  provider has no explicit SEI (service endpoint interface), all 
its method is  "invoke", so you need specify your targetInterface of 
your cxf bc consumer configuration, not use SEI as usual (since there is 
no actual SEI at all), just use GreeterSoapMessageProvider itself. There 
is also a little tricky here, your package of GreeterSoapMessageProvider 
is demo.hwDispatch.server, so the related namespace of this package 
should be http://server.hwDispatch.demo. You need add a namespace 
declaration like
xmlns:myProvider="http://server.hwDispatch.demo" in your configuration
and then
specify your cxf bc consumer
targetInterface="myProvider:GreeterSoapMessageProvider"

All this could make your provider get invoked and you can handle the raw 
soap message there.

[1]http://svn.apache.org/repos/asf/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/xbean_without_jbi_wrapper.xml

Regards

Freeman

Juanjo Vázquez wrote:
> Hi,
>
> Lately, I have been deploying JAX-WS web services into the ServiceMix CXF-SE
> component and publishing them with the CXF-BC component. Everything was ok
> until I tried to deploy a web service in a dispatch/provider style. My goal
> is to work with message oriented synchronous exchanges between client and
> server [1].
>
> My basic code is the JAX-WS Dispatch/Provider Demo from the CXF distribution
> [2]. The service unit´s configuration (xbean.xml) is more or less like this:
>
> <beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">
>
>     <cxfse:endpoint>
>         <cxfse:pojo>
>           <bean class="demo.hwDispatch.server.GreeterSoapMessageProvider" />
>         </cxfse:pojo>
>     </cxfse:endpoint>
>
> </beans>
>
> where GreeterSoapMessageProvider [3] should be the web service implementor.
>
> The communication between BC SU and SE SU seems to be ok, but when a client
> sends a soap message I get a null pointer exception in CXF SE Endpoint
> (process method). I have debugged and it seems to fault the jbi destination
> resolution.
>
> I don´t know if this is a bug, future improvement or a configuration
> mistake. Please, any ideas are welcome.
>
> Thanks in advance,
>
> Juanjo
>
> [1] http://cwiki.apache.org/CXF20DOC/provider-services.html
> [2]
> http://svn.apache.org/repos/asf/incubator/cxf/tags/cxf-2.0.5-incubator/distribution/src/main/release/samples/jaxws_dispatch_provider
> [3]
> http://svn.apache.org/repos/asf/incubator/cxf/tags/cxf-2.0.5-incubator/distribution/src/main/release/samples/jaxws_dispatch_provider/src/demo/hwDispatch/server/GreeterSoapMessageProvider.java
>
>