Apache SOAP Client
First, use the classes provided by Apache SOAP to test the service. Apache provides a powerful abstraction in its Call class. In Call, you identify the service name you want to access, its location, and its arguments:
Listing 19.3. TimeServerClient, an Apache SOAP Client for the TimeServer SOAP Endpoint.
package com.sams.jws.chapter19; import java.util.Vector; import java.net.URL; import org.apache.soap.Constants; import org.apache.soap.Fault; import org.apache.soap.SOAPException; import org.apache.soap.rpc.Call; import org.apache.soap.rpc.Parameter; import org.apache.soap.rpc.Response; public class TimeServerClient { public static void main(String[] args) throws Exception { URL url = new URL("http://localhost:8080/soap/servlet/rpcrouter"); ... |
Get Java™ Web Services Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.