Servers Apache SOAP 2.2 Overview Page 11

Apache SOAP 2.2 Overview Page 11




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

Latest Posts

Get-MsolUser PowerShell Attributes & Properties

This article has been updated for 2020. Please note that WAAD was retired in 2018, but the cmdlets listed in this article are still...

Microsoft Azure PowerShell Scripts and Commands

Using PowerShell scripts and commands for quickly executing tasks in Windows operating systems offers a number of benefits over traditional scripting languages, such as...

Microsoft Hyper V Review

Microsoft Hyper-V: The Bottom line Microsoft Hyper-V lagged behind VMware's virtualization tool, one of the most popular tools in the space, when it was first...

Best Cloud Based Services & Companies

Any company that’s delayed introducing cloud-based software into their infrastructure needs to consider leveraging these new technologies to reap all the benefits cloud computing...

Best Load Balancers for 2020

The best load balancers are able to provide either hardware or software-based load balancing to ensure maximum service availability by offering network traffic distribution...

Related Stories