You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by John Baker <jo...@camelotgroup.co.uk> on 2012/04/25 12:00:11 UTC

CXF, JMS/AMQP listener

Hello

Is there a CXF component to connect to a JMS or AMQP queue, read messages and validate the SOAP message against the WSDL etc?


John


******************************************************************************
The information contained in this email may be confidential. It is intended
only for the use of the named recipient. If you are not the named recipient
please delete this email and notify the sender of the delivery error. If you
have received this email and are not the named recipient, any disclosure,
reproduction, distribution or other dissemination or use of the information
contained in this email is strictly prohibited.
 
The transmission of email cannot be guaranteed to be secure or error free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, or contain viruses. The sender therefore does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of email transmission. If verification is required please
request a hard copy version.

The Camelot group of companies includes:
Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business Solutions
Limited (reg. no 07553982), Camelot Strategic Solutions Limited (reg. no
07553980), Camelot Global Services Limited (reg. no 02822300) and Camelot
Commercial Services Limited (reg. no 06911097), all of which are registered
in England and Wales and have their registered office at:
Tolpits Lane
Watford
WD18 9RN
Tel : 01923 425000
******************************************************************************

RE: CXF, JMS/AMQP listener

Posted by akuhtz-2 <an...@gmail.com>.
Have you checked Camel?


--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-JMS-AMQP-listener-tp5664383p5664527.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: CXF, JMS/AMQP listener

Posted by John Baker <jo...@camelotgroup.co.uk>.
Could a LocalConduit be used?

-----Original Message-----
From: John Baker [mailto:john.baker@camelotgroup.co.uk] 
Sent: 25 April 2012 12:11
To: users@cxf.apache.org
Subject: RE: CXF, JMS/AMQP listener

I've done that but I'm now missing a SOAP message validation step. Jaxb2marshaller can't do this even if I pull out the body as the namespaces refer to the WSDL.

Is there a CXF component to validate a SOAP message against a WSDL?

-----Original Message-----
From: Alex O'Ree [mailto:spyhunter99@gmail.com]
Sent: 25 April 2012 12:09
To: users@cxf.apache.org
Subject: Re: CXF, JMS/AMQP listener

You could setup a subscriber, then create a jaxb marshaller and attempt to convert it to the expected data type. I don't recall seeing anything built in though, maybe someone else has

On Wed, Apr 25, 2012 at 6:00 AM, John Baker <jo...@camelotgroup.co.uk> wrote:
> Hello
>
> Is there a CXF component to connect to a JMS or AMQP queue, read messages and validate the SOAP message against the WSDL etc?
>
>
> John
>
>
> **********************************************************************
> ******** The information contained in this email may be confidential. 
> It is intended only for the use of the named recipient. If you are not 
> the named recipient please delete this email and notify the sender of 
> the delivery error. If you have received this email and are not the 
> named recipient, any disclosure, reproduction, distribution or other 
> dissemination or use of the information contained in this email is 
> strictly prohibited.
>
> The transmission of email cannot be guaranteed to be secure or error 
> free as information could be intercepted, corrupted, lost, destroyed, 
> arrive late or incomplete, or contain viruses. The sender therefore 
> does not accept liability for any errors or omissions in the contents 
> of this message which arise as a result of email transmission. If 
> verification is required please request a hard copy version.
>
> The Camelot group of companies includes:
> Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business 
> Solutions Limited (reg. no 07553982), Camelot Strategic Solutions 
> Limited (reg. no 07553980), Camelot Global Services Limited (reg. no
> 02822300) and Camelot Commercial Services Limited (reg. no 06911097), 
> all of which are registered in England and Wales and have their registered office at:
> Tolpits Lane
> Watford
> WD18 9RN
> Tel : 01923 425000
> **********************************************************************
> ********

Re: CXF, JMS/AMQP listener

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, April 25, 2012 03:47:52 PM John Baker wrote:
> Oh sorry, I didn't see the end of your mail :)

One "difference", however, is that by the time we get to that code in CXF, 
we have all the Schemas loaded as DOM's and/or XmlSchema object models.   As 
part of the WSDL processing, we resolve all the catalogs and such at that 
point.    Thus, we don't need to deal with the catalogs and such during the 
schema validation things.   You might be able to do similar things.

Actually, you COULD just use CXF for all of that.  Something like:  (using 
CXF 2.6.0, <=2.5.x would be a bit different)

Bus bus = BusFactory.getDefaultBus();
Service service = bus.getExtension(WSDLServiceFactory.class)
        .create(wsdlURL);
Schema s = 
EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0));


The CXF Bus would grab the META-INF/jax-ws-catalog.xml (or you could call:
OASISCatalogManager.getCatalogManager(bus).loadCatalog(url);
to add the catalog), load and process the WSDL and schemas for you, and then 
create the Schema object that you can use for validation.

Dan



> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 25 April 2012 16:32
> To: users@cxf.apache.org
> Cc: John Baker
> Subject: Re: CXF, JMS/AMQP listener
> 
> On Wednesday, April 25, 2012 03:16:43 PM John Baker wrote:
> > That's the problem, I'm not using an endpoint.
> > 
> > I'm reading a message from AMQP, pulling out the body and passing to
> > JAXB. However, the body has WSDL namespaces so I can't let JAXB
> > validate it because it doesn't know what to do with a WSDL.
> > 
> > I've spent some time looking at this and a number of other people are
> > asking the same question on various forums: Surely it's possible to
> > validate a raw SOAP message against a WSDL? But it doesn't seem to be
> > so easy.
> > 
> > I've got as far as pulling out the schema from the WSDL and using a
> > schema validator, but I can't make schema catalogs work with Xerces.
> > 
> > Is there a solution to this in CXF? With the advent of AMQP, I'd
> > expect more people to be pulling messages from RabbitMQ/etc, passing
> > through Spring integrate and wanting to validate them.
> 
> If that's all you are doing, I'd recommend  just using the
> javax.xml.validation.* stuff and avoid the JAXB stuff entirely. 
> Basically, if would fall into the steps:
> 
> 1) Collect all the schemas that you need.  You will need them as streams
> (or readers).   DOM's don't work here.  :-(
> 
> 2) Write a org.w3c.dom.ls.LSResourceResolver that can return those.
> 
> 3) Call something like:
> SchemaFactory factory =
> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
> 
> factory.setResourceResolver(new SchemaLSResourceResolver(..)); schema =
> factory.newSchema(schemas);
> 
> to create the schema.
> 
> 4) Validate with:
> schema.newValidator().validate(new DOMSource(msg));
> 
> 
> The tricky part is obviously #2.    You can look in our code for a
> starting point:
> http://svn.apache.org/repos/asf/cxf/trunk/api/src/main/java/org/apache/cxf
> /wsdl/EndpointReferenceUtils.java
> 
> The LSResourceResolver can use catalogs or whatever to resolve the
> schemas.
> 
> 
> 
> Dan
> 
> > -----Original Message-----
> > From: Daniel Kulp [mailto:dkulp@apache.org]
> > Sent: 25 April 2012 16:13
> > To: users@cxf.apache.org
> > Cc: John Baker
> > Subject: Re: CXF, JMS/AMQP listener
> > 
> > On Wednesday, April 25, 2012 11:10:36 AM John Baker wrote:
> > > I've done that but I'm now missing a SOAP message validation step.
> > > Jaxb2marshaller can't do this even if I pull out the body as the
> > > namespaces refer to the WSDL.
> > > 
> > > Is there a CXF component to validate a SOAP message against a WSDL?
> > 
> > Actually, the JAXB Marshaller/Unmarshaller can do this if you turn it
> > on.
> > By default, we don't have it turned on due to performance impact.
> > However, if you add a property of "schema-validation-enabled" with a
> > value of "true" to the endpoint, then CXF will setup the JAXB
> > (un)marshaller to validate the incoming XML against the wsdl/schema.
> > 
> > Dan
> > 
> > > -----Original Message-----
> > > From: Alex O'Ree [mailto:spyhunter99@gmail.com]
> > > Sent: 25 April 2012 12:09
> > > To: users@cxf.apache.org
> > > Subject: Re: CXF, JMS/AMQP listener
> > > 
> > > You could setup a subscriber, then create a jaxb marshaller and
> > > attempt to convert it to the expected data type. I don't recall
> > > seeing anything built in though, maybe someone else has On Wed, Apr
> > > 25, 2012 at 6:00 AM, John Baker
> > 
> > <jo...@camelotgroup.co.uk> wrote:
> > > > Hello
> > > > 
> > > > Is there a CXF component to connect to a JMS or AMQP queue, read
> > > > messages and validate the SOAP message against the WSDL etc?
> > > > 
> > > > 
> > > > John
> > > > 
> > > > 
> > > > ******************************************************************
> > > > **
> > > > **
> > > > ******** The information contained in this email may be
> > > > confidential.
> > > > It is intended only for the use of the named recipient. If you are
> > > > not the named recipient please delete this email and notify the
> > > > sender of the delivery error. If you have received this email and
> > > > are not the named recipient, any disclosure, reproduction,
> > > > distribution or other dissemination or use of the information
> > > > contained in this email is strictly prohibited.
> > > > 
> > > > The transmission of email cannot be guaranteed to be secure or
> > > > error free as information could be intercepted, corrupted, lost,
> > > > destroyed, arrive late or incomplete, or contain viruses. The
> > > > sender therefore does not accept liability for any errors or
> > > > omissions in the contents of this message which arise as a result
> > > > of email transmission. If verification is required please request
> > > > a hard copy version.
> > > > 
> > > > The Camelot group of companies includes:
> > > > Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business
> > > > Solutions Limited (reg. no 07553982), Camelot Strategic Solutions
> > > > Limited (reg. no 07553980), Camelot Global Services Limited (reg.
> > > > no
> > > > 02822300) and Camelot Commercial Services Limited (reg. no
> > > > 06911097), all of which are registered in England and Wales and
> > > > have their registered office at: Tolpits Lane Watford
> > > > WD18 9RN
> > > > Tel : 01923 425000
> > > > ******************************************************************
> > > > **
> > > > **
> > > > ********
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org - http://dankulp.com/blog Talend Community Coder -
> > http://coders.talend.com
> 
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog Talend Community Coder -
> http://coders.talend.com
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


RE: CXF, JMS/AMQP listener

Posted by John Baker <jo...@camelotgroup.co.uk>.
Oh sorry, I didn't see the end of your mail :) 

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: 25 April 2012 16:32
To: users@cxf.apache.org
Cc: John Baker
Subject: Re: CXF, JMS/AMQP listener

On Wednesday, April 25, 2012 03:16:43 PM John Baker wrote:
> That's the problem, I'm not using an endpoint.
> 
> I'm reading a message from AMQP, pulling out the body and passing to JAXB.
> However, the body has WSDL namespaces so I can't let JAXB validate it 
> because it doesn't know what to do with a WSDL.
> 
> I've spent some time looking at this and a number of other people are 
> asking the same question on various forums: Surely it's possible to 
> validate a raw SOAP message against a WSDL? But it doesn't seem to be 
> so easy.
> 
> I've got as far as pulling out the schema from the WSDL and using a 
> schema validator, but I can't make schema catalogs work with Xerces.
> 
> Is there a solution to this in CXF? With the advent of AMQP, I'd 
> expect more people to be pulling messages from RabbitMQ/etc, passing 
> through Spring integrate and wanting to validate them.

If that's all you are doing, I'd recommend  just using the
javax.xml.validation.* stuff and avoid the JAXB stuff entirely.  Basically, if would fall into the steps:

1) Collect all the schemas that you need.  You will need them as streams (or 
readers).   DOM's don't work here.  :-(   

2) Write a org.w3c.dom.ls.LSResourceResolver that can return those.

3) Call something like:
SchemaFactory factory =   
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

factory.setResourceResolver(new SchemaLSResourceResolver(..)); schema = factory.newSchema(schemas);

to create the schema.   

4) Validate with:
schema.newValidator().validate(new DOMSource(msg));


The tricky part is obviously #2.    You can look in our code for a starting 
point:
http://svn.apache.org/repos/asf/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java

The LSResourceResolver can use catalogs or whatever to resolve the schemas.



Dan




> 
> 
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 25 April 2012 16:13
> To: users@cxf.apache.org
> Cc: John Baker
> Subject: Re: CXF, JMS/AMQP listener
> 
> On Wednesday, April 25, 2012 11:10:36 AM John Baker wrote:
> > I've done that but I'm now missing a SOAP message validation step.
> > Jaxb2marshaller can't do this even if I pull out the body as the 
> > namespaces refer to the WSDL.
> > 
> > Is there a CXF component to validate a SOAP message against a WSDL?
> 
> Actually, the JAXB Marshaller/Unmarshaller can do this if you turn it on.
> By default, we don't have it turned on due to performance impact.  
> However, if you add a property of "schema-validation-enabled" with a 
> value of "true" to the endpoint, then CXF will setup the JAXB 
> (un)marshaller to validate the incoming XML against the wsdl/schema.
> 
> Dan
> 
> > -----Original Message-----
> > From: Alex O'Ree [mailto:spyhunter99@gmail.com]
> > Sent: 25 April 2012 12:09
> > To: users@cxf.apache.org
> > Subject: Re: CXF, JMS/AMQP listener
> > 
> > You could setup a subscriber, then create a jaxb marshaller and 
> > attempt to convert it to the expected data type. I don't recall 
> > seeing anything built in though, maybe someone else has On Wed, Apr 
> > 25, 2012 at 6:00 AM, John Baker
> 
> <jo...@camelotgroup.co.uk> wrote:
> > > Hello
> > > 
> > > Is there a CXF component to connect to a JMS or AMQP queue, read 
> > > messages and validate the SOAP message against the WSDL etc?
> > > 
> > > 
> > > John
> > > 
> > > 
> > > ******************************************************************
> > > **
> > > **
> > > ******** The information contained in this email may be confidential.
> > > It is intended only for the use of the named recipient. If you are 
> > > not the named recipient please delete this email and notify the 
> > > sender of the delivery error. If you have received this email and 
> > > are not the named recipient, any disclosure, reproduction, 
> > > distribution or other dissemination or use of the information 
> > > contained in this email is strictly prohibited.
> > > 
> > > The transmission of email cannot be guaranteed to be secure or 
> > > error free as information could be intercepted, corrupted, lost, 
> > > destroyed, arrive late or incomplete, or contain viruses. The 
> > > sender therefore does not accept liability for any errors or 
> > > omissions in the contents of this message which arise as a result 
> > > of email transmission. If verification is required please request 
> > > a hard copy version.
> > > 
> > > The Camelot group of companies includes:
> > > Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business 
> > > Solutions Limited (reg. no 07553982), Camelot Strategic Solutions 
> > > Limited (reg. no 07553980), Camelot Global Services Limited (reg. 
> > > no
> > > 02822300) and Camelot Commercial Services Limited (reg. no 
> > > 06911097), all of which are registered in England and Wales and 
> > > have their registered office at: Tolpits Lane Watford
> > > WD18 9RN
> > > Tel : 01923 425000
> > > ******************************************************************
> > > **
> > > **
> > > ********
> 
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - 
> http://coders.talend.com
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com


RE: CXF, JMS/AMQP listener

Posted by John Baker <jo...@camelotgroup.co.uk>.
Yes, that's as far as I got but I can't make the catalog/resolver work... Xerces doesn't seem to call the one set on the SchemaFactory.

(Isn't there something in CXF I can copy? It must validate a SOAP message against a WSDL somewhere..?)

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: 25 April 2012 16:32
To: users@cxf.apache.org
Cc: John Baker
Subject: Re: CXF, JMS/AMQP listener

On Wednesday, April 25, 2012 03:16:43 PM John Baker wrote:
> That's the problem, I'm not using an endpoint.
> 
> I'm reading a message from AMQP, pulling out the body and passing to JAXB.
> However, the body has WSDL namespaces so I can't let JAXB validate it 
> because it doesn't know what to do with a WSDL.
> 
> I've spent some time looking at this and a number of other people are 
> asking the same question on various forums: Surely it's possible to 
> validate a raw SOAP message against a WSDL? But it doesn't seem to be 
> so easy.
> 
> I've got as far as pulling out the schema from the WSDL and using a 
> schema validator, but I can't make schema catalogs work with Xerces.
> 
> Is there a solution to this in CXF? With the advent of AMQP, I'd 
> expect more people to be pulling messages from RabbitMQ/etc, passing 
> through Spring integrate and wanting to validate them.

If that's all you are doing, I'd recommend  just using the
javax.xml.validation.* stuff and avoid the JAXB stuff entirely.  Basically, if would fall into the steps:

1) Collect all the schemas that you need.  You will need them as streams (or 
readers).   DOM's don't work here.  :-(   

2) Write a org.w3c.dom.ls.LSResourceResolver that can return those.

3) Call something like:
SchemaFactory factory =   
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

factory.setResourceResolver(new SchemaLSResourceResolver(..)); schema = factory.newSchema(schemas);

to create the schema.   

4) Validate with:
schema.newValidator().validate(new DOMSource(msg));


The tricky part is obviously #2.    You can look in our code for a starting 
point:
http://svn.apache.org/repos/asf/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java

The LSResourceResolver can use catalogs or whatever to resolve the schemas.



Dan




> 
> 
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 25 April 2012 16:13
> To: users@cxf.apache.org
> Cc: John Baker
> Subject: Re: CXF, JMS/AMQP listener
> 
> On Wednesday, April 25, 2012 11:10:36 AM John Baker wrote:
> > I've done that but I'm now missing a SOAP message validation step.
> > Jaxb2marshaller can't do this even if I pull out the body as the 
> > namespaces refer to the WSDL.
> > 
> > Is there a CXF component to validate a SOAP message against a WSDL?
> 
> Actually, the JAXB Marshaller/Unmarshaller can do this if you turn it on.
> By default, we don't have it turned on due to performance impact.  
> However, if you add a property of "schema-validation-enabled" with a 
> value of "true" to the endpoint, then CXF will setup the JAXB 
> (un)marshaller to validate the incoming XML against the wsdl/schema.
> 
> Dan
> 
> > -----Original Message-----
> > From: Alex O'Ree [mailto:spyhunter99@gmail.com]
> > Sent: 25 April 2012 12:09
> > To: users@cxf.apache.org
> > Subject: Re: CXF, JMS/AMQP listener
> > 
> > You could setup a subscriber, then create a jaxb marshaller and 
> > attempt to convert it to the expected data type. I don't recall 
> > seeing anything built in though, maybe someone else has On Wed, Apr 
> > 25, 2012 at 6:00 AM, John Baker
> 
> <jo...@camelotgroup.co.uk> wrote:
> > > Hello
> > > 
> > > Is there a CXF component to connect to a JMS or AMQP queue, read 
> > > messages and validate the SOAP message against the WSDL etc?
> > > 
> > > 
> > > John
> > > 
> > > 
> > > ******************************************************************
> > > **
> > > **
> > > ******** The information contained in this email may be confidential.
> > > It is intended only for the use of the named recipient. If you are 
> > > not the named recipient please delete this email and notify the 
> > > sender of the delivery error. If you have received this email and 
> > > are not the named recipient, any disclosure, reproduction, 
> > > distribution or other dissemination or use of the information 
> > > contained in this email is strictly prohibited.
> > > 
> > > The transmission of email cannot be guaranteed to be secure or 
> > > error free as information could be intercepted, corrupted, lost, 
> > > destroyed, arrive late or incomplete, or contain viruses. The 
> > > sender therefore does not accept liability for any errors or 
> > > omissions in the contents of this message which arise as a result 
> > > of email transmission. If verification is required please request 
> > > a hard copy version.
> > > 
> > > The Camelot group of companies includes:
> > > Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business 
> > > Solutions Limited (reg. no 07553982), Camelot Strategic Solutions 
> > > Limited (reg. no 07553980), Camelot Global Services Limited (reg. 
> > > no
> > > 02822300) and Camelot Commercial Services Limited (reg. no 
> > > 06911097), all of which are registered in England and Wales and 
> > > have their registered office at: Tolpits Lane Watford
> > > WD18 9RN
> > > Tel : 01923 425000
> > > ******************************************************************
> > > **
> > > **
> > > ********
> 
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - 
> http://coders.talend.com
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com


Re: CXF, JMS/AMQP listener

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, April 25, 2012 03:16:43 PM John Baker wrote:
> That's the problem, I'm not using an endpoint.
> 
> I'm reading a message from AMQP, pulling out the body and passing to JAXB.
> However, the body has WSDL namespaces so I can't let JAXB validate it
> because it doesn't know what to do with a WSDL.
> 
> I've spent some time looking at this and a number of other people are
> asking the same question on various forums: Surely it's possible to
> validate a raw SOAP message against a WSDL? But it doesn't seem to be so
> easy.
> 
> I've got as far as pulling out the schema from the WSDL and using a schema
> validator, but I can't make schema catalogs work with Xerces.
> 
> Is there a solution to this in CXF? With the advent of AMQP, I'd expect
> more people to be pulling messages from RabbitMQ/etc, passing through
> Spring integrate and wanting to validate them.

If that's all you are doing, I'd recommend  just using the 
javax.xml.validation.* stuff and avoid the JAXB stuff entirely.  Basically, 
if would fall into the steps:

1) Collect all the schemas that you need.  You will need them as streams (or 
readers).   DOM's don't work here.  :-(   

2) Write a org.w3c.dom.ls.LSResourceResolver that can return those.

3) Call something like:
SchemaFactory factory =   
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);

factory.setResourceResolver(new SchemaLSResourceResolver(..));
schema = factory.newSchema(schemas);

to create the schema.   

4) Validate with:
schema.newValidator().validate(new DOMSource(msg));


The tricky part is obviously #2.    You can look in our code for a starting 
point:
http://svn.apache.org/repos/asf/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java

The LSResourceResolver can use catalogs or whatever to resolve the schemas.



Dan




> 
> 
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 25 April 2012 16:13
> To: users@cxf.apache.org
> Cc: John Baker
> Subject: Re: CXF, JMS/AMQP listener
> 
> On Wednesday, April 25, 2012 11:10:36 AM John Baker wrote:
> > I've done that but I'm now missing a SOAP message validation step.
> > Jaxb2marshaller can't do this even if I pull out the body as the
> > namespaces refer to the WSDL.
> > 
> > Is there a CXF component to validate a SOAP message against a WSDL?
> 
> Actually, the JAXB Marshaller/Unmarshaller can do this if you turn it on.
> By default, we don't have it turned on due to performance impact.  
> However, if you add a property of "schema-validation-enabled" with a
> value of "true" to the endpoint, then CXF will setup the JAXB
> (un)marshaller to validate the incoming XML against the wsdl/schema.
> 
> Dan
> 
> > -----Original Message-----
> > From: Alex O'Ree [mailto:spyhunter99@gmail.com]
> > Sent: 25 April 2012 12:09
> > To: users@cxf.apache.org
> > Subject: Re: CXF, JMS/AMQP listener
> > 
> > You could setup a subscriber, then create a jaxb marshaller and
> > attempt to convert it to the expected data type. I don't recall seeing
> > anything built in though, maybe someone else has On Wed, Apr 25, 2012
> > at 6:00 AM, John Baker
> 
> <jo...@camelotgroup.co.uk> wrote:
> > > Hello
> > > 
> > > Is there a CXF component to connect to a JMS or AMQP queue, read
> > > messages and validate the SOAP message against the WSDL etc?
> > > 
> > > 
> > > John
> > > 
> > > 
> > > ********************************************************************
> > > **
> > > ******** The information contained in this email may be confidential.
> > > It is intended only for the use of the named recipient. If you are
> > > not the named recipient please delete this email and notify the
> > > sender of the delivery error. If you have received this email and
> > > are not the named recipient, any disclosure, reproduction,
> > > distribution or other dissemination or use of the information
> > > contained in this email is strictly prohibited.
> > > 
> > > The transmission of email cannot be guaranteed to be secure or error
> > > free as information could be intercepted, corrupted, lost,
> > > destroyed, arrive late or incomplete, or contain viruses. The sender
> > > therefore does not accept liability for any errors or omissions in
> > > the contents of this message which arise as a result of email
> > > transmission. If verification is required please request a hard copy
> > > version.
> > > 
> > > The Camelot group of companies includes:
> > > Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business
> > > Solutions Limited (reg. no 07553982), Camelot Strategic Solutions
> > > Limited (reg. no 07553980), Camelot Global Services Limited (reg. no
> > > 02822300) and Camelot Commercial Services Limited (reg. no
> > > 06911097), all of which are registered in England and Wales and have
> > > their registered office at: Tolpits Lane Watford
> > > WD18 9RN
> > > Tel : 01923 425000
> > > ********************************************************************
> > > **
> > > ********
> 
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog Talend Community Coder -
> http://coders.talend.com
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


RE: CXF, JMS/AMQP listener

Posted by John Baker <jo...@camelotgroup.co.uk>.
That's the problem, I'm not using an endpoint.

I'm reading a message from AMQP, pulling out the body and passing to JAXB. However, the body has WSDL namespaces so I can't let JAXB validate it because it doesn't know what to do with a WSDL. 

I've spent some time looking at this and a number of other people are asking the same question on various forums: Surely it's possible to validate a raw SOAP message against a WSDL? But it doesn't seem to be so easy. 

I've got as far as pulling out the schema from the WSDL and using a schema validator, but I can't make schema catalogs work with Xerces.

Is there a solution to this in CXF? With the advent of AMQP, I'd expect more people to be pulling messages from RabbitMQ/etc, passing through Spring integrate and wanting to validate them.



-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: 25 April 2012 16:13
To: users@cxf.apache.org
Cc: John Baker
Subject: Re: CXF, JMS/AMQP listener

On Wednesday, April 25, 2012 11:10:36 AM John Baker wrote:
> I've done that but I'm now missing a SOAP message validation step.
> Jaxb2marshaller can't do this even if I pull out the body as the 
> namespaces refer to the WSDL.
> 
> Is there a CXF component to validate a SOAP message against a WSDL?

Actually, the JAXB Marshaller/Unmarshaller can do this if you turn it on.   
By default, we don't have it turned on due to performance impact.   However, 
if you add a property of "schema-validation-enabled" with a value of "true" 
to the endpoint, then CXF will setup the JAXB (un)marshaller to validate the incoming XML against the wsdl/schema.

Dan



> 
> -----Original Message-----
> From: Alex O'Ree [mailto:spyhunter99@gmail.com]
> Sent: 25 April 2012 12:09
> To: users@cxf.apache.org
> Subject: Re: CXF, JMS/AMQP listener
> 
> You could setup a subscriber, then create a jaxb marshaller and 
> attempt to convert it to the expected data type. I don't recall seeing 
> anything built in though, maybe someone else has On Wed, Apr 25, 2012 
> at 6:00 AM, John Baker
<jo...@camelotgroup.co.uk> wrote:
> > Hello
> > 
> > Is there a CXF component to connect to a JMS or AMQP queue, read 
> > messages and validate the SOAP message against the WSDL etc?
> > 
> > 
> > John
> > 
> > 
> > ********************************************************************
> > **
> > ******** The information contained in this email may be confidential.
> > It is intended only for the use of the named recipient. If you are 
> > not the named recipient please delete this email and notify the 
> > sender of the delivery error. If you have received this email and 
> > are not the named recipient, any disclosure, reproduction, 
> > distribution or other dissemination or use of the information 
> > contained in this email is strictly prohibited.
> > 
> > The transmission of email cannot be guaranteed to be secure or error 
> > free as information could be intercepted, corrupted, lost, 
> > destroyed, arrive late or incomplete, or contain viruses. The sender 
> > therefore does not accept liability for any errors or omissions in 
> > the contents of this message which arise as a result of email 
> > transmission. If verification is required please request a hard copy version.
> > 
> > The Camelot group of companies includes:
> > Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business 
> > Solutions Limited (reg. no 07553982), Camelot Strategic Solutions 
> > Limited (reg. no 07553980), Camelot Global Services Limited (reg. no
> > 02822300) and Camelot Commercial Services Limited (reg. no 
> > 06911097), all of which are registered in England and Wales and have 
> > their registered office at: Tolpits Lane Watford
> > WD18 9RN
> > Tel : 01923 425000
> > ********************************************************************
> > **
> > ********
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com


Re: CXF, JMS/AMQP listener

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, April 25, 2012 11:10:36 AM John Baker wrote:
> I've done that but I'm now missing a SOAP message validation step.
> Jaxb2marshaller can't do this even if I pull out the body as the
> namespaces refer to the WSDL.
> 
> Is there a CXF component to validate a SOAP message against a WSDL?

Actually, the JAXB Marshaller/Unmarshaller can do this if you turn it on.   
By default, we don't have it turned on due to performance impact.   However, 
if you add a property of "schema-validation-enabled" with a value of "true" 
to the endpoint, then CXF will setup the JAXB (un)marshaller to validate the 
incoming XML against the wsdl/schema.

Dan



> 
> -----Original Message-----
> From: Alex O'Ree [mailto:spyhunter99@gmail.com]
> Sent: 25 April 2012 12:09
> To: users@cxf.apache.org
> Subject: Re: CXF, JMS/AMQP listener
> 
> You could setup a subscriber, then create a jaxb marshaller and attempt to
> convert it to the expected data type. I don't recall seeing anything
> built in though, maybe someone else has
> On Wed, Apr 25, 2012 at 6:00 AM, John Baker 
<jo...@camelotgroup.co.uk> wrote:
> > Hello
> > 
> > Is there a CXF component to connect to a JMS or AMQP queue, read
> > messages and validate the SOAP message against the WSDL etc?
> > 
> > 
> > John
> > 
> > 
> > **********************************************************************
> > ******** The information contained in this email may be confidential.
> > It is intended only for the use of the named recipient. If you are not
> > the named recipient please delete this email and notify the sender of
> > the delivery error. If you have received this email and are not the
> > named recipient, any disclosure, reproduction, distribution or other
> > dissemination or use of the information contained in this email is
> > strictly prohibited.
> > 
> > The transmission of email cannot be guaranteed to be secure or error
> > free as information could be intercepted, corrupted, lost, destroyed,
> > arrive late or incomplete, or contain viruses. The sender therefore
> > does not accept liability for any errors or omissions in the contents
> > of this message which arise as a result of email transmission. If
> > verification is required please request a hard copy version.
> > 
> > The Camelot group of companies includes:
> > Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business
> > Solutions Limited (reg. no 07553982), Camelot Strategic Solutions
> > Limited (reg. no 07553980), Camelot Global Services Limited (reg. no
> > 02822300) and Camelot Commercial Services Limited (reg. no 06911097),
> > all of which are registered in England and Wales and have their
> > registered office at: Tolpits Lane
> > Watford
> > WD18 9RN
> > Tel : 01923 425000
> > **********************************************************************
> > ********
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


RE: CXF, JMS/AMQP listener

Posted by John Baker <jo...@camelotgroup.co.uk>.
I've done that but I'm now missing a SOAP message validation step. Jaxb2marshaller can't do this even if I pull out the body as the namespaces refer to the WSDL.

Is there a CXF component to validate a SOAP message against a WSDL?

-----Original Message-----
From: Alex O'Ree [mailto:spyhunter99@gmail.com] 
Sent: 25 April 2012 12:09
To: users@cxf.apache.org
Subject: Re: CXF, JMS/AMQP listener

You could setup a subscriber, then create a jaxb marshaller and attempt to convert it to the expected data type. I don't recall seeing anything built in though, maybe someone else has

On Wed, Apr 25, 2012 at 6:00 AM, John Baker <jo...@camelotgroup.co.uk> wrote:
> Hello
>
> Is there a CXF component to connect to a JMS or AMQP queue, read messages and validate the SOAP message against the WSDL etc?
>
>
> John
>
>
> **********************************************************************
> ******** The information contained in this email may be confidential. 
> It is intended only for the use of the named recipient. If you are not 
> the named recipient please delete this email and notify the sender of 
> the delivery error. If you have received this email and are not the 
> named recipient, any disclosure, reproduction, distribution or other 
> dissemination or use of the information contained in this email is 
> strictly prohibited.
>
> The transmission of email cannot be guaranteed to be secure or error 
> free as information could be intercepted, corrupted, lost, destroyed, 
> arrive late or incomplete, or contain viruses. The sender therefore 
> does not accept liability for any errors or omissions in the contents 
> of this message which arise as a result of email transmission. If 
> verification is required please request a hard copy version.
>
> The Camelot group of companies includes:
> Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business 
> Solutions Limited (reg. no 07553982), Camelot Strategic Solutions 
> Limited (reg. no 07553980), Camelot Global Services Limited (reg. no 
> 02822300) and Camelot Commercial Services Limited (reg. no 06911097), 
> all of which are registered in England and Wales and have their registered office at:
> Tolpits Lane
> Watford
> WD18 9RN
> Tel : 01923 425000
> **********************************************************************
> ********

Re: CXF, JMS/AMQP listener

Posted by Alex O'Ree <sp...@gmail.com>.
You could setup a subscriber, then create a jaxb marshaller and
attempt to convert it to the expected data type. I don't recall seeing
anything built in though, maybe someone else has

On Wed, Apr 25, 2012 at 6:00 AM, John Baker
<jo...@camelotgroup.co.uk> wrote:
> Hello
>
> Is there a CXF component to connect to a JMS or AMQP queue, read messages and validate the SOAP message against the WSDL etc?
>
>
> John
>
>
> ******************************************************************************
> The information contained in this email may be confidential. It is intended
> only for the use of the named recipient. If you are not the named recipient
> please delete this email and notify the sender of the delivery error. If you
> have received this email and are not the named recipient, any disclosure,
> reproduction, distribution or other dissemination or use of the information
> contained in this email is strictly prohibited.
>
> The transmission of email cannot be guaranteed to be secure or error free as
> information could be intercepted, corrupted, lost, destroyed, arrive late or
> incomplete, or contain viruses. The sender therefore does not accept
> liability for any errors or omissions in the contents of this message which
> arise as a result of email transmission. If verification is required please
> request a hard copy version.
>
> The Camelot group of companies includes:
> Camelot UK Lotteries Limited (reg. no 2822203), Camelot Business Solutions
> Limited (reg. no 07553982), Camelot Strategic Solutions Limited (reg. no
> 07553980), Camelot Global Services Limited (reg. no 02822300) and Camelot
> Commercial Services Limited (reg. no 06911097), all of which are registered
> in England and Wales and have their registered office at:
> Tolpits Lane
> Watford
> WD18 9RN
> Tel : 01923 425000
> ******************************************************************************