You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by moraleslos <mo...@hotmail.com> on 2007/09/18 15:49:02 UTC

contract-first with only xsd

Hi--

Having gone through the Spring Web Services (SWS) manifesto about
contract-first as well as their sample examples, I wonder how CXF matches up
with SWS.  I know that CXF allows contract-first development, but is it as
simple as SWS?  For example, with SWS, all I need to do is define the XSD
for my types (the messages and such being passed or returned).  I can then
have SWS generate the WSDL using basic conventions and the XSDs defined. The
only other thing to do is to implement the endpoints (Java) that will handle
the service.  From looking through the CXF site, it looks that if you do
contract-first, you must define the WSDL along with the XSDs and Java
service implementations (probably using JSR-181).  Is this the case?  

Thanks in advance!

-los
-- 
View this message in context: http://www.nabble.com/contract-first-with-only-xsd-tf4474467.html#a12757416
Sent from the cxf-user mailing list archive at Nabble.com.


Re: contract-first with only xsd

Posted by James Mao <ja...@iona.com>.
moraleslos wrote:
> Hi--
>
> Having gone through the Spring Web Services (SWS) manifesto about
> contract-first as well as their sample examples, I wonder how CXF matches up
> with SWS.  I know that CXF allows contract-first development, but is it as
> simple as SWS?  For example, with SWS, all I need to do is define the XSD
> for my types (the messages and such being passed or returned).  I can then
> have SWS generate the WSDL using basic conventions and the XSDs defined. 

You are looking for xsd2wsdl tools in CXF,
alone with the wsdl2soap, you can add the soap binding , you can add xml 
binding with wsdl2xml

> The
> only other thing to do is to implement the endpoints (Java) that will handle
> the service.  

This can be done in wsdl2java, we also generate the ant build file, so 
pretty much a jaxws project
CXF tools is a pluggable framework, the default frontend is jaxws, and 
default dababinding is jaxb,

Hope this answer your question.

Regards,
James

> From looking through the CXF site, it looks that if you do
> contract-first, you must define the WSDL along with the XSDs and Java
> service implementations (probably using JSR-181).  Is this the case?  
>
> Thanks in advance!
>
> -los
>   

RE: contract-first with only xsd

Posted by Jean-François Daune <jf...@cigersoft.be>.
This is what we do too.

Generate mapping code from XSD using JAXB, then create endpoints using those stubs as argument/return value.

You end up controlling the payload of your SOAP requests, which is what is important.

Cheers,

J-F

-----Message d'origine-----
De : Eric Miles [mailto:eric.miles@kronos.com]
Envoyé : mardi 18 septembre 2007 16:00
À : cxf-user@incubator.apache.org
Objet : Re: contract-first with only xsd


Los,

It is just as easy to define contract first, without having to create a
WSDL.  For our project, we create our XSDs, generate stubs with JAXB,
create our endpoint implementations (we use annotations), and wire it
all up with Spring.  CXF takes care of the WSDL generation.  It really
is easy.  I'm not sure there is an example within the CXF toolkit but I
could probably come up with one fairly fast if you need one.

Eric



On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> Hi--
> 
> Having gone through the Spring Web Services (SWS) manifesto about
> contract-first as well as their sample examples, I wonder how CXF matches up
> with SWS.  I know that CXF allows contract-first development, but is it as
> simple as SWS?  For example, with SWS, all I need to do is define the XSD
> for my types (the messages and such being passed or returned).  I can then
> have SWS generate the WSDL using basic conventions and the XSDs defined. The
> only other thing to do is to implement the endpoints (Java) that will handle
> the service.  From looking through the CXF site, it looks that if you do
> contract-first, you must define the WSDL along with the XSDs and Java
> service implementations (probably using JSR-181).  Is this the case?  
> 
> Thanks in advance!
> 
> -los

RE: contract-first with only xsd

Posted by "Mulligan, Patrick" <Pa...@iona.com>.
On the service endpoints.  As I understand it, the annotations on the
classes are mainly done by the compiler from the XSD?  I suppose you can
"tweak" them as well for runtime stuff.

I am exploring the code-first approaches.  Like when I use a tool to go
from IDL as a starting point, it generates the complete wsdl, and then I
go from there.  I was thinking perhaps there was tooling that would suck
in your classes, and spit everything out, jaxb, endpoint stuff, etc.

I normally go from WSDL first, so I don't really know the other aspects.

-----Original Message-----
From: Eric Miles [mailto:eric.miles@kronos.com] 
Sent: Tuesday, September 18, 2007 10:45 AM
To: cxf-user@incubator.apache.org
Subject: RE: contract-first with only xsd

Are you talking about the annotations on your JAXB stubs?  Or on your
service endpoints?

FWIW, we're not using JaxMe, we're using the JAXB2 maven plugin from
dev.java.net:

https://maven-jaxb2-plugin.dev.java.net/


On Tue, 2007-09-18 at 10:25 -0400, Mulligan, Patrick wrote:
> I suppose that would be using the JaxMe plugin.
> 
> I see there are other toolkits as well to do this.  Anyone care to
> comment on those?
> 
> I guess I was wondering if there was a tool to take the type info, the
> annotations, etc, all in one shot?
> 
> -----Original Message-----
> From: Eric Miles [mailto:eric.miles@kronos.com] 
> Sent: Tuesday, September 18, 2007 10:18 AM
> To: cxf-user@incubator.apache.org
> Subject: RE: contract-first with only xsd
> 
> We're using the Maven2 JAXB plugin.  You need stubs for the schema to
> manipulate the objects within your endpoint implementation.
> 
> 
> 
> On Tue, 2007-09-18 at 10:05 -0400, Mulligan, Patrick wrote:
> > What are you using to generate the jaxb stubs?  
> > 
> > Can't the annotations drive it all?
> > 
> > -----Original Message-----
> > From: Eric Miles [mailto:eric.miles@kronos.com] 
> > Sent: Tuesday, September 18, 2007 10:00 AM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: contract-first with only xsd
> > 
> > Los,
> > 
> > It is just as easy to define contract first, without having to
create
> a
> > WSDL.  For our project, we create our XSDs, generate stubs with
JAXB,
> > create our endpoint implementations (we use annotations), and wire
it
> > all up with Spring.  CXF takes care of the WSDL generation.  It
really
> > is easy.  I'm not sure there is an example within the CXF toolkit
but
> I
> > could probably come up with one fairly fast if you need one.
> > 
> > Eric
> > 
> > 
> > 
> > On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> > > Hi--
> > > 
> > > Having gone through the Spring Web Services (SWS) manifesto about
> > > contract-first as well as their sample examples, I wonder how CXF
> > matches up
> > > with SWS.  I know that CXF allows contract-first development, but
is
> > it as
> > > simple as SWS?  For example, with SWS, all I need to do is define
> the
> > XSD
> > > for my types (the messages and such being passed or returned).  I
> can
> > then
> > > have SWS generate the WSDL using basic conventions and the XSDs
> > defined. The
> > > only other thing to do is to implement the endpoints (Java) that
> will
> > handle
> > > the service.  From looking through the CXF site, it looks that if
> you
> > do
> > > contract-first, you must define the WSDL along with the XSDs and
> Java
> > > service implementations (probably using JSR-181).  Is this the
case?
> 
> > > 
> > > Thanks in advance!
> > > 
> > > -los

RE: contract-first with only xsd

Posted by Eric Miles <er...@kronos.com>.
Are you talking about the annotations on your JAXB stubs?  Or on your
service endpoints?

FWIW, we're not using JaxMe, we're using the JAXB2 maven plugin from
dev.java.net:

https://maven-jaxb2-plugin.dev.java.net/


On Tue, 2007-09-18 at 10:25 -0400, Mulligan, Patrick wrote:
> I suppose that would be using the JaxMe plugin.
> 
> I see there are other toolkits as well to do this.  Anyone care to
> comment on those?
> 
> I guess I was wondering if there was a tool to take the type info, the
> annotations, etc, all in one shot?
> 
> -----Original Message-----
> From: Eric Miles [mailto:eric.miles@kronos.com] 
> Sent: Tuesday, September 18, 2007 10:18 AM
> To: cxf-user@incubator.apache.org
> Subject: RE: contract-first with only xsd
> 
> We're using the Maven2 JAXB plugin.  You need stubs for the schema to
> manipulate the objects within your endpoint implementation.
> 
> 
> 
> On Tue, 2007-09-18 at 10:05 -0400, Mulligan, Patrick wrote:
> > What are you using to generate the jaxb stubs?  
> > 
> > Can't the annotations drive it all?
> > 
> > -----Original Message-----
> > From: Eric Miles [mailto:eric.miles@kronos.com] 
> > Sent: Tuesday, September 18, 2007 10:00 AM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: contract-first with only xsd
> > 
> > Los,
> > 
> > It is just as easy to define contract first, without having to create
> a
> > WSDL.  For our project, we create our XSDs, generate stubs with JAXB,
> > create our endpoint implementations (we use annotations), and wire it
> > all up with Spring.  CXF takes care of the WSDL generation.  It really
> > is easy.  I'm not sure there is an example within the CXF toolkit but
> I
> > could probably come up with one fairly fast if you need one.
> > 
> > Eric
> > 
> > 
> > 
> > On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> > > Hi--
> > > 
> > > Having gone through the Spring Web Services (SWS) manifesto about
> > > contract-first as well as their sample examples, I wonder how CXF
> > matches up
> > > with SWS.  I know that CXF allows contract-first development, but is
> > it as
> > > simple as SWS?  For example, with SWS, all I need to do is define
> the
> > XSD
> > > for my types (the messages and such being passed or returned).  I
> can
> > then
> > > have SWS generate the WSDL using basic conventions and the XSDs
> > defined. The
> > > only other thing to do is to implement the endpoints (Java) that
> will
> > handle
> > > the service.  From looking through the CXF site, it looks that if
> you
> > do
> > > contract-first, you must define the WSDL along with the XSDs and
> Java
> > > service implementations (probably using JSR-181).  Is this the case?
> 
> > > 
> > > Thanks in advance!
> > > 
> > > -los

RE: contract-first with only xsd

Posted by "Mulligan, Patrick" <Pa...@iona.com>.
I suppose that would be using the JaxMe plugin.

I see there are other toolkits as well to do this.  Anyone care to
comment on those?

I guess I was wondering if there was a tool to take the type info, the
annotations, etc, all in one shot?

-----Original Message-----
From: Eric Miles [mailto:eric.miles@kronos.com] 
Sent: Tuesday, September 18, 2007 10:18 AM
To: cxf-user@incubator.apache.org
Subject: RE: contract-first with only xsd

We're using the Maven2 JAXB plugin.  You need stubs for the schema to
manipulate the objects within your endpoint implementation.



On Tue, 2007-09-18 at 10:05 -0400, Mulligan, Patrick wrote:
> What are you using to generate the jaxb stubs?  
> 
> Can't the annotations drive it all?
> 
> -----Original Message-----
> From: Eric Miles [mailto:eric.miles@kronos.com] 
> Sent: Tuesday, September 18, 2007 10:00 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: contract-first with only xsd
> 
> Los,
> 
> It is just as easy to define contract first, without having to create
a
> WSDL.  For our project, we create our XSDs, generate stubs with JAXB,
> create our endpoint implementations (we use annotations), and wire it
> all up with Spring.  CXF takes care of the WSDL generation.  It really
> is easy.  I'm not sure there is an example within the CXF toolkit but
I
> could probably come up with one fairly fast if you need one.
> 
> Eric
> 
> 
> 
> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> > Hi--
> > 
> > Having gone through the Spring Web Services (SWS) manifesto about
> > contract-first as well as their sample examples, I wonder how CXF
> matches up
> > with SWS.  I know that CXF allows contract-first development, but is
> it as
> > simple as SWS?  For example, with SWS, all I need to do is define
the
> XSD
> > for my types (the messages and such being passed or returned).  I
can
> then
> > have SWS generate the WSDL using basic conventions and the XSDs
> defined. The
> > only other thing to do is to implement the endpoints (Java) that
will
> handle
> > the service.  From looking through the CXF site, it looks that if
you
> do
> > contract-first, you must define the WSDL along with the XSDs and
Java
> > service implementations (probably using JSR-181).  Is this the case?

> > 
> > Thanks in advance!
> > 
> > -los

RE: contract-first with only xsd

Posted by Eric Miles <er...@kronos.com>.
We're using the Maven2 JAXB plugin.  You need stubs for the schema to
manipulate the objects within your endpoint implementation.



On Tue, 2007-09-18 at 10:05 -0400, Mulligan, Patrick wrote:
> What are you using to generate the jaxb stubs?  
> 
> Can't the annotations drive it all?
> 
> -----Original Message-----
> From: Eric Miles [mailto:eric.miles@kronos.com] 
> Sent: Tuesday, September 18, 2007 10:00 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: contract-first with only xsd
> 
> Los,
> 
> It is just as easy to define contract first, without having to create a
> WSDL.  For our project, we create our XSDs, generate stubs with JAXB,
> create our endpoint implementations (we use annotations), and wire it
> all up with Spring.  CXF takes care of the WSDL generation.  It really
> is easy.  I'm not sure there is an example within the CXF toolkit but I
> could probably come up with one fairly fast if you need one.
> 
> Eric
> 
> 
> 
> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> > Hi--
> > 
> > Having gone through the Spring Web Services (SWS) manifesto about
> > contract-first as well as their sample examples, I wonder how CXF
> matches up
> > with SWS.  I know that CXF allows contract-first development, but is
> it as
> > simple as SWS?  For example, with SWS, all I need to do is define the
> XSD
> > for my types (the messages and such being passed or returned).  I can
> then
> > have SWS generate the WSDL using basic conventions and the XSDs
> defined. The
> > only other thing to do is to implement the endpoints (Java) that will
> handle
> > the service.  From looking through the CXF site, it looks that if you
> do
> > contract-first, you must define the WSDL along with the XSDs and Java
> > service implementations (probably using JSR-181).  Is this the case?  
> > 
> > Thanks in advance!
> > 
> > -los

RE: contract-first with only xsd

Posted by "Mulligan, Patrick" <Pa...@iona.com>.
What are you using to generate the jaxb stubs?  

Can't the annotations drive it all?

-----Original Message-----
From: Eric Miles [mailto:eric.miles@kronos.com] 
Sent: Tuesday, September 18, 2007 10:00 AM
To: cxf-user@incubator.apache.org
Subject: Re: contract-first with only xsd

Los,

It is just as easy to define contract first, without having to create a
WSDL.  For our project, we create our XSDs, generate stubs with JAXB,
create our endpoint implementations (we use annotations), and wire it
all up with Spring.  CXF takes care of the WSDL generation.  It really
is easy.  I'm not sure there is an example within the CXF toolkit but I
could probably come up with one fairly fast if you need one.

Eric



On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> Hi--
> 
> Having gone through the Spring Web Services (SWS) manifesto about
> contract-first as well as their sample examples, I wonder how CXF
matches up
> with SWS.  I know that CXF allows contract-first development, but is
it as
> simple as SWS?  For example, with SWS, all I need to do is define the
XSD
> for my types (the messages and such being passed or returned).  I can
then
> have SWS generate the WSDL using basic conventions and the XSDs
defined. The
> only other thing to do is to implement the endpoints (Java) that will
handle
> the service.  From looking through the CXF site, it looks that if you
do
> contract-first, you must define the WSDL along with the XSDs and Java
> service implementations (probably using JSR-181).  Is this the case?  
> 
> Thanks in advance!
> 
> -los

Re: contract-first with only xsd

Posted by Eric Miles <er...@kronos.com>.
Los,

It is just as easy to define contract first, without having to create a
WSDL.  For our project, we create our XSDs, generate stubs with JAXB,
create our endpoint implementations (we use annotations), and wire it
all up with Spring.  CXF takes care of the WSDL generation.  It really
is easy.  I'm not sure there is an example within the CXF toolkit but I
could probably come up with one fairly fast if you need one.

Eric



On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> Hi--
> 
> Having gone through the Spring Web Services (SWS) manifesto about
> contract-first as well as their sample examples, I wonder how CXF matches up
> with SWS.  I know that CXF allows contract-first development, but is it as
> simple as SWS?  For example, with SWS, all I need to do is define the XSD
> for my types (the messages and such being passed or returned).  I can then
> have SWS generate the WSDL using basic conventions and the XSDs defined. The
> only other thing to do is to implement the endpoints (Java) that will handle
> the service.  From looking through the CXF site, it looks that if you do
> contract-first, you must define the WSDL along with the XSDs and Java
> service implementations (probably using JSR-181).  Is this the case?  
> 
> Thanks in advance!
> 
> -los

Re: contract-first with only xsd

Posted by Eric Miles <er...@kronos.com>.
Yeah, that's a bug that is fixed in CXF 2.0.2.  Upgrade to that version
and you should be good.


On Mon, 2007-10-01 at 06:54 -0700, gdprao wrote:
> Hi,
> 
> I have tried contract-first XSD approach in my service. I have generated
> JAXB mappings from the XSD and used them in my service.  The service is
> working fine without specifying <jaxws:schemaLocation>. If I use that, I am
> getting the following exception at startup.  I am using CXF2.0.1. Any help
> is appreciated.
> 
> applictionContext-cxf.xml:
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:jaxws="http://cxf.apache.org/jaxws"
> 	xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
> 
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
> 	<import
> 		resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-xml.xml" />
> 
> <jaxws:endpoint id="serviceSoapEndPoint"
> 		implementor="#serviceImplementor" address="/MyService">
> 		<jaxws:schemaLocations>
> 			<jaxws:schemaLocation>
> 				classpath:com/mydomain/schemas/serviceSchema.xsd
> 			</jaxws:schemaLocation>
> 		</jaxws:schemaLocations>
> 	</jaxws:endpoint>
> 
> 007-10-01 06:34:16,346 - ERROR
> (org.apache.catalina.core.StandardContext:listenerStart:3767) - Exception
> sending context initialized event to listener instance of class
> org.springframework.web.context.ContextLoaderListener
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> Configuration problem: Cannot locate BeanDefinitionParser for element
> [schemaLocation]
> Offending resource: ServletContext resource
> [/WEB-INF/applicationContext-cxf.xml]
> 	at
> org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:59)
> 	at
> org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68)
> 	at
> org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:55)
> 	at
> org.springframework.beans.factory.xml.NamespaceHandlerSupport.findParserForElement(NamespaceHandlerSupport.java:79)
> 	at
> org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
> 	at
> org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.getAndRegisterFirstChild(AbstractBeanDefinitionParser.java:175)
> 	at
> org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.setFirstChildAsProperty(AbstractBeanDefinitionParser.java:139)
> 	at
> org.apache.cxf.jaxws.spring.EndpointDefinitionParser.doParse(EndpointDefinitionParser.java:112)
> 	at
> org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:81)
> 	at
> org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
> 	at
> org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
> 	at
> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
> 
> 
> 
> 
> 
> 
> 
> BigEHokie wrote:
> > 
> > Here's just a quick sample.
> > 
> > I'm not stating this is the proper or correct way to do anything.
> > However, this is how we are currently using CXF.
> > 
> > The CXF guys can provide you with better direction on how you SHOULD be
> > creating your services.  They might tell you this approach is a bad
> > approach.
> > 
> > Eric
> > 
> > On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> >> Hi--
> >> 
> >> Having gone through the Spring Web Services (SWS) manifesto about
> >> contract-first as well as their sample examples, I wonder how CXF matches
> >> up
> >> with SWS.  I know that CXF allows contract-first development, but is it
> >> as
> >> simple as SWS?  For example, with SWS, all I need to do is define the XSD
> >> for my types (the messages and such being passed or returned).  I can
> >> then
> >> have SWS generate the WSDL using basic conventions and the XSDs defined.
> >> The
> >> only other thing to do is to implement the endpoints (Java) that will
> >> handle
> >> the service.  From looking through the CXF site, it looks that if you do
> >> contract-first, you must define the WSDL along with the XSDs and Java
> >> service implementations (probably using JSR-181).  Is this the case?  
> >> 
> >> Thanks in advance!
> >> 
> >> -los
> > 
> >  
> > 
> 

Re: contract-first with only xsd

Posted by gdprao <gd...@yahoo.com>.
Hi,

I have tried contract-first XSD approach in my service. I have generated
JAXB mappings from the XSD and used them in my service.  The service is
working fine without specifying <jaxws:schemaLocation>. If I use that, I am
getting the following exception at startup.  I am using CXF2.0.1. Any help
is appreciated.

applictionContext-cxf.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
	<import
		resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-xml.xml" />

<jaxws:endpoint id="serviceSoapEndPoint"
		implementor="#serviceImplementor" address="/MyService">
		<jaxws:schemaLocations>
			<jaxws:schemaLocation>
				classpath:com/mydomain/schemas/serviceSchema.xsd
			</jaxws:schemaLocation>
		</jaxws:schemaLocations>
	</jaxws:endpoint>

007-10-01 06:34:16,346 - ERROR
(org.apache.catalina.core.StandardContext:listenerStart:3767) - Exception
sending context initialized event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Cannot locate BeanDefinitionParser for element
[schemaLocation]
Offending resource: ServletContext resource
[/WEB-INF/applicationContext-cxf.xml]
	at
org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:59)
	at
org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68)
	at
org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:55)
	at
org.springframework.beans.factory.xml.NamespaceHandlerSupport.findParserForElement(NamespaceHandlerSupport.java:79)
	at
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
	at
org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.getAndRegisterFirstChild(AbstractBeanDefinitionParser.java:175)
	at
org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.setFirstChildAsProperty(AbstractBeanDefinitionParser.java:139)
	at
org.apache.cxf.jaxws.spring.EndpointDefinitionParser.doParse(EndpointDefinitionParser.java:112)
	at
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:81)
	at
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
	at
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
	at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)







BigEHokie wrote:
> 
> Here's just a quick sample.
> 
> I'm not stating this is the proper or correct way to do anything.
> However, this is how we are currently using CXF.
> 
> The CXF guys can provide you with better direction on how you SHOULD be
> creating your services.  They might tell you this approach is a bad
> approach.
> 
> Eric
> 
> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
>> Hi--
>> 
>> Having gone through the Spring Web Services (SWS) manifesto about
>> contract-first as well as their sample examples, I wonder how CXF matches
>> up
>> with SWS.  I know that CXF allows contract-first development, but is it
>> as
>> simple as SWS?  For example, with SWS, all I need to do is define the XSD
>> for my types (the messages and such being passed or returned).  I can
>> then
>> have SWS generate the WSDL using basic conventions and the XSDs defined.
>> The
>> only other thing to do is to implement the endpoints (Java) that will
>> handle
>> the service.  From looking through the CXF site, it looks that if you do
>> contract-first, you must define the WSDL along with the XSDs and Java
>> service implementations (probably using JSR-181).  Is this the case?  
>> 
>> Thanks in advance!
>> 
>> -los
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/contract-first-with-only-xsd-tf4474467.html#a12979566
Sent from the cxf-user mailing list archive at Nabble.com.


Re: contract-first with only xsd

Posted by Eric Miles <er...@kronos.com>.
Dan,

I do not do any schema validation so I can't help you on this one.
Someone more experienced with JAXB and CXF is going to have to respond.

Eric

On Thu, 2007-09-27 at 18:40 +0200, Daniel Dienhardt wrote:
> Thanks for that nice example,
> 
> I tried to enable schema validation, but it did not work.
> 
> my beans.xml:
> 
> <jaxws:endpoint id="myService" implementor="#myServiceImpl"
> 	address="/MyService">
>    <jaxws:schemaLocations>
>      <jaxws:schemaLocation>
> 	classpath:com/mycompany/test/MyService.xsd
>      </jaxws:schemaLocation>
>    </jaxws:schemaLocations>
>    <jaxws:properties>
>      <entry key="schema-validation-enabled" value="true" />
>    </jaxws:properties>
> </jaxws:endpoint>
> 
> I added a restriction to SomeType/id and it was correctly rejected with 
> invalid data -- but also with correct data this is the stack trace:
> 
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot 
> find the declaration of element 'SomeOperationResponse'.
> 	at 
> org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:179)
> 	at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:42)
> 	at 
> org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:84)
> 	at 
> org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
> 	at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
> 	at 
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
> 	at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
> 	at 
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73)
> 	at 
> org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)
> 	at 
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:236)
> 	at 
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:141)
> 	at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:278)
> 	at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:256)
> 
> 
> Do you have any idea what I'm doing wrong?
> 
> Thanks in advance
> 
> Daniel Dienhardt
> 
> moraleslos schrieb:
> > Thanks Eric.
> > 
> > Just what I needed!  I'll use your sample as a template.  Thanks again!
> > 
> > -los
> > 
> > 
> > 
> > BigEHokie wrote:
> >> Here's just a quick sample.
> >>
> >> I'm not stating this is the proper or correct way to do anything.
> >> However, this is how we are currently using CXF.
> >>
> >> The CXF guys can provide you with better direction on how you SHOULD be
> >> creating your services.  They might tell you this approach is a bad
> >> approach.
> >>
> >> Eric
> >>
> >> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> >>> Hi--
> >>>
> >>> Having gone through the Spring Web Services (SWS) manifesto about
> >>> contract-first as well as their sample examples, I wonder how CXF matches
> >>> up
> >>> with SWS.  I know that CXF allows contract-first development, but is it
> >>> as
> >>> simple as SWS?  For example, with SWS, all I need to do is define the XSD
> >>> for my types (the messages and such being passed or returned).  I can
> >>> then
> >>> have SWS generate the WSDL using basic conventions and the XSDs defined.
> >>> The
> >>> only other thing to do is to implement the endpoints (Java) that will
> >>> handle
> >>> the service.  From looking through the CXF site, it looks that if you do
> >>> contract-first, you must define the WSDL along with the XSDs and Java
> >>> service implementations (probably using JSR-181).  Is this the case?  
> >>>
> >>> Thanks in advance!
> >>>
> >>> -los
> >>  
> >>
> > 
> 
> 
> 

Re: contract-first with only xsd

Posted by Daniel Dienhardt <d....@ergomedia.de>.
Thanks for that nice example,

I tried to enable schema validation, but it did not work.

my beans.xml:

<jaxws:endpoint id="myService" implementor="#myServiceImpl"
	address="/MyService">
   <jaxws:schemaLocations>
     <jaxws:schemaLocation>
	classpath:com/mycompany/test/MyService.xsd
     </jaxws:schemaLocation>
   </jaxws:schemaLocations>
   <jaxws:properties>
     <entry key="schema-validation-enabled" value="true" />
   </jaxws:properties>
</jaxws:endpoint>

I added a restriction to SomeType/id and it was correctly rejected with 
invalid data -- but also with correct data this is the stack trace:

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-elt.1: Cannot 
find the declaration of element 'SomeOperationResponse'.
	at 
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:179)
	at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:42)
	at 
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:84)
	at 
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
	at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
	at 
org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74)
	at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
	at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73)
	at 
org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79)
	at 
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:236)
	at 
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:141)
	at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:278)
	at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:256)


Do you have any idea what I'm doing wrong?

Thanks in advance

Daniel Dienhardt

moraleslos schrieb:
> Thanks Eric.
> 
> Just what I needed!  I'll use your sample as a template.  Thanks again!
> 
> -los
> 
> 
> 
> BigEHokie wrote:
>> Here's just a quick sample.
>>
>> I'm not stating this is the proper or correct way to do anything.
>> However, this is how we are currently using CXF.
>>
>> The CXF guys can provide you with better direction on how you SHOULD be
>> creating your services.  They might tell you this approach is a bad
>> approach.
>>
>> Eric
>>
>> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
>>> Hi--
>>>
>>> Having gone through the Spring Web Services (SWS) manifesto about
>>> contract-first as well as their sample examples, I wonder how CXF matches
>>> up
>>> with SWS.  I know that CXF allows contract-first development, but is it
>>> as
>>> simple as SWS?  For example, with SWS, all I need to do is define the XSD
>>> for my types (the messages and such being passed or returned).  I can
>>> then
>>> have SWS generate the WSDL using basic conventions and the XSDs defined.
>>> The
>>> only other thing to do is to implement the endpoints (Java) that will
>>> handle
>>> the service.  From looking through the CXF site, it looks that if you do
>>> contract-first, you must define the WSDL along with the XSDs and Java
>>> service implementations (probably using JSR-181).  Is this the case?  
>>>
>>> Thanks in advance!
>>>
>>> -los
>>  
>>
> 




Re: contract-first with only xsd

Posted by moraleslos <mo...@hotmail.com>.
Thanks Eric.

Just what I needed!  I'll use your sample as a template.  Thanks again!

-los



BigEHokie wrote:
> 
> Here's just a quick sample.
> 
> I'm not stating this is the proper or correct way to do anything.
> However, this is how we are currently using CXF.
> 
> The CXF guys can provide you with better direction on how you SHOULD be
> creating your services.  They might tell you this approach is a bad
> approach.
> 
> Eric
> 
> On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
>> Hi--
>> 
>> Having gone through the Spring Web Services (SWS) manifesto about
>> contract-first as well as their sample examples, I wonder how CXF matches
>> up
>> with SWS.  I know that CXF allows contract-first development, but is it
>> as
>> simple as SWS?  For example, with SWS, all I need to do is define the XSD
>> for my types (the messages and such being passed or returned).  I can
>> then
>> have SWS generate the WSDL using basic conventions and the XSDs defined.
>> The
>> only other thing to do is to implement the endpoints (Java) that will
>> handle
>> the service.  From looking through the CXF site, it looks that if you do
>> contract-first, you must define the WSDL along with the XSDs and Java
>> service implementations (probably using JSR-181).  Is this the case?  
>> 
>> Thanks in advance!
>> 
>> -los
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/contract-first-with-only-xsd-tf4474467.html#a12758632
Sent from the cxf-user mailing list archive at Nabble.com.


Re: contract-first with only xsd

Posted by Eric Miles <er...@kronos.com>.
Here's just a quick sample.

I'm not stating this is the proper or correct way to do anything.
However, this is how we are currently using CXF.

The CXF guys can provide you with better direction on how you SHOULD be
creating your services.  They might tell you this approach is a bad
approach.

Eric

On Tue, 2007-09-18 at 06:49 -0700, moraleslos wrote:
> Hi--
> 
> Having gone through the Spring Web Services (SWS) manifesto about
> contract-first as well as their sample examples, I wonder how CXF matches up
> with SWS.  I know that CXF allows contract-first development, but is it as
> simple as SWS?  For example, with SWS, all I need to do is define the XSD
> for my types (the messages and such being passed or returned).  I can then
> have SWS generate the WSDL using basic conventions and the XSDs defined. The
> only other thing to do is to implement the endpoints (Java) that will handle
> the service.  From looking through the CXF site, it looks that if you do
> contract-first, you must define the WSDL along with the XSDs and Java
> service implementations (probably using JSR-181).  Is this the case?  
> 
> Thanks in advance!
> 
> -los