Hi,

I think Axis is expecting to see namespace URIs with the http scheme, as in
the http://www.w3.org/2001/XMLSchema of your example. When it finds the
authority part of the URI it reverses it, because it expects it to look like a
server name a la DNS. Arguably, it should only do this if the scheme of the
URI is one of those where the authority is really an address (http, https,
ftp, etc.), so yes, I'd call this a bug.

To get round this, you need to use an explicit mapping of the namespace to
your preferred package and to set this mapping in the invocation of WSDL2java.
See the "reference documentation" for details.

On Fri, 26 Aug 2005 [EMAIL PROTECTED] wrote:

> Hello,
>
> I am trying to throw an custom exception and when I run WSDL2Java  it
> creates my excepion  but the package name is REVERSED for 
> InvalidDataFormatException.java   WSDL2Java puts this java class in 
> exceptions.ws.com package instead of
> com.ws.exceptions package
>
> Please let me know if its a bug in AXIS 1.2 or  I am making a mistake in
> my declaration( I hope so.. but I don't have a clue)
>
> Here is the schema for my exception (ExceptionSchema.xsd)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>     xmlns:stns="java:com.ws.exceptions"
>     elementFormDefault="qualified"
>     attributeFormDefault="qualified"
>     targetNamespace="java:com.ws.exceptions">
>
>
>    <xsd:complexType name="InvalidDataFormatException">
>     <xsd:sequence>
>      <xsd:element type="xsd:string"
>        name="errorCode"
>        minOccurs="1"
>        nillable="true"
>        maxOccurs="1">
>      </xsd:element>
>      <xsd:element type="xsd:string"
>        name="errorDescription"
>        minOccurs="1"
>        nillable="true"
>        maxOccurs="1">
>      </xsd:element>
>      <xsd:element type="xsd:string"
>        name="variables"
>        minOccurs="1"
>        nillable="true"
>        maxOccurs="1">
>      </xsd:element>
>     </xsd:sequence>
>    </xsd:complexType>
> </xsd:schema>
>
> and here is my WSDL
>
>
>
> <?xml version="1.0" ?>
>
> <definitions name="urn:DataInquiry"
>              targetNamespace="urn:DataInquiry2"
>              xmlns:tns="urn:DataInquiry2"
>              xmlns:typens="urn:DataInquiry2"
>              xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
>              xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
>              xmlns="http://schemas.xmlsoap.org/wsdl/"; 
> xmlns:xsd1="java:com.ws.exceptions">
>
>   <!-- type defs -->
>   <import namespace="java:com.ws.exceptions" 
> location="ExceptionSchema.xsd"></import>
>   <types>
>     <xsd:schema targetNamespace="urn:DataInquiry2"
>                 xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>
>
>       <xsd:complexType name="inquiryRequest">
>         <xsd:all>
>             <xsd:element name="so" type="xsd:string"/>
>             <xsd:element name="lNumber" type="xsd:string"/>
>         </xsd:all>
>       </xsd:complexType>
>
>       <xsd:complexType name="inquiryResponse">
>         <xsd:all>
>             <xsd:element name="status" type="xsd:string"/>
>             <xsd:element name="mNumber" type="xsd:string"/>
>             <xsd:element name="mFlag" type="xsd:string"/>
>             <xsd:element name="mAFlag" type="xsd:string"/>
>             <xsd:element name="mLFlag" type="xsd:string"/>
>         </xsd:all>
>       </xsd:complexType>
>
>
>
>
>     </xsd:schema>
>   </types>
>
>   <!-- message declns -->
>   <message name="empty"/>
>
>
>
>   <!-- Raj -->
>
>    <message name="GetInquiryDataRequest">
>     <part  name="inquiryRequest" type="typens:inquiryRequest"/>
>   </message>
>
>    <message name="GetInquiryDataResponse">
>     <part  name="inquiryResponse" type="typens:inquiryResponse"/>
>   </message>
>
>   <message name="InvalidDataFormatException">
>   <part  name="InvalidDataFormatException"  
> type="xsd1:InvalidDataFormatException">
>   </part>
>   </message>
>
>
>   <!-- port type declns -->
>   <portType name="DataInquiry">
>
>     <operation name="getInquiryData">
>       <input name="input" message="tns:GetInquiryDataRequest"/>
>       <output name="output" message="tns:GetInquiryDataResponse"/>
>       <fault name="InvalidDataFormatException" 
> message="tns:InvalidDataFormatException"/>
>
>     </operation>
>   </portType>
>
>   <!-- binding declns -->
>   <binding name="DataInquirySOAPBinding" type="tns:DataInquiry">
>     <soap:binding style="document"
>                   transport="http://schemas.xmlsoap.org/soap/http"/>
>
>     <operation name="getInquiryData">
>
>        <soap:operation soapAction=""/>
>       <input name="input">
>         <soap:body use="literal"/>
>       </input>
>       <output name="output">
>         <soap:body use="literal"/>
>       </output>
>       <wsdl:fault name="InvalidDataFormatException">
>         <wsdlsoap:fault name="InvalidDataFormatException" use="literal"/>
>       </wsdl:fault>
>     </operation>
>   </binding>
>
>   <!-- service decln -->
>   <service name="DataInquiryService">
>     <port name="DataInquiry" binding="tns:DataInquirySOAPBinding">
>       <soap:address 
> location="http://localhost:8080/InquiryWSWAR/services/DataInquiry"/>
>     </port>
>   </service>
>
> </definitions>
>
>

Guy Rixon                                       [EMAIL PROTECTED]
Institute of Astronomy                          Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA          Fax: +44-1223-337523

Reply via email to