CXF Question

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

CXF Question

Castyn
I have a CXF bean setup for a route that listens for incoming messages on a jetty port.  The data format of the bean is in MESSAGE mode.  My question is this, if someone sends an invalid message (whether it is malformed XML, improper types, etc), will the <to uri="cxf:bean:initiateService"/> be the component that actually creates the soap fault, or will it try to send it to the CXF endpoint address regardless of format?

Basically I am trying to get the cxf bean to filter off all improper or malformed request messages before sending to the cxf endpoint address.
Reply | Threaded
Open this post in threaded view
|

Re: CXF Question

Willem.Jiang
Administrator
No, if you are using MESSAGE dataformat, you just reuse the CXF
transport, it doesn't read any conent of message.
PAYLOAD and POJO dataformat can do the work that you want.

On Thu Feb 16 03:46:34 2012, Castyn wrote:

> I have a CXF bean setup for a route that listens for incoming messages on a
> jetty port.  The data format of the bean is in MESSAGE mode.  My question is
> this, if someone sends an invalid message (whether it is malformed XML,
> improper types, etc), will the<to uri="cxf:bean:initiateService"/>  be the
> component that actually creates the soap fault, or will it try to send it to
> the CXF endpoint address regardless of format?
>
> Basically I am trying to get the cxf bean to filter off all improper or
> malformed request messages before sending to the cxf endpoint address.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-Question-tp5487172p5487172.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Reply | Threaded
Open this post in threaded view
|

Re: CXF Question

Castyn
Makes sense, what would I have to do to use POJO format for a message being read in on a jetty port?  Currently I just read the message off of the port, convert to a string, check a couple attributes through the spring DSL, and then send it to the CXF endpoint.
Reply | Threaded
Open this post in threaded view
|

Re: CXF Question

Castyn
I guess really the question is how do you go about using the jaxb component to properly do this?  Or is there an example somewhere that shows this within spring to marshal and incoming message and send it to a POJO cxf endpoint?
Reply | Threaded
Open this post in threaded view
|

Re: CXF Question

Willem.Jiang
Administrator
It really dependents on what's you have.
If you already has soap message, you can use camel-http or camel-cxf
MESSAGE dataforate to send the message to the client.

camel-cxf POJO dataformate can consume the SOAP message directly and
trun it into a method invocation parameters.

You may find some example by go through the wiki page of camel-cxf[1]

[1]http://camel.apache.org/cxf.html

On Fri Feb 17 03:52:04 2012, Castyn wrote:
> I guess really the question is how do you go about using the jaxb component
> to properly do this?  Or is there an example somewhere that shows this
> within spring to marshal and incoming message and send it to a POJO cxf
> endpoint?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-Question-tp5487172p5490556.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Reply | Threaded
Open this post in threaded view
|

Re: CXF Question

Castyn
I have it working in MESSAGE format already, but I wanted the cxf endpoint to do some validating on data types and message format before ever sending it to the actual cxf address (another server)

What is the best way to do this?  I have a webservice with a WSDL deployed as a camel cxf component that I can route to, but I want to ensure the message is valid in structure and datatypes before ever sending the request over the wire to the webservice.  The messages come in on a jetty port and pretty much just get forwarded to the cxf component.

I have tried setting the cxf component to pojo and then unmarshelling, calling the cxf component, and marshelling the results but that has been problematic thus far on the unmarshel.

Basically the camel route serves as a middle man for one system to call another system's web service, but I want to do as much error handling as I can before I hit the server.
Reply | Threaded
Open this post in threaded view
|

Re: CXF Question

Castyn
Just to help understanding, here is basically what I am doing, catching an incoming request on a jetty port, log the message, route to cxf component, log the response.  How do I leverage the cxf endpoint to validate?  Like I said currently it is in MESSAGE dataformat so that is not happening, but when switching to POJO mode it throws interceptor errors.

Route wrote
<route id="JavelinSalesforceService">
 <from uri="jetty:http://0.0.0.0:9191/JavelinSalesforceService" />
 <convertBodyTo type="String" />
 <to uri="file:data/salesforce/request"/>
 <to uri="cxf:bean:salesforceEnterpriseAPI"/>
 <convertBodyTo type="String" />
 <to uri="file:data/salesforce/response"/>
</route>

CXF Bean wrote
        <cxf:cxfEndpoint
                id="salesforceEnterpriseAPI"
                address="${sforce.api.address}"
                wsdlURL="wsdl/sfdc.wsdl"
                serviceClass="com.sforce.soap.enterprise.Soap"
                serviceName="s:SforceService"
                endpointName="s:Soap"
                xmlns:s="urn:enterprise.soap.sforce.com">
                <cxf:properties>
                        <entry key="dataFormat" value="MESSAGE"/>
                </cxf:properties>               
        </cxf:cxfEndpoint>