Undefined namespace "ns2"  for checked exception in the Generated WSDL
----------------------------------------------------------------------

                 Key: XFIRE-1004
                 URL: http://jira.codehaus.org/browse/XFIRE-1004
             Project: XFire
          Issue Type: Bug
    Affects Versions: 1.2.4
         Environment: Xfire 1.2.4, deployed in weblogic 9.2.1, jdk 1.5.0_08 on 
SunOS operating system
            Reporter: Sridhar Sidda
            Assignee: Dan Diephouse
         Attachments: xfire-generated.wsdl

Hi

I am creating a XFire webservice out a POJO.  It is defined in the package 
com.sabre.airflite.profitmgr .  All the methods of this POJO throw an exception 
named AirFliteExcpetion which extends java.lang.Excpetion. The 
AirFliteException class it self is defined under a different package 
com.sabre.airflite

Now the WSDL genereated by XFire for this service looks as follows. I have 
attached the complete WSDL below.

-----------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://profitmgr.airflite.sabre.com"; 
xmlns:tns="http://profitmgr.airflite.sabre.com"; 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"; 
xmlns:ns1="http://airflite.sabre.com/integration/2007Q1"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:ns3="http://airflite.sabre.com/integration/2007Q1/markets"; 
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"; 
xmlns:ns2="http://airflite.sabre.com"; 
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>

  <wsdl:types>


 ..........

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace="http://airflite.sabre.com";>
<xsd:complexType name="AirFliteException"/>
</xsd:schema>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace="http://profitmgr.airflite.sabre.com";>
<xsd:element name="AirFliteException" type="ns2:AirFliteException"/>
</xsd:schema>
  </wsdl:types>

  <wsdl:message name="AirFliteException">
    <wsdl:part name="AirFliteException" element="tns:AirFliteException">
    </wsdl:part>
  </wsdl:message>
  
  <wsdl:portType name="MarketSummaryDataQueryServicePortType">
    <wsdl:operation name="getServiceSummaryData">
      <wsdl:input name="getServiceSummaryDataRequest" 
message="tns:getServiceSummaryDataRequest">
    </wsdl:input>
      <wsdl:output name="getServiceSummaryDataResponse" 
message="tns:getServiceSummaryDataResponse">
    </wsdl:output>
      <wsdl:fault name="AirFliteException" message="tns:AirFliteException">
    </wsdl:fault>
    </wsdl:operation>

         .........
   
  </wsdl:portType>

  <wsdl:binding name="MarketSummaryDataQueryServiceHttpBinding" 
type="tns:MarketSummaryDataQueryServicePortType">
    <wsdlsoap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getServiceSummaryData">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="getServiceSummaryDataRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="getServiceSummaryDataResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="AirFliteException">
        <wsdlsoap:fault name="AirFliteException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
     </wsdl:binding>

  ....
</wsdl:definitions>

---------------------------------------------------

>From the WSDL it is apprent that the the operations of the web service are 
>refering to the AirFliteException defined in name space 
>"profitmgr.airflite.sabre.com". But the schema corresponding to the 
>AirFliteExcpetion, taken from the WSDL looks like below:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
attributeFormDefault="qualified" elementFormDefault="qualified" 
targetNamespace="http://profitmgr.airflite.sabre.com";>
<xsd:element name="AirFliteException" type="ns2:AirFliteException"/>
</xsd:schema>
  </wsdl:types>

Note that this xsd refers to a non-existent name space "ns2". Because of this 
when I try to generate XMLbeans from the schemas in this WSDL, i get undefined 
QName error. 

I am sure this ns2 is supposed to refer to the schema for the same 
AirFliteException in the name space "airflite.sabre.com". I could infact 
manullay change the schema definition for the airflite.sabre.com by adding the 
xmlns:ns2 and the generate the XMLbeans.

My questions are:

1. why is the WSDL generating two schemas for AirFliteException even though it 
is originial defined in the package com.sabre.airflite and trying to refer to 
one schema from other, using a non-existent name space?

2. Is there a work around for this apart from moving the AirFliteException 
class into com.sabre.airflite.profitmgr, i.e the same package where the service 
POJO is defined?.

Appreciate your help.

Thanks
Sridhar


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to