The web service I'm developing is working fine, except that I cannot figure out how to activate schema validation. I have several colleagues that have given up on this in other projects. But surely there must be a way. In the apache-cxf-2.4.4 binary I can see that wsdl_first_soap12 does schema validation fine - and it doesn't resort to writing handlers or interceptors or XML-configuration (as far as I can see) - but how that works is a mystery to me.
When I start JBoss I see:
[org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-1) Add Service
which looks fine (except for wsdlLocation=null). But then it continues with:
[org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-1) register: jboss.ws:context=gflk-hunt-ws,endpoint=LuliPortTypeImpl
[org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service urn:luli:wsdl:v1}LuliService from WSDL: /META-INF/wsdl/luli.wsdl
WARN [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-1) Cannot resolve resource: cxf
The second line looks like it finds the WSDL file all right; but I'm worried about the warning.
The annotations I use are the following:
wsdlLocation = "/META-INF/wsdl/luli.wsdl",
name = "LuliPortType",
endpointInterface = "luli.wsdl.v1.LuliPortType")
@org.apache.cxf.annotations.SchemaValidation(enabled = true)
Does anybody have a suggestion?
This is an issue in jbossws. I've created a jira https://issues.jboss.org/browse/JBWS-3394 and fixed locally. It will be merged in AS7 upstream shortly and I will let you know when it's done. Thanks for reporting this.
we've just discussed this a bit and basically this can't be considered a bug. Have a look at the "Using Apache CXF" section at https://docs.jboss.org/author/display/JBWS/JBoss+Modules
Basically, on AS 7 series, the user is responsible for setting dependencies to modules he want to use in his own deployment. The @SchemaValidation comes from the org.apache.cxf module, so you should be adding that in your MANIFEST.MF.
Thanks for the response. I have tried to follow the instructions, but I'm still getting the "Cannot resolve resource: cxf" warning. But perhaps I'm not doing things right? I've added to my maven war plugin:
<archive> <manifestEntries> <Dependencies> org.apache.cxf </Dependencies> </manifestEntries> </archive>
(I also tried with adding services and export). The resulting MANIFEST.MF (in META-INF) is:
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Have I misunderstood the instructions?