axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <atma...@gmail.com>
Subject Re: WARNING and UnmatchedType Exception
Date Tue, 20 Mar 2007 13:05:32 GMT
The warning is caused by the unqualified type reference in this
element declaration.

      <xs:element name="requestInfo">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="id" type="xs:string"/>
            <xs:element name="idb64" type="xs:base64Binary"/>
            <xs:element name="ext" type="tExtension"/>  <----
unqualified reference
          </xs:sequence>
        </xs:complexType>
      </xs:element>

You have defined a default namespace:

     xmlns="http://schemas.xmlsoap.org/wsdl/"

This namespace applies when you don't specify a namespace
qualification; therefore the processor looks for this type in the
"http://schemas.xmlsoap.org/wsdl/" namespace.

You've defined the "tExtension" type in no namespace, therefore you
must override the default namespace in this element definition, e.g.,

      <xs:element name="requestInfo">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="id" type="xs:string"/>
            <xs:element name="idb64" type="xs:base64Binary"/>
            <xs:element name="ext" type="tExtension" xmlns=""/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

But, really, what you should do is define a targetNamespace for your
schema and reference the type using the proper qualification.

Note, also, that you have the same problem with all the elements you
reference from your message parts, e.g.,

  <message name="requestInfoSoapIn">
    <part name="parameters" element="requestInfo"/>
  </message>

The processor will look for the "requestInfo" element in the
"http://schemas.xmlsoap.org/wsdl/" namespace rather than in no
namespace.

Anne


On 3/15/07, Giuseppe Sarno <gsarno@nortel.com> wrote:
>
>
>
> Hi I'm trying to use the WSDL2JAVA code generation tool with the WSDL below
> but I get the following WARNING and exception:
>
> Can anyone please help ?
>
> Axis2 Version is 1.1.1.
>
> Regards.
>
> EXCEPTION:
>      [java] Mar 15, 2007 12:04:53 PM
> org.apache.axis2.schema.SchemaCompiler findClassName
>      [java] WARNING: Type
> {http://schemas.xmlsoap.org/wsdl/}tExtension missing!
>
>
>
>      [java] Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException:
> org.apache.axis2.wsdl.codegen.CodeGenerationException:
> org.apache.axis2.wsdl.databinding.UnmatchedTypeException:
> No type was mapped to the name requestInfo with namespace
> http://schemas.xmlsoap.org/wsdl/
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
>      [java]     at
> org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>      [java]     at
> org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
>      [java] Caused by:
> org.apache.axis2.wsdl.codegen.CodeGenerationException:
> org.apache.axis2.wsdl.databinding.UnmatchedTypeException:
> No type was mapped to the name requestInfo with namespace
> http://schemas.xmlsoap.org/wsdl/
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitSkeleton(AxisServiceBasedMultiLanguageEmitter.java:961)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:206)
>      [java]     ... 2 more
>      [java] Caused by:
> org.apache.axis2.wsdl.databinding.UnmatchedTypeException:
> No type was mapped to the name requestInfo with namespace
> http://schemas.xmlsoap.org/wsdl/
>
>      [java]     at
> org.apache.axis2.wsdl.databinding.TypeMappingAdapter.getTypeMappingName(TypeMappingAdapter.java:73)
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getInputParamElement(AxisServiceBasedMultiLanguageEmitter.java:2099)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.getInputElement(AxisServiceBasedMultiLanguageEmitter.java:1935)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:1701)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:1623)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForSkeleton(AxisServiceBasedMultiLanguageEmitter.java:1556)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeSkeleton(AxisServiceBasedMultiLanguageEmitter.java:1498)
>
>      [java]     at
> org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitSkeleton(AxisServiceBasedMultiLanguageEmitter.java:933)
>
>      [java]     ... 3 more
>
> ANT TASK:
> <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
>         <classpath refid="axis2.classpath"/>
>         <arg value="-d"/>
>         <arg value="adb"/>
>         <arg value="-uri"/>
>         <arg file="${root.build.dir}/${root.path.dir}/config/pro.wsdl"/>
>         <arg value="-ss"/>
>         <arg value="-g"/>
>         <arg value="-sd"/>
>         <arg value="-o"/>
>         <arg file="${root.build.dir}/${soap.interface}/server/deploy"/>
>         <arg value="-p"/>
>         <arg value="org.example.types"/>
>         </java>
>
>
> WSDL:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
>
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>              xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>              xmlns:y="http://blah"
>              targetNamespace="http://blah">
>
>   <types>
>     <xs:schema>
>       <xs:complexType name="tExtension">
>         <xs:sequence>
>           <xs:any  processContents="lax" minOccurs="0"
> maxOccurs="unbounded"/>
>         </xs:sequence>
>       </xs:complexType>
>
>       <xs:element name="requestInfo">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="id" type="xs:string"/>
>             <xs:element name="idb64" type="xs:base64Binary"/>
>             <xs:element name="ext" type="tExtension"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>
>
>       <xs:element name="requestInfoResponse">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="res" type="xs:string" minOccurs="0"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>
>       <!-- Request Bootstrapping info fault parameter definitions -->
>       <xs:element name="requestInfoFault">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="errorCode" type="xs:integer"/>
>             <xs:element name="errorText" type="xs:string" minOccurs="0"/>
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>
>     </xs:schema>
>
>   </types>
>
>   <message name="requestInfoSoapIn">
>     <part name="parameters" element="requestInfo"/>
>   </message>
>   <message name="requestInfoSoapOut">
>     <part name="parameter" element="requestInfoResponse"/>
>   </message>
>   <message name="requestInfoSoapFault">
>     <part name="parameter" element="requestInfoFault"/>
>   </message>
>
>   <portType name="ServiceSoap">
>     <operation name="requestInfo">
>       <input message="y:requestInfoSoapIn"/>
>       <output message="y:requestInfoSoapOut"/>
>       <fault name="FaultName"
> message="y:requestInfoSoapFault"/>
>     </operation>
>   </portType>
>
>   <binding name="ServiceSoap" type="y:ServiceSoap">
>     <soap:binding style="document" transport="add URI here"/>
>     <operation name="requestInfo">
>       <input>
>         <soap:body use="encoded"/>
>       </input>
>       <output>
>         <soap:body use="encoded"/>
>       </output>
>       <fault name="FaultName"/>
>     </operation>
>   </binding>
> <service name="Service">
>     <port name="ServiceSoap" binding="y:ServiceSoap">
>       <soap:address location="No Target Adress"/>
>     </port>
>   </service>
>
> </definitions>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message