Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.ws.Service; /** * This class creates SOAP clients from WDSL and a Java interface. * See http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC5.html * &lt;p&gt; * Consider the following sample usage: * &lt;pre&gt; URL wsdl = new URL("http://localhost:8080/calc/calc?wsdl"); String serviceName = "CalculatorWSService"; String nameSpaceURI = "http://calculator.me.org/"; String portName = "CalculatorWSPort"; Calculator calc = SOAPClient.newInstance(wsdl, nameSpaceURI, serviceName, portName, Calculator.class); * &lt;/pre&gt; * @author Curt */ public final class SOAPClient { /** * Create a new SOAPClient, given the specified parameters. * @param url where the WSDL is * @param nameSpaceUri * @param serviceName * @param portName * @param face interface to use * @return an object that implements the interface and is connected to the server */ public static &lt;T&gt; T newInstance( URL url, String nameSpaceUri, String serviceName, String portName, Class&lt;T&gt; face) throws RemoteException { try { QName portQname = new QName(nameSpaceUri, portName); QName serviceQname = new QName(nameSpaceUri, serviceName); Service service = Service.create(url, serviceQname); T remote = service.getPort(portQname,face); T proxy = face.cast(remote); return proxy; } catch (Throwable t) { String message = "Connecting to URL=" + url + " name space URI= "+ nameSpaceUri + " service name=" + serviceName + " interface=" + face + " port=" + portName; throw new RemoteException(message,t); } } /** * Don't specify the portName and trust that the service will do it. */ public static &lt;T&gt; T newInstance( URL url, String nameSpaceUri, String serviceName, Class&lt;T&gt; face) throws MalformedURLException, RemoteException { QName serviceQname = new QName(nameSpaceUri, serviceName); Service service = Service.create(url, serviceQname); T remote = service.getPort(face); T proxy = face.cast(remote); return proxy; } } </code></pre> <p>The underdocumented Service class might provide what you're looking for.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload