dev@jax-ws.java.net

help compiling wsdl file

From: Schmilinsky, Remsy <Remsy.Schmilinsky_at_cbsa-asfc.gc.ca>
Date: Mon, 29 Oct 2007 14:45:20 -0400

Hi. I can't compile the wsdl described at the bottom with wsimport, I get these errors:

C:\metro\bin>wsimport mtomserver.wsdl
parsing WSDL...

[WARNING] src-resolve.4.2: Error resolving component 'x:data'. It was detected that 'x:data' is in namespace 'http://mtomserver.sourceforge.net/schemas/soapserver.xsd', but components from this namespace are not referenceable from schema document 'file:/C:/metro/bin/mtomserver.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'x:data' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to file:/C:/metro/bin/mtomserver.wsdl#types?schema1'.
  line 40 of file:/C:/metro/bin/mtomserver.wsdl#types?schema1

[WARNING] src-resolve: Cannot resolve the name 'xmime4:contentType' to a(n) 'attribute declaration' component.
  line 77 of file:/C:/metro/bin/mtomserver.wsdl#types?schema2

[WARNING] s4s-elt-invalid-content.1: The content of 'Data' is invalid. Element 'attribute' is invalid, misplaced, or occurs too often.
  line 77 of file:/C:/metro/bin/mtomserver.wsdl#types?schema2

[WARNING] src-resolve: Cannot resolve the name 'xop:Include' to a(n) 'element declaration' component.
  line 75 of file:/C:/metro/bin/mtomserver.wsdl#types?schema2

[ERROR] undefined element declaration 'xop:Include'
  line 75 of file:/C:/metro/bin/mtomserver.wsdl

[ERROR] undefined attribute 'xmime4:contentType'
  line 77 of file:/C:/metro/bin/mtomserver.wsdl

Exception in thread "main" java.lang.NullPointerException
        at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:237)
        at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:518)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:232)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
        at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:134)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2193)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:187)
        at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:133)
        at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:165)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.tools.ws.Invoker.invoke(Invoker.java:116)
        at com.sun.tools.ws.WsImport.main(WsImport.java:52)

Mtomserver.wsdl:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="mtomserver"
 targetNamespace="http://mtomserver.sourceforge.net/wsdl/soapserver.wsdl"
 xmlns:tns="http://mtomserver.sourceforge.net/wsdl/soapserver.wsdl"
 xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
 xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xop="http://www.w3.org/2004/08/xop/include"
 xmlns:xmime4="http://www.w3.org/2004/11/xmlmime"
 xmlns:m="http://mtomserver.sourceforge.net/wsdl/soapserver.wsdl"
 xmlns:x="http://mtomserver.sourceforge.net/schemas/soapserver.xsd"
 xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap12/"
 xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
 xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
 xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
 xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>

 <schema targetNamespace="http://mtomserver.sourceforge.net/wsdl/soapserver.wsdl"
  xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
  xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xop="http://www.w3.org/2004/08/xop/include"
  xmlns:xmime4="http://www.w3.org/2004/11/xmlmime"
  xmlns:m="http://mtomserver.sourceforge.net/wsdl/soapserver.wsdl"
  xmlns:x="http://mtomserver.sourceforge.net/schemas/soapserver.xsd"
  xmlns="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="unqualified"
  attributeFormDefault="unqualified">
  <import namespace="http://www.w3.org/2004/08/xop/include"/>
  <import namespace="http://www.w3.org/2004/11/xmlmime"/>
  <import namespace="http://www.w3.org/2003/05/soap-encoding"/>
  <!-- operation request element -->
  <element name="PutData">
   <complexType>
    <sequence>
     <element ref="x:data" minOccurs="0" maxOccurs="1"/>
    </sequence>
   </complexType>
  </element>
  <!-- operation response element -->
  <element name="PutDataResponse">
   <complexType>
    <sequence>
     <element ref="x:keys" minOccurs="1" maxOccurs="1"/>
     <element ref="x:data" minOccurs="1" maxOccurs="1"/>
    </sequence>
   </complexType>
  </element>
 </schema>

 <schema targetNamespace="http://mtomserver.sourceforge.net/schemas/soapserver.xsd"
  xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
  xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xop="http://www.w3.org/2004/08/xop/include"
  xmlns:xmime4="http://www.w3.org/2004/11/xmlmime"
  xmlns:m="http://mtomserver.sourceforge.net/wsdl/soapserver.wsdl"
  xmlns:x="http://mtomserver.sourceforge.net/schemas/soapserver.xsd"
  xmlns="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified"
  attributeFormDefault="unqualified">
  <import namespace="http://www.w3.org/2004/08/xop/include"/>
  <import namespace="http://www.w3.org/2004/11/xmlmime"/>
  <import namespace="http://www.w3.org/2003/05/soap-encoding"/>
  <complexType name="Data">
   <annotation>
    <documentation>holds a MIME attachment</documentation>
   </annotation>
   <sequence>
     <element ref="xop:Include" minOccurs="1" maxOccurs="1"/>
   </sequence>
     <attribute ref="xmime4:contentType" use="optional"/>
  </complexType>
  <complexType name="DataSet">
   <annotation>
    <documentation>holds a set of MIME attachments</documentation>
   </annotation>
   <sequence>
     <element name="item" type="x:Data" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
  </complexType>
  <complexType name="Keys">
   <annotation>
    <documentation>holds a set of strings to access the data collection at the server side</documentation>
   </annotation>
   <sequence>
     <element name="key" type="xsd:string" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
   </sequence>
  </complexType>
  <element name="keys" type="x:Keys"/>
  <element name="data" type="x:DataSet"/>
 </schema>

</types>

<message name="PutData">
 <part name="parameters" element="m:PutData"/>
 <part name="attachments" type="xsd:base64Binary"/>
</message>

<message name="PutDataResponse">
 <part name="parameters" element="m:PutDataResponse"/>
 <part name="attachments" type="xsd:base64Binary"/>
</message>

<portType name="mtomserverPortType">
 <operation name="PutData">
  <documentation>Service definition of function m__PutData</documentation>
  <input message="tns:PutData"/>
  <output message="tns:PutDataResponse"/>
 </operation>
</portType>

<binding name="mtomserver" type="tns:mtomserverPortType">
 <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
 <operation name="PutData">
  <SOAP:operation/>
  <input>
   <MIME:multipartRelated>
    <MIME:part>
     <SOAP:body parts="parameters" use="literal"/>
    </MIME:part>
    <MIME:part>
     <MIME:content part="attachments" type="*/*"/>
    </MIME:part>
   </MIME:multipartRelated>
  </input>
  <output>
   <MIME:multipartRelated>
    <MIME:part>
     <SOAP:body parts="parameters" use="literal"/>
    </MIME:part>
    <MIME:part>
     <MIME:content part="attachments" type="*/*"/>
    </MIME:part>
   </MIME:multipartRelated>
  </output>
 </operation>
</binding>

<service name="mtomserver">
 <documentation>gSOAP 2.7.9l generated service definition</documentation>
 <port name="mtomserver" binding="tns:mtomserver">
  <SOAP:address location="http://localhost:8085"/>
 </port>
</service>

</definitions>