You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Steve Loughran <st...@apache.org> on 2004/10/14 17:01:07 UTC

Q about those ns:> types

1. I have a WSDL file and an XSD file, about 2K lines of verbose XSD.
2. I run it through the wsdl2java to create the classes *and the 
deploy.wsdd*
3. in the deploy.wsdd, i see things like

   <service name="cddlm" provider="java:RPC" style="document" use="literal">
       <parameter name="wsdlTargetNamespace" 
value="http://gridforum.org/cddlm/serviceAPI/api/2004/10/11/"/>
       <parameter name="wsdlServiceElement" value="CDDLMDeploymentService"/>
       <parameter name="wsdlServicePort" value="cddlm"/>
       <parameter name="className" 
value="org.smartfrog.services.cddlm.generated.api.endpoint.CddlmSoapBindingSkeleton"/>
       <parameter name="wsdlPortType" value="DeploymentEndpoint"/>
       <parameter name="allowedMethods" value="*"/>

...
       <typeMapping
         xmlns:ns="http://gridforum.org/cddlm/serviceAPI/types/2004/10/11/"
         qname="ns:>applicationStatusRequest"
 
type="java:org.smartfrog.services.cddlm.generated.api.types._applicationStatusRequest"
         serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
         deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
         encodingStyle=""
       />

Which implies to me that the qname of this type is
qname(ns, ">applicationStatusRequest").

Except it isn't. In the XSD it is

   <xsd:element name="applicationStatusRequest">
     <xsd:annotation>
       <xsd:documentation>
         Request the status of an individual application
       </xsd:documentation>
     </xsd:annotation>
     <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="application" 
type="types:applicationReferenceType"/>
       </xsd:sequence>
     </xsd:complexType>
   </xsd:element>

Now, there may be an applicationStatusRequest message in the WSDL, but 
that is in a different namespace.

So, what does the ">" really mean, and how do I make it go away?

Re: Q about those ns:> types

Posted by Jongjin Choi <gu...@hotmail.com>.
Steve,

The '>' in qname means that it is anonymous type. 
You can see more details about this convention  in '7.3.2.2 Mapping anonymous types' of JSR 921.

According to JSR 921, the QNames for your shemas are following:

<xsd:element name="applicationStatusRequest">            <--- ns:applicationStatusRequest for element
     <xsd:annotation>
       <xsd:documentation>
         Request the status of an individual application
       </xsd:documentation>
     </xsd:annotation>
     <xsd:complexType>                                                <--- ns:>applicationStatusRequest for complexType
       <xsd:sequence>
         <xsd:element name="application"                          <--- ns:>applicationStatusRequest>application for element
type="types:applicationReferenceType"/>
       </xsd:sequence>
     </xsd:complexType>
   </xsd:element>

Note that '>' is a part of localpart not namespaceURI. The rightmost ':' serves as a delimeter between the namespace and localpart.

For now, Axis replaces '>'s with '_'s for its generated java classes.
This is why the generated class's name is '_applicationStatusRequest.java' not 'ApplicationStatusRequest.java'
Ias and I have a plan to change this name scheme. You can see it in AXIS-1598.

/Jongjin


----- Original Message ----- 
From: "Steve Loughran" <st...@apache.org>
To: "Axis-Dev" <ax...@ws.apache.org>
Sent: Friday, October 15, 2004 12:01 AM
Subject: Q about those ns:> types


> 
> 1. I have a WSDL file and an XSD file, about 2K lines of verbose XSD.
> 2. I run it through the wsdl2java to create the classes *and the 
> deploy.wsdd*
> 3. in the deploy.wsdd, i see things like
> 
>    <service name="cddlm" provider="java:RPC" style="document" use="literal">
>        <parameter name="wsdlTargetNamespace" 
> value="http://gridforum.org/cddlm/serviceAPI/api/2004/10/11/"/>
>        <parameter name="wsdlServiceElement" value="CDDLMDeploymentService"/>
>        <parameter name="wsdlServicePort" value="cddlm"/>
>        <parameter name="className" 
> value="org.smartfrog.services.cddlm.generated.api.endpoint.CddlmSoapBindingSkeleton"/>
>        <parameter name="wsdlPortType" value="DeploymentEndpoint"/>
>        <parameter name="allowedMethods" value="*"/>
> 
> ...
>        <typeMapping
>          xmlns:ns="http://gridforum.org/cddlm/serviceAPI/types/2004/10/11/"
>          qname="ns:>applicationStatusRequest"
>  
> type="java:org.smartfrog.services.cddlm.generated.api.types._applicationStatusRequest"
>          serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>          deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>          encodingStyle=""
>        />
> 
> Which implies to me that the qname of this type is
> qname(ns, ">applicationStatusRequest").
> 
> Except it isn't. In the XSD it is
> 
>    <xsd:element name="applicationStatusRequest">
>      <xsd:annotation>
>        <xsd:documentation>
>          Request the status of an individual application
>        </xsd:documentation>
>      </xsd:annotation>
>      <xsd:complexType>
>        <xsd:sequence>
>          <xsd:element name="application" 
> type="types:applicationReferenceType"/>
>        </xsd:sequence>
>      </xsd:complexType>
>    </xsd:element>
> 
> Now, there may be an applicationStatusRequest message in the WSDL, but 
> that is in a different namespace.
> 
> So, what does the ">" really mean, and how do I make it go away?
>