XML & Web services: DII & JAX-RPC

  1. DII & JAX-RPC (4 messages)

    Oups, here is the complete mail...


    I have difficulties understanding the interest of DII invocation.

    As I understand it, with DII invocation we don't have to known at dev-time the service definition (port, binding and event portType).

    How can we invoke a service accepting complex type as parameters or returning complex data using DII if we don't have the type definition at dev-time (we don't known in advance the WSDL) ?

    Suppose we have the following scenario :

    I'm developping an application which can browse a UDDI repository, which can then browse the WSDL definitions and which can invoke the Web services in those WSDL docs.

    If I have a service accepting complexTypes as parameters, how can I create the Java corresponding type at runtime ?

    The JAX RPC tutorial only shows services with simple types arguments and return types.

    Threaded Messages (4)

  2. JAX-RPC DII is pretty useless[ Go to top ]

    It's impossible to write 100% vendor-neutral fully dynamic client that invokes WS-I compliant services. Hopefully future JAX-RPC specs will address these.

    Meanwhile most vendor stacks come with built in serializers for converting SOAPElement types into xml. So you can dynamically construct SOAPElement tree and pass it as an argument for Call. And configure the client to use the right proprietary serializer (this code would be different for each vendor).

    But maybe it's not worth all the trouble and you are better off with picking single SOAP runtime and embedding it into your app. This way you would get additional features like basic WS-Security support.
  3. JAX-RPC DII is pretty useless[ Go to top ]

    Ok, it's really more clear for me. Making a real dynamic invocation would then require for example :
    1. using WSDL4J for parsing the WSDL files,
    2. and with WSIF for compiling it into Java and invoking the Web Service (or creating a library which uses WSDL metadata from WSDL4J and invokes Web Services using a messaging API).

    Thanks George
  4. JAX-RPC DII is pretty useless[ Go to top ]

    Do you have any sample for the same, George ?

    If yes please share.

    Thanks Kartik
  5. JAX-RPC DII is pretty useless[ Go to top ]

    I've never seen samples using complex objets, always using silple types such as string, for instance (from IBM website, I've never tested it) :

    String namespace = "http://pag.tmp";
    String portName = "Hello";
    QName portQN = new QName(namespace, portName);
    String operationName = "getGreeting";

    Call call = service.createCall();
    call.setOperationName(new QName(namespace, operationName));
    call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");
    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "wrapped");
    call.addParameter("param1", <xsd:string>,ParameterMode.IN);
    Object[] inParams = new Object[] {"Jane"};
    String ret = (String) call.invoke(inParams);