Naresh S [
http://community.jboss.org/people/nareshs] created the discussion
"Invalid WSDL (JBOSS EAP 5.0 )"
To view the discussion, visit:
http://community.jboss.org/message/549458#549458
--------------------------------------------------------------
*Base Class*
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "fooResponse", namespace = "
http://a.ws.test/
http://a.ws.test/")
public class BaseResponse {
@XmlElement(required=true)
private String hello;
public String getHello() {
return hello;
}
public void setHello(String hello) {
this.hello = hello;
}
}
*Standard Response Class*
@XmlType(name = "fooResponse", namespace = "
http://b.ws.test/
http://b.ws.test/")
@XmlAccessorType(XmlAccessType.+FIELD+)
*public* *class* StandardResponse *extends* BaseResponse {
}
*Fault Message*
@WebFault(name="TestFaultMessage", targetNamespace="
http://b.ws.test/
http://b.ws.test/")
*public* *class* TestFaultMessage *extends* Exception {
}
*My Service*
@WebService(endpointInterface="test.ws.MyServiceInterface",name =
"MyService", targetNamespace="
http://ws.test http://ws.test")
*public* *class* MyService *implements* MyServiceInterface{
@WebMethod
*public* @WebResult StandardResponse foo() *throws* TestFaultMessage{
*return* *new* StandardResponse();
}
}
*Interface*
@WebService(name = "MyService", targetNamespace="
http://ws.test
http://ws.test")
*public* *interface* MyServiceInterface {
@WebMethod
*public* @WebResult StandardResponse foo() *throws* TestFaultMessage;
}
When the WSDL is generated via Servlet i.e., using ?wsdl
I am getting the following
{code:xml}
<definitions name='MyServiceService' targetNamespace='
http://ws.test
http://ws.test' xmlns='
http://schemas.xmlsoap.org/wsdl/
http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='
http://ws.test/ http://ws.test/'
xmlns:ns2='
http://b.ws.test/ http://b.ws.test/' xmlns:ns3='
http://a.ws.test/
http://a.ws.test/' xmlns:soap='
http://schemas.xmlsoap.org/wsdl/soap/
http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='
http://ws.test
http://ws.test' xmlns:xsd='
http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema'>
<types>
<xs:schema targetNamespace='
http://b.ws.test/ http://b.ws.test/'
version='1.0' xmlns:ns1='
http://a.ws.test/ http://a.ws.test/'
xmlns:ns2='
http://ws.test http://ws.test' xmlns:xs='
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema'>
<xs:import namespace='
http://a.ws.test/'/ http://a.ws.test/'/>
<xs:import namespace='
http://ws.test'/ http://ws.test'/>
<xs:element name='TestFaultMessage'
type='ns2:TestFaultMessage'/>
<xs:complexType name='fooResponse'>
<xs:complexContent>
<xs:extension base='ns1:fooResponse'>
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
<xs:schema targetNamespace='
http://a.ws.test/ http://a.ws.test/'
version='1.0' xmlns:xs='
http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema'>
<xs:complexType name='fooResponse'>
<xs:sequence>
<xs:element name='hello' type='xs:string'/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema targetNamespace='
http://ws.test http://ws.test'
version='1.0' xmlns:ns1='
http://ws.test/ http://ws.test/' xmlns:xs='
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema'>
<xs:import namespace='
http://ws.test/'/ http://ws.test/'/>
<xs:element name='foo' nillable='true' type='ns1:foo'/>
<xs:element name='fooResponse' nillable='true'
type='ns1:fooResponse'/>
<xs:complexType name='TestFaultMessage'>
<xs:sequence>
<xs:element minOccurs='0' name='message'
type='xs:string'/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema targetNamespace='
http://ws.test/ http://ws.test/'
version='1.0' xmlns:ns1='
http://b.ws.test/ http://b.ws.test/'
xmlns:tns='
http://ws.test/ http://ws.test/' xmlns:xs='
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema'>
<xs:import namespace='
http://b.ws.test/'/ http://b.ws.test/'/>
<xs:element name='foo' type='tns:foo'/>
<xs:element name='fooResponse' type='tns:fooResponse'/>
<xs:complexType name='foo'>
<xs:sequence/>
</xs:complexType>
<xs:complexType name='fooResponse'>
<xs:sequence>
<xs:element minOccurs='0' name='return'
type='ns1:fooResponse'/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name='MyService_fooResponse'>
<part element='tns:fooResponse' name='fooResponse'></part>
</message>
<message name='TestFaultMessage'>
<part element='tns:TestFaultMessage'
name='TestFaultMessage'></part>
</message>
<message name='MyService_foo'>
<part element='tns:foo' name='foo'></part>
</message>
<portType name='MyService'>
<operation name='foo' parameterOrder='foo'>
<input message='tns:MyService_foo'></input>
<output message='tns:MyService_fooResponse'></output>
<fault message='tns:TestFaultMessage'
name='TestFaultMessage'></fault>
</operation>
</portType>
<binding name='MyServiceBinding' type='tns:MyService'>
<soap:binding style='document' transport='
http://schemas.xmlsoap.org/soap/http'/ http://schemas.xmlsoap.org/soap/http'/>
<operation name='foo'>
<soap:operation soapAction=''/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
<fault name='TestFaultMessage'>
<soap:fault name='TestFaultMessage' use='literal'/>
</fault>
</operation>
</binding>
<service name='MyServiceService'>
<port binding='tns:MyServiceBinding' name='MyServicePort'>
<soap:address location='
http://cvdxe96533-lh03:8080/TSMVRClient/MyService'/
http://cvdxe96533-lh03:8080/TSMVRClient/MyService'/>
</port>
</service>
</definitions>
{code}
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/549458#549458]
Start a new discussion in JBoss Web Services at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]