You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Paul Duffy <pa...@cisco.com> on 2001/03/23 16:57:32 UTC
Re: SOAP Exception = SOAP-ENV:Client, A
'http://schemas.xmlsoap.org/soap/envelope/:Fault' element must contain
a: 'faultcode' element.
Make sure you're using xerces 1.2.3 (which is not the latest
release). There appears to be problems with the later versions. I was
using 1.3.1, had this problem, went back to 1.2.3, problem gone.
I filed a bug with Xerces J.
Cheers,
At 03:19 PM 3/23/01 +0100, roberto gagliardi wrote:
>Hi everybody. I'm a rookie with SOAP technology. I got problems while
>running a call to a service on my tomcat web-server.
>
>SERVER CODE
>public class Exchange{
>
> public float getRate( String country1, String country2 ) {
> System.out.println( "getRate( " + country1 + ", " + country2 + " )");
> return 144.52F;
> }
>
>}
>
>
>
>CLIENT CODE
>public class Client {
>
> public static void main(String[] args) throws Exception{
> URL url = new URL("http://192.168.1.72:8080/soap/servlet/rpcrouter");
> String urn = "urn:demo1:exchange";
>
> Call call = new Call();
>
> call.setTargetObjectURI(urn);
> call.setMethodName("getRate");
> call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>
> Vector param = new Vector();
> param.addElement(new Parameter("country1", String.class, "USA",
> null));
> param.addElement(new Parameter("country2", String.class,
> "japan", null));
>
> call.setParams(param);
>
> try{
> System.out.println("Invoke service \n" + "URL = " + url + "\n
> URN = " + urn);
> Response response = call.invoke(url, "");
> if(!response.generatedFault()){
> Parameter result = response.getReturnValue();
> System.out.println("Result = " + result.getValue());
> }else{
> Fault f = response.getFault();
> System.err.println("Fault = " + f.getFaultCode() + ", " +
> f.getFaultString());
> }
> }catch(SOAPException soape){
> System.err.println("SOAP Exception = " + soape.getFaultCode()
> + ", " + soape.getMessage());
> }
>
> }
>
>}
>
>
>When I run the Client I have exactly this output on dos prompt:
>
>Invoke service
>URL =
><http://192.168.1.72:8080/soap/servlet/rpcrouter>http://192.168.1.72:8080/s
>oap/servlet/rpcrouter
> URN = urn:demo1:exchange
>SOAP Exception = SOAP-ENV:Client, A
>'http://schemas.xmlsoap.org/soap/envelope/:Fault' element must contain a:
>'faultcode' element.
>
>Any idea on how to fix this Exception?
>Excuse me for my English, I hope you understood.
>Thanks in advance.
>Roberto.
>
*********************************************************
Paul B Duffy paduffy@cisco.com
Cisco Systems, Inc.
********************************************************