I'm generating WSDL using XFire 1.2.6 and JAXB 2.0.1. It's a simple service intended to test how exceptions are converted to SOAP faults. I had an interface with 4 methods, and everything was working. I added a fifth method, and suddenly the WSDL generated by the XFire servlet had an incorrect namespace.

After much experimentation I discovered that the problem only occurs when the method name ends in 't'. In other words,
generateOneParticularFault() results in invalid WSDL.
generateOneParticularFaul(),
generateOneParticularFaulX(), and
generateOneParticularFaulT() all result in valid WSDL.

The method names that result in valid WSDL lead to a WSDL that has namespaces ns1 and ns2, and the Address type is in ns1. When the method name is generateOneParticularFault() an additional namespace is added to the WSDL, and all references to the Address type should be in namespace ns2, instead of ns1. However in the BadAddressesPayload type there is still a reference to "ns1:Address", and that causes the WSDL to be invalid.

Now that I have a workaround I don't really need an answer, but it sure would be nice to understand what the heck is going on here.

Here is the Java interface that defines the methods. As shown it will lead to invalid WSDL:
package com.shopzilla.services.testframework.exception.server;

import java.util.ArrayList;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

import com.shopzilla.services.testframework.model.Address;


/**
 * A service to demonstrate various types of exceptions.
 */
@SOAPBinding
@WebService(
    name = "ExceptionInterface",
    targetNamespace = "http://exception.test.services.shopzilla.com";
)
public interface ExceptionService {

    /**
     * A simple service that always throws a StringException.
     *
     * @param thePayloadString
     *  the string to store in the payload of the returned exception.
     *
     * @return
     *  in theory a string, in practice this never occurs.
     *
     * @throws StringException
     *  an exception whose payload is the thePayloadString parameter.
     */
    String generateStringFault(String thePayloadString)
            throws StringException;

    /**
     * A simple service that always throws a StringDoubleException.
     *
     * @param stringParam
     *  the string to store in the payload of the returned exception.
     * @param doubleParam
     *  the Double to store in the payload of the returned exception.
     *
     * @throws StringDoubleException
     *  an exception whose payload contains the two input parameters.
     */
    void generateObjectFault(String stringParam, Double doubleParam)
            throws StringDoubleException;

    /**
     * A simple service that always throws an InvalidAddressException.
     *
     * @param problemAddress
     *  the address object to store in the exception that will be
     *  thrown.
     *
     * @throws InvalidAddressException
     *  an exception that contains the input parameter.  It will also
     *  contain a string in the java.lang.Throwable message field.
     */
    void generateInvalidAddressFault(
            @WebParam(name = "problemAddress")  Address problemAddress)
            throws InvalidAddressException;


    /**
     * A simple service that always throws a BadAddressesException.
     *
     * @param badAddresses
     *  a list of Address objects to store in the exception that will be
     * thrown.
     *
     * @throws BadAddressesException
     *  an exception that contains the input parameter.  It will also
     * contain a string in the java.lang.Throwable message field.
     */
    void generateBadAddressesFault(
            @WebParam(name = "badAddresses")
            ArrayList<Address> badAddresses)
            throws BadAddressesException;


    void generateOneParticularFault(
    //void fubar(
    //void genOnePF(
    //void generateOnePF(
    //void generateOneParticularFaul(
    //void generateOneParticularFaulX(
    //void generateOneParticularFaulT(
            String exceptionType) throws
            StringException;
}



Here is the generated (invalid) WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://exception.test.services.shopzilla.com"; xmlns:tns="http://exception.test.services.shopzilla.com"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"; xmlns:ns1="http://server.exception.testframework.services.shopzilla.com"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns3="http://shopzilla.com/services/testframework/exception/server"; xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"; xmlns:ns2="http://shopzilla.com/services/testframework/model"; 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://exception.test.services.shopzilla.com";>
<xsd:element name="generateOneParticularFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="generateOneParticularFaultResponse">
<xsd:complexType/>
</xsd:element>
<xsd:element name="StringException" type="ns1:StringException"/>
<xsd:element name="generateBadAddressesFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="badAddresses" nillable="true" type="ns2:ArrayOfAddress"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="generateBadAddressesFaultResponse">
<xsd:complexType/>
</xsd:element>
<xsd:element name="BadAddressesException" type="ns3:BadAddressesPayload"/>
<xsd:element name="generateInvalidAddressFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="problemAddress" nillable="true" type="ns2:Address"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="generateInvalidAddressFaultResponse">
<xsd:complexType/>
</xsd:element>
<xsd:element name="InvalidAddressException" type="ns2:Address"/>
<xsd:element name="generateStringFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="generateStringFaultResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="generateObjectFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:double"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="generateObjectFaultResponse">
<xsd:complexType/>
</xsd:element>
<xsd:element name="StringDoubleException" type="ns1:StringDoubleException"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.exception.testframework.services.shopzilla.com";>
<xsd:complexType name="StringException">
<xsd:sequence>
<xsd:element minOccurs="0" name="payload" nillable="true" type="ns1:StringPayload"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="StringPayload">
<xsd:sequence>
<xsd:element minOccurs="0" name="theData" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="StringDoubleException">
<xsd:sequence>
<xsd:element minOccurs="0" name="payload" nillable="true" type="ns1:StringDoublePayload"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="StringDoublePayload">
<xsd:sequence>
<xsd:element minOccurs="0" name="doubleData" nillable="true" type="xsd:double"/> <xsd:element minOccurs="0" name="stringData" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://shopzilla.com/services/testframework/model";>
<xsd:complexType name="ArrayOfAddress">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Address" nillable="true" type="ns2:Address"/>
</xsd:sequence>
</xsd:complexType>
<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema"; name="Address">
<xs:sequence>
<xs:element minOccurs="0" name="city" type="xs:string"/>
<xs:element minOccurs="0" name="country" type="xs:string"/>
<xs:element minOccurs="0" name="dateCreated" type="xs:dateTime"/>
<xs:element minOccurs="0" name="id" type="xs:long"/>
<xs:element minOccurs="0" name="phoneNumber" type="xs:string"/>
<xs:element minOccurs="0" name="state" type="xs:string"/>
<xs:element minOccurs="0" name="street1" type="xs:string"/>
<xs:element minOccurs="0" name="street2" type="xs:string"/>
<xs:element minOccurs="0" name="zipCode" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://shopzilla.com/services/testframework/exception/server";>

<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema"; name="BadAddressesPayload">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="payload" nillable="true" type="ns1:Address"/>
</xs:sequence>
</xs:complexType>
</xsd:schema>
  </wsdl:types>
  <wsdl:message name="generateOneParticularFaultResponse">
<wsdl:part name="parameters" element="tns:generateOneParticularFaultResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="StringException">
    <wsdl:part name="StringException" element="tns:StringException">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="InvalidAddressException">
<wsdl:part name="InvalidAddressException" element="tns:InvalidAddressException">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="StringDoubleException">
<wsdl:part name="StringDoubleException" element="tns:StringDoubleException">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateBadAddressesFaultResponse">
<wsdl:part name="parameters" element="tns:generateBadAddressesFaultResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="BadAddressesException">
<wsdl:part name="BadAddressesException" element="tns:BadAddressesException">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateInvalidAddressFaultRequest">
    <wsdl:part name="parameters" element="tns:generateInvalidAddressFault">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateObjectFaultRequest">
    <wsdl:part name="parameters" element="tns:generateObjectFault">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateObjectFaultResponse">
    <wsdl:part name="parameters" element="tns:generateObjectFaultResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateOneParticularFaultRequest">
    <wsdl:part name="parameters" element="tns:generateOneParticularFault">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateStringFaultResponse">
    <wsdl:part name="parameters" element="tns:generateStringFaultResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateBadAddressesFaultRequest">
    <wsdl:part name="parameters" element="tns:generateBadAddressesFault">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateStringFaultRequest">
    <wsdl:part name="parameters" element="tns:generateStringFault">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generateInvalidAddressFaultResponse">
<wsdl:part name="parameters" element="tns:generateInvalidAddressFaultResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ExceptionInterface">
    <wsdl:operation name="generateOneParticularFault">
<wsdl:input name="generateOneParticularFaultRequest" message="tns:generateOneParticularFaultRequest">
    </wsdl:input>
<wsdl:output name="generateOneParticularFaultResponse" message="tns:generateOneParticularFaultResponse">
    </wsdl:output>
      <wsdl:fault name="StringException" message="tns:StringException">
    </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateBadAddressesFault">
<wsdl:input name="generateBadAddressesFaultRequest" message="tns:generateBadAddressesFaultRequest">
    </wsdl:input>
<wsdl:output name="generateBadAddressesFaultResponse" message="tns:generateBadAddressesFaultResponse">
    </wsdl:output>
<wsdl:fault name="BadAddressesException" message="tns:BadAddressesException">
    </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateInvalidAddressFault">
<wsdl:input name="generateInvalidAddressFaultRequest" message="tns:generateInvalidAddressFaultRequest">
    </wsdl:input>
<wsdl:output name="generateInvalidAddressFaultResponse" message="tns:generateInvalidAddressFaultResponse">
    </wsdl:output>
<wsdl:fault name="InvalidAddressException" message="tns:InvalidAddressException">
    </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateStringFault">
<wsdl:input name="generateStringFaultRequest" message="tns:generateStringFaultRequest">
    </wsdl:input>
<wsdl:output name="generateStringFaultResponse" message="tns:generateStringFaultResponse">
    </wsdl:output>
      <wsdl:fault name="StringException" message="tns:StringException">
    </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateObjectFault">
<wsdl:input name="generateObjectFaultRequest" message="tns:generateObjectFaultRequest">
    </wsdl:input>
<wsdl:output name="generateObjectFaultResponse" message="tns:generateObjectFaultResponse">
    </wsdl:output>
<wsdl:fault name="StringDoubleException" message="tns:StringDoubleException">
    </wsdl:fault>
    </wsdl:operation>
  </wsdl:portType>
<wsdl:binding name="ExceptionServiceHttpBinding" type="tns:ExceptionInterface"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="generateOneParticularFault">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="generateOneParticularFaultRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="generateOneParticularFaultResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="StringException">
        <wsdlsoap:fault name="StringException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateBadAddressesFault">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="generateBadAddressesFaultRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="generateBadAddressesFaultResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="BadAddressesException">
        <wsdlsoap:fault name="BadAddressesException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateInvalidAddressFault">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="generateInvalidAddressFaultRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="generateInvalidAddressFaultResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="InvalidAddressException">
        <wsdlsoap:fault name="InvalidAddressException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateStringFault">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="generateStringFaultRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="generateStringFaultResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="StringException">
        <wsdlsoap:fault name="StringException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
    <wsdl:operation name="generateObjectFault">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="generateObjectFaultRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="generateObjectFaultResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
      <wsdl:fault name="StringDoubleException">
        <wsdlsoap:fault name="StringDoubleException" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ExceptionService">
<wsdl:port name="ExceptionServiceHttpPort" binding="tns:ExceptionServiceHttpBinding"> <wsdlsoap:address location="http://localhost:8080/exception-xfire/services/ExceptionService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


-Steve


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

   http://xircles.codehaus.org/manage_email

Reply via email to