You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Thomas Pang <th...@db.com> on 2001/05/21 12:42:51 UTC
Apache SOAP and Axis- NO NEED TO HELP ANYMORE
Hi all again,
We've managed to crack this one after all.
Thanks Thomas
p.s. it was down to no "SOAPAction"
---------------------- Forwarded by Thomas Pang on 21/05/2001 10:40 ---------------------------
From: Thomas Pang on 20/05/2001 20:57
To: axis-dev@xml.apache.org
cc:
Subject: Apache SOAP and Axis
Hi all,
I have managed to install the Axis Servlet under Tomcat and I have even written a service, which
can be invoked using an Axis Client. However, when I try an Apache SOAP client I get the following error:
Ouch, the call failed:
Fault Code = http://xml.apache.org/axis/:Server.error
Fault String = Can't find '' handler
I was under the assumption that any SOAP client should be able to talk to the Axis Server.... is this a fair
assumption? What could be wrong with what I am doing?
Thanks in advance
Thomas
p.s. here's the SOAP client I have wrriten:
import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class soapCreateSecurity {
static XMLParserLiaison xpl = new XercesParserLiaison ();
public static void main (String[] args) throws Exception {
int offset = 3 - args.length;
String encodingStyleURI = Constants.NS_URI_SOAP_ENC;
URL url = new URL ("http://10.128.139.18:8080/servlet/AxisServlet");
File file = new File ( "/home/pangto/vanilla.xml" );
int length = ( int ) file.length();
byte[] data = new byte [ length ];
FileInputStream file_input_stream = new FileInputStream ( file );
file_input_stream.read(data);
file_input_stream.close();
String xml_request = new String ( data );
xml_request = xml_request.replace ('\n',' ').trim();
// Build the call.
Call call = new Call ();
call.setTargetObjectURI ("urn:instrumentServer");
call.setMethodName ("createSecurity");
call.setEncodingStyleURI(encodingStyleURI);
Vector params = new Vector ();
params.addElement (new Parameter("arg0", String.class, xml_request, null));
call.setParams (params);
// make the call: note that the action URI is empty because the
// XML-SOAP rpc router does not need this. This may change in the
// future.
Response resp = call.invoke (/* router URL */ url, /* actionURI */ "" );
// Check the response.
if (resp.generatedFault ()) {
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ());
System.out.println (" Fault String = " + fault.getFaultString ());
} else {
Parameter result = resp.getReturnValue ();
System.out.println (result.getValue ());
}
}
}
--
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.