Greetings,
I've got RedHat version 7.3. I recently downloaded AXIS
(xml-axis-beta2.tar.gz,
04/29/02) for the first time, and have a question.
Is wsdl2java code handling one-way remote calls correctly? With the
following
scenario, it throws an exception for void returns. My understanding is
that the
client should not wait for a response from a one-way call. Yet the stub
code
generated by wsdl2java appears to violate this. However, I am new to SOAP,
so I'll just submit the following as grist for the mill. (Probably I
could avoid a lot
of problems anyway by steering clear of one-way calls.)
Thanks,
Jack Crosscope
[EMAIL PROTECTED]
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// ClipsInterface.java -- for generating WSDL
public interface ClipsInterface
{
public void clearClips(); // offending case, void return
...
};
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> java2wsdl >>>
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
<definitions targetNamespace="ClipsInterface"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="ClipsInterface" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
<message name="clearClips"/>
...
<portType name="ClipsInterface">
<operation name="clearClips">
<input message="tns:clearClips" name="clearClips"/>
</operation>
...
<binding name="ClipsInterfaceSOAPBinding" type="tns:ClipsInterface">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="clearClips">
<soap:operation soapAction="" style="rpc"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="ClipsInterface" use="encoded"/>
</input>
</operation>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> wsdl2java >>>
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
public class ClipsInterfaceSOAPBindingStub extends
org.apache.axis.client.Stub implements clips.client.ClipsInterface {
public void clearClips() throws java.rmi.RemoteException{
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call call = createCall();
call.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
call.setUseSOAPAction(true);
call.setSOAPActionURI("");
call.setOperationStyle("rpc");
call.setOperationName(new
javax.xml.rpc.namespace.QName("ClipsInterface", "clearClips"));
??? >>> Object resp = call.invoke(new Object[] {}); // line 99.
Expecting one-way return?
if (resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)resp;
}
}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
My client code (modeled after junit.framework example):
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
public void test() {
clips.client.ClipsInterface binding;
try {
binding = new
clips.client.JavaClassesLocator().getClipsInterface();
}
catch (javax.xml.rpc.ServiceException jre) {
jre.printStackTrace();
return;
}
try {
long ivalue = 0;
java.lang.String svalue = null;
ivalue = binding.openTraceFile("clipsClientJ.trc");
binding.clearClips(); // throws exception
...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Executed ANT test target in build.xml in netbeans ide on redhat 7.3 linux:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
init:
compile:
Compiling 1 source file to /home/jack/tmp/ClipsSOAP/java
test:
org.xml.sax.SAXParseException: The markup in the document preceding the
root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document preceding the
root element must be well-formed.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java)
at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java)
at
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java)
at javax.xml.parsers.SAXParser.parse(SAXParser.java)
at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:202)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:428)
at org.apache.axis.client.Call.invoke(Call.java:1919)
at org.apache.axis.client.Call.invoke(Call.java:1690)
at org.apache.axis.client.Call.invoke(Call.java:1608)
at org.apache.axis.client.Call.invoke(Call.java:1169)
at
clips.client.ClipsInterfaceSOAPBindingStub.clearClips(ClipsInterfaceSOAPBindingStub.java:99)
at clips.client.ClipsClient.test(ClipsClient.java:27)
at clips.client.ClipsClient.main(ClipsClient.java:42)
BUILD SUCCESSFUL
Total time: 5 seconds
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The above exception has appeared for me only with one-way rpc calls.
The prior client call to openTraceFile(), which returns an integer,
works fine.
I checked, and the trace file was truly created and written by the server.
...EOM