The envelope returned by the server is processed by the Response object. The object contains the SOAP XML stream, and therefore all the characteristics of the response. The stream is processed by the Parameter class methods. By default, the Parameter object processes all the simple data types (e.g., Integer, Long, and String). The calculator service sends back a Long type, and therefore has no special coding.
//construction of SOAP message ... Response resp = null; try{ resp = call.invoke
(url, soapActionField); } catch( SOAPException e ){ System.err.println("Caught
SOAPException (" + e.getFaultCode() + "): " + e.getMessage()); System.exit(-1);
} // Response retrieval. if( !resp.generatedFault() ){ Parameter ret = resp.getReturnValue();
Object value = ret.getValue(); System.out.println(value);
} else{ Fault fault = resp.getFault(); System.err.println("Generated fault: ");
System.out.println (" Fault Code = " + fault.getFaultCode());
System.out.println (" Fault String = " + fault.getFaultString()); } Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.