Hi all,
I have got a problem using the classes that were generated bei
WSDL2JAVA. As far as I can see, the wsdl document that I got offered
looks quite fine.
That wsdl document defines an operation 'DocumentGetCollection' which
takes one parameter (DocumentGetCollectionRequest) and returns a
DocumentGetCollectionResponse object.
So far so good, but when I try to invoke that method I get the following
error message:
AxisFault
faultCode: Server
faultSubcode:
faultString: method 'DocumentGetCollectionRequest' not
defined in service
faultActor:
faultNode:
faultDetail:
{}soapVal: null
method 'DocumentGetCollectionRequest' not defined in service
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
va:260)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
a:169)
at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Deseriali
zationContextImpl.java:1015)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1675)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1926)
at
org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654)
at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at
org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializatio
nContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at
SoapBindingStub.documentGetCollection(SoapBindingStub.java:365)
at client.TestClient.main(TestClient.java:29)
The statement that is given in the faultString line is driving me a bit
crazy. Of course it is perfectly right, that there is no such method
'DocumentGetCollectionRequest'. But I was never invoking such a thing!
BTW: The server side seems to work. I contacted the developer of that
service and he said that he had no problems with his generated C#
client.
The client code that caused this error looks like this:
*snip*
26: _DocumentGetCollectionRequest docReq = new
_DocumentGetCollectionRequest();
27: docReq.setOnlyUnread(true);
28: docReq.setOutboxList(true);
29: _DocumentGetCollectionResponse docResp =
stub.documentGetCollection(docReq);
*snip*
The method in the generated stub goes like this:
Public _DocumentGetCollectionResponse
documentGetCollection(_DocumentGetCollectionRequest parameter) throws
java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("urn:#DocumentGetCollection");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS
);
_call.setOperationName(new javax.xml.namespace.QName("",
"DocumentGetCollection"));
setRequestHeaders(_call);
setAttachments(_call);
java.lang.Object _resp = _call.invoke(new java.lang.Object[]
{parameter});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (_DocumentGetCollectionResponse) _resp;
} catch (java.lang.Exception _exception) {
return (_DocumentGetCollectionResponse)
org.apache.axis.utils.JavaUtils.convert(_resp,_DocumentGetCollectionResp
onse.class);
}
}
}
And the important lines in the wsdl document are as follows:
*snip*
<!--== Operation DocumentGetCollection-->
<xs:element name="DocumentGetCollectionRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="OnlyUnread"
type="xs:boolean" default="true"/>
<xs:element name="OutboxList"
type="xs:boolean" default="false"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DocumentGetCollectionResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Document"
type="y:Document" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
*snip*
<message name="DocumentGetCollectionSoapIn">
<part name="parameter"
element="y:DocumentGetCollectionRequest"/>
</message>
<message name="DocumentGetCollectionSoapOut">
<part name="parameter"
element="y:DocumentGetCollectionResponse"/>
</message>
*snip*
<operation name="DocumentGetCollection">
<input message="y:DocumentGetCollectionSoapIn"/>
<output message="y:DocumentGetCollectionSoapOut"/>
</operation>
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="DocumentGetCollection">
<soap:operation
soapAction="urn:#DocumentGetCollection"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
*snip*
<service name=" strictly confidental service name...">
<port name="SoapPort" binding="y:SoapBinding">
<soap:address location="strictly confidental
URL..."/>
</port>
</service>