SHARE
Facebook X Pinterest WhatsApp

Apache SOAP 2.2 Overview Page 11

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Processing the SOAP Response

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()); } 

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

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.