1 Reply Latest reply on Jul 25, 2006 1:19 PM by Simone Taliercio

    [JAX-RPC] DII doesn't work. [Help]

    Simone Taliercio Newbie

      Hi JBoss Community,

      With the following WSDL, how is source code of a DII client? :_(

      I've created many example but they don't work. Web service is deployed in
      JBoss 4.0.4 GA.
      ServiceEndpointAddress is http://notebook:8080/NewVersionAll/HelloBean?wsdl

      My last DII Client obtain this error:

      operation style: "rpc" not supported
      at com.sun.xml.rpc.client.dii.BasicCall.unsupportedOperationStyleException(BasicCall.java:566)
      at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:498)
      at src.clients.DIIClient.main(DIIClient.java:55)

      I've tried to change "rpc" with "document" but without success.
      Following client code:

      package src.clients;
      import java.net.URL;
      import javax.xml.rpc.Service;
      import javax.xml.rpc.ServiceFactory;
      import javax.xml.rpc.Call;
      import javax.xml.rpc.JAXRPCException;
      import javax.xml.namespace.QName;
      import javax.xml.rpc.ParameterMode;
      import javax.xml.rpc.encoding.XMLType;
      public class DIIClient {
       public static void main(String[] args) {
       try {
       // Create a service class with no WSDL information. You
       // still must know something about the WSDL, however: the
       // service's name.
       QName serviceName = new QName(
       ServiceFactory factory = ServiceFactory.newInstance();
       Service service = factory.createService(serviceName);
       // Now create a dynamic Call object from this service.
       // This call object is not yet associated with any
       // operation. We'll do that below.
       Call call = service.createCall();
       // Next, build up the information about the operation...
       // The operation name
       QName operationName = new QName("http://org.jboss.ws/samples/jsr181ejb","reply");
       // The input parameter
       "String_1", // parameter name
       XMLType.XSD_STRING, // parameter XML type QName
       String.class, // parameter Java type class
       ParameterMode.IN); // parameter mode
       // The return
       // The operation is an RPC-style operation.
       // The encoding style property value comes from the
       // binding's operation's input clauses encodingStyle
       // attribute. Note that, in this case, this call is not
       // really necessary - the value we're setting this
       // property to is the default.
       // The target endpoint
       String[] params = {"ABC"};
       String result = (String) call.invoke(params);
       catch (Throwable t) {
       String urlstr = "http://notebook:8080/NewVersionAll/HelloBean?wsdl";
       String argument = "Aaaah!";
       System.out.println("Contacting webservice at " + urlstr);
       URL url = new URL(urlstr);
       String ns = "http://org.jboss.ws/samples/jsr181ejb";
       QName qname = new QName(ns, "Risposta");
       QName port = new QName(ns, "EndpointInterface");
       QName operation = new QName(ns, "reply");
       ServiceFactory factory = ServiceFactory.newInstance();
       Service service = factory.createService(url, qname);
       Call call = service.createCall(port, operation);
       System.out.println("hello.hello(" + argument + ")");
       System.out.println("output:" + call.invoke(new Object[] {argument}));
       }catch(Exception e){

      Thanks to everybody!