cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@gmail.com>
Subject Re: Invalid WSDL with a Jax-ws schemaLocation (XSD) specified
Date Mon, 12 Jul 2010 19:06:01 GMT

(Note, I had to mangle the word "C r e d i t" below because it activated
Nabble's spam detector)

I didn't know about ASM: http://asm.ow2.org/.  BTW, your sample POM is
missing this repository in case others want to test it:

 <pluginRepositories>
    <pluginRepository>
       <id>maven2-repository.dev.java.net</id>
       <name>Java.net Maven 2 Repository</name>
       <url>http://download.java.net/maven/2/</url>
    </pluginRepository>
 </pluginRepositories>

Anyway, I looked at the WSDL generated at
http://localhost:8080/creditcard/creditCard?wsdl with both the pom with ASM
(which doesn't work) and the pom without it (which apparently does work). 
They're different for some reason.  The failing WSDL has this schema
included:

<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="http://cretcard.example.com/"
xmlns:tns="http://critcard.example.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="getCritCardStatus" nillable="true"
type="tns:getCritCardStatus"/>
  <xsd:element name="getCritCardStatusResponse" nillable="true"
type="tns:getCritCardStatusResponse"/>
</xsd:schema>

While the good WSDL has this instead:

<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="http://critcard.example.com/"
xmlns:ns0="http://www.example.org" xmlns:tns="http://critcard.example.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:import namespace="http://www.example.org" />
  <xsd:element name="getCditCardStatus" type="tns:getCritCardStatus" />
  <xsd:complexType name="getCritCardStatus">
    <xsd:sequence>
      <xsd:element minOccurs="0" ref="ns0:CditCardRequest" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:element name="getCritCardStatusResponse"
type="tns:getCditCardStatusResponse" />
  <xsd:complexType name="getCditCardStatusResponse">
    <xsd:sequence>
      <xsd:element minOccurs="0" ref="ns0:CritCardResponse" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

i.e., you're missing a couple of complexType definitions.  I don't know
why--I guess it's something about the dependencies that ASM itself brings
in.  This is probably a rare bug, possibly due to the manner in which you're
generating your project.

Possible solutions:
1.) Include the working (good) WSDL in your web service (If helpful, see
here[1] for where to include it in a Mavenized project, and [2] for how to
host it on Jetty) so you know the version that Jetty is using.

and

2.) Don't use the maven-jaxb-plugin.  CXF's own codegen plugin [1] will
generate all the necessary artifacts both JAX-WS and JAXB (you're only going
to get the latter with the jaxb plugin), and it can also handle any JAXB
customizations you may wish to do[3].  If you like to split out your JAXB
objects you can use Maven's Assembly plugin[1] for that.  That might also
allow you to get rid of the java.net repository from your POM files, and
hence any download inconsistencies between that and the standard Maven
repos.

[1] http://www.jroller.com/gmazza/entry/web_service_tutorial#WFstep4 (also
the cxf-servlet.xml file in Step #7)
[2] http://www.jroller.com/gmazza/entry/writing_junit_test_cases_for#testjt
[3] http://www.jroller.com/gmazza/entry/customizing_jaxb_artifacts

HTH,
Glen
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Invalid-WSDL-with-a-Jax-ws-schemaLocation-XSD-specified-tp1046395p1046509.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message