JAX-RPC client with JDeveloper 12c

Hello,
It's the first time I use jax-rpc (I'm used to jax-ws) and looking for help.
I need to create a client for a JAX-RPC web service using JDeveloper 12c.
The customer provided to me a WSDL file (I don't have access to the webservice yet). In JDeveloper I created as usual a "Web Service Client and Proxy" providing that wsdl file, but I think the generated code is for a JAX-WS (since there are @WebMethod, @WebServiceClient and @WebService notations that I understood should not be present in JAX-RPC clients.
Can anyone point me to some documentation about JAX-RPC client developing in JDeveloper 12?
Thank you,
Marco

To make things a little more clearer, this is a post of the error gotten at runtime...
        java.lang.NoSuchMethodError: java.util.Collections.emptyList()Ljava/util/List;
        at com.sun.xml.messaging.saaj.soap.MessageImpl.<clinit>(MessageImpl.java:755)
        at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:47)
        at com.sun.xml.rpc.soap.message.SOAPMessageContext.createMessage(SOAPMessageContext.java:137)
        at com.sun.xml.rpc.client.StreamingSenderState.<init>(StreamingSenderState.java:30)
        at com.sun.xml.rpc.client.StubBase._start(StubBase.java:92)
        at mck.practise.oracle.plsql.PlsqlService_Stub.sayHello(PlsqlService_Stub.java:54)
        at mck.practise.oracle.plsql.HelloWorld.sayRPCHello(HelloWorld.java:34)
        at mck.practise.oracle.plsql.HelloWorld.main(HelloWorld.java:22)The suprising thing is that if I change the application's java platform from JDK 1.4 to Java 5 using the netbeans projects property window, everything works fine.
Can anyone still suggest on this.
Regards,

Similar Messages

  • Deploying JAX-RPC Client for client-side application

    I have a java Swing client side application that I am attempting to integrate web services capabilities into. The web services were already written (new to web services myself), I am just calling them. Using Oracle's JDeveloper I managed to create proxies for the web services and to call them just fine, once I added the JAX-RPC Client library to my project.
    My only issue is how to deploy. Again within the development environment all works perfectly. I tried references to all the jar files identified by the Oracle JAX-RPC Client library to know luck. I've referenced other jar files I use for deployment with no issues.
    Anyone created standalone applciations before that call web services? How did you deploy the web service related libraries.
    I'm using JDeveloper 10.1.3.3.0 with Java 1.5.0_06.
    I appreciate any guidance provided.

    I found a solution, but it shouldn't have been that difficult. JDeveloper provides a view of what JARs are part of a library. I used that as a starting point of what JARs might be required for my instance. I switched to linking to the individual JARs within their JDeveloper installed locations directly instead of the single library. I then systematically starting removing them one-by-one from my list to determine which were actually being used in my implementation. I did this because there were way too many to deploy. Once that was done I created a separate directory for holding the required JARs files local to my application.
    Lastly, I had to take care of any internal references within the JARs that may link to other JAR files. So I opened each JAR and looked at its manifest and copied those files over. Then I repeated the steps of deternmining if they were really necessary and copying over other internal references until I had the complete list.
    In the end I ended up with a considerable smaller list of JARs then if I had just assumed all JARs within the library and their references. However, it was much more difficult then it needed to be.

  • JAX-RPC client access a JAX-WS services

    Hello all,
    There is a little problem I had with webservices and googling for a solution has not help so far.
    I am accessing a JAX-WS webservice from a J2SE 1.4.2 JAX-RPC client application and getting a NoSuchMethodError error from one of the stubs at runtime. The method call is rather a HelloWorld concept but it has not been possible.
    This are the step I took (I am using netbeans 6.0).
    1. I downloaded the JAX-RPC plugin on netbeans
    2. Download the stubs using the wsdl url. I am using the netbeans wizard for this process.
    3. Write my code for get a handle to the endpoint. Using the ServiceFactory.loadClass().
    4. Call the method on the
    Can anyone please help me.

    To make things a little more clearer, this is a post of the error gotten at runtime...
            java.lang.NoSuchMethodError: java.util.Collections.emptyList()Ljava/util/List;
            at com.sun.xml.messaging.saaj.soap.MessageImpl.<clinit>(MessageImpl.java:755)
            at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:47)
            at com.sun.xml.rpc.soap.message.SOAPMessageContext.createMessage(SOAPMessageContext.java:137)
            at com.sun.xml.rpc.client.StreamingSenderState.<init>(StreamingSenderState.java:30)
            at com.sun.xml.rpc.client.StubBase._start(StubBase.java:92)
            at mck.practise.oracle.plsql.PlsqlService_Stub.sayHello(PlsqlService_Stub.java:54)
            at mck.practise.oracle.plsql.HelloWorld.sayRPCHello(HelloWorld.java:34)
            at mck.practise.oracle.plsql.HelloWorld.main(HelloWorld.java:22)The suprising thing is that if I change the application's java platform from JDK 1.4 to Java 5 using the netbeans projects property window, everything works fine.
    Can anyone still suggest on this.
    Regards,

  • How can I change namespace prefix for JAX-RPC client request?

    I'm creating a JAX-RPC client to invoke a RPC/encoded web service. The service was generated from a ColdFusion program and for some reason when the SOAP namespace prefix is anything but "soapenv" it returns text/html instead of text/xml. Currently the client is sending requests with the prefix "env" and I'd like to change it to "soapenv".
    I created a type of javax.xml.rpc.handler.GenericHandler and attempted to do the follow:
    @Override public boolean handleRequest(MessageContext p1) {
         SOAPMessage msg = ((SOAPMessageContext) p1).getMessage(); 
         try {
              SOAPPart part = msg.getSOAPPart();
              SOAPEnvelope envelope = part.getEnvelope(); 
              envelope.setPrefix("soapenv"); 
              msg.saveChanges(); 
         } catch(SOAPException ex) {
              // TODO
              return false;
         return true;
    However I get the following exception:
    java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [UNIMPLEMENTED ] FaultActor [null] Detail [<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.AssertionError: UNIMPLEMENTED
    at weblogic.xml.domimpl.NodeImpl.setPrefix(NodeImpl.java:173)
    at test.MyHandler.handleRequest(MyHandler.java:33)
    at weblogic.wsee.handler.JaxrpcHandlerChain.handleRequest(JaxrpcHandlerChain.java:58)
    at weblogic.wsee.ws.dispatch.server.JaxrpcChainHandler.handleRequest(JaxrpcChainHandler.java:102)
    at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
    at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)
    at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:132)
    at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87)
    at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:341)
    at test.Approvedsuppliers_Wrap_Stub.echo(Approvedsuppliers_Wrap_Stub.java:31)
    at test.Approvedsuppliers_WrapPortClient.echo(Approvedsuppliers_WrapPortClient.java:130)
    at test.Approvedsuppliers_WrapPortClient.main(Approvedsuppliers_WrapPortClient.java:43)
    Is there any workaround? I appreciate any feedback.
    Thanks, Bill

    What I ended up doing is converting the SOAP message to a string, replacing the namespace prefix and converting it back to a SOAP message.
    @Override
       public boolean handleRequest(MessageContext messageContext) {
          SOAPMessageContext soapMessageContext = (SOAPMessageContext) messageContext;
          SOAPMessage soapMessage = soapMessageContext.getMessage();
          String soapString = convertSOAPToString(soapMessage);
          soapString = soapString.replaceAll("env:", "soapenv:");
          soapString = soapString.replaceAll("xmlns:env", "xmlns:soapenv");
          SOAPMessage newSoapMessage = convertStringToSOAP(soapString);
          MimeHeaders mimeHeader = newSoapMessage.getMimeHeaders();
          mimeHeader.setHeader("SOAPAction", "");
          soapMessageContext.setMessage(newSoapMessage);
          return true;
       private String convertSOAPToString(SOAPMessage soapMessage) {
          StringWriter stringWriter = null;
          try {
             stringWriter = new StringWriter();
             StreamResult streamResult = new StreamResult(stringWriter);
             TransformerFactory transformFactory = TransformerFactory.newInstance();
             Transformer transformer = transformFactory.newTransformer();
             transformer.transform(new DOMSource(soapMessage.getSOAPPart()), streamResult);
          } catch (TransformerException e) {
             throw new RuntimeException(e);
          } finally {
             close(stringWriter);
          return stringWriter.toString();   
       private SOAPMessage convertStringToSOAP(String soapString) {
          SOAPMessage soapMessage = null;
          ByteArrayInputStream byteInputStream = null;
          try {
             MessageFactory msgFactory = MessageFactory.newInstance();
             soapMessage = msgFactory.createMessage();
             SOAPPart soapPart = soapMessage.getSOAPPart();
             // Load the SOAP text into a stream source
             byte[] buffer = soapString.getBytes();
             byteInputStream = new ByteArrayInputStream(buffer);
             StreamSource source = new StreamSource(byteInputStream);
             // Set contents of message
             soapPart.setContent(source);       
          } catch (SOAPException e) {
             throw new RuntimeException(e);
          } finally {
             close(byteInputStream);
          return soapMessage;
       private void close(Closeable closeable) {
          if(closeable != null) {
             try {
                closeable.close();
             } catch (IOException e) {
                // TODO

  • How to develope a XML-RPC client with PL/SQL

    Anyone know how to develop a XML-RPC client with PL/SQL?
    I've oracle 8i.
    Have you some example of code?
    Thanks
    Paolo

    So, you actually want to create the physical directory using JAVA?
    Then see:
    http://www.oracle-base.com/articles/8i/shell-commands-from-plsql.php

  • Is JAX-RPC compatible with Apache Axis?

    We are starting a new project, and our design goal is to develop server-side API that is the exposed via Web Services. The goal is to have them run within the Sun Reference Implementation, and within Apache Axis.
    My question is, if we develop to the JAX-RPC Specification, with occasional SAAJ calls for attachment processing, will our Web Services run within Apache Axis? In other words, it Apache Axis JAX-RPC and SAAJ-compatible?

    It seems that the way they handle Attachments is different. Apache Axis seems to have its own way of handling Attachments, even though it is possible that they also support the standard JAX-RPC way.
    Generally speaking, I am not very happy with how JAX-RPC handles attachments, but this is a different subject.

  • JAX-RPC Client for VB-SoapToolkit3.0 WebService

    I need to develop a JAX-RPC client for a VB6.0 WebService (the WebService being generated through MS SoapToolkit3.0).
    I'm using JWSDP 1.0_01. The WSDL that the JWSDP is using to generate the stubs is the one generated by the MS SoapToolkit. My WebService
    has only one method (Public Test(xpto As String)As String) that receives and returns a string.
    So what's the problem:
    - JAX-RPC client sends a SOAP packet different than what the WebService expects, especially in the namespaces. JAX-RPC generates some strange namespaces, like xmlns:ns0="xpto" (xpto is the name of the argument of the WebService) or xmlns:ns1="Result xpto"
    - Looking at the JAX-RPC generated WebService interface, I see that instead of String, the method test receives a StringHolder (???). What's a string holder, and why isn't a String?
    The resumed message returned by the WebService:
    <mserror:description>WSDLReader:None of the matching operations for soapAction http://tempuri.org/Test/action/WS.Test could successfully load the incoming request. Potential typemapper problem HRESULT=0x80070057: The parameter is incorrect.
    - Server:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.
    </mserror:description>
    Any help would be apreciated.
    Thanks

    Can you send the WSDL that you used to generate the JAXRPC client?
    Thanks

  • JAX-RPC client generation with existing packages

    I am creating web services and need to create a client for them for distribution to other projects. Normally I would say to pull it into NB and create a WS client from the wsdl but I have a problem with the data model it creates also.
    1. Not all developers are using NB.
    2. They presently use AXIS on some projects and these projects provide a client to use for development and I will get push back if I don't also.
    3. I want them to be able to use the enterprise data models directly instead of having to develop a mapper to convert from the client packages to the enterprise packages.
    Point 3 is important but not as important as getting the client jar developed.
    So what I need is a way to build a client from a wsdl using the data models for the enterprise, avoiding object mapping if I can. If I can't have that I need to be able to generate client code and be able to go in and extend it to provide a object mapper to the enterprise objects from the generated objects.
    Thanks

    To make things a little more clearer, this is a post of the error gotten at runtime...
            java.lang.NoSuchMethodError: java.util.Collections.emptyList()Ljava/util/List;
            at com.sun.xml.messaging.saaj.soap.MessageImpl.<clinit>(MessageImpl.java:755)
            at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:47)
            at com.sun.xml.rpc.soap.message.SOAPMessageContext.createMessage(SOAPMessageContext.java:137)
            at com.sun.xml.rpc.client.StreamingSenderState.<init>(StreamingSenderState.java:30)
            at com.sun.xml.rpc.client.StubBase._start(StubBase.java:92)
            at mck.practise.oracle.plsql.PlsqlService_Stub.sayHello(PlsqlService_Stub.java:54)
            at mck.practise.oracle.plsql.HelloWorld.sayRPCHello(HelloWorld.java:34)
            at mck.practise.oracle.plsql.HelloWorld.main(HelloWorld.java:22)The suprising thing is that if I change the application's java platform from JDK 1.4 to Java 5 using the netbeans projects property window, everything works fine.
    Can anyone still suggest on this.
    Regards,

  • Jax-RPC Client side: How to use multiple X509 client certs ?

    hi, (excuse me for my english)
    i'm looking for an answer to this question:
    I'm using the JAX-RPC libraries (JWSDP 2.0) for a web services client application in my app server (tomcat 4 under 1.4 Sun JVM) with HTTPS connection. All works fine when i'm using system.Setproperties for keystore and trustore.
    Buk now, I want to use different client SSL keys for the same app to consume the web service (one SSL client key for a group of users).
    Is it possible ?
    i've tried using custom SSLSocketFactory and custom KeyManager but it won't works: when the SSL connection is well established once, i can connect to the app with an invalide client cert ! (it seems SSL connection is in cache and i dont't know how to disable this cache).
    I have read some threads on this problem without answers ! (http://forum.java.sun.com/thread.jspa?forumID=331&threadID=333010 and http://forum.java.sun.com/thread.jspa?forumID=331&threadID=600372)
    Thanks
    Edited by: Buck007 on May 26, 2008 9:14 AM

    I have the same problem. If you find the solution please post it here :)
    thanks

  • JAX-RPC Client - java.rmi.RemoteException:/getPort best practices

    We are working on java webservices(JAX-RPC style) and while consuming Java WebService sometime getting ‘Remote Exception’ .I have generated client side code with weblogic ant task “clientgen”.
    1: Exception
    java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Failed to invoke end component {service implementation class name} (POJO), operation= {webmethode name}
    -> Failed to invoke method
    ] FaultActor [null] Detail [<detail><java:string xmlns:java="java.io">java.lang.NullPointerException
    </java:string></detail>]; nested exception is:
    weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Failed to invoke end component {service implementation class name} (POJO), operation={webmethode name}
    -> Failed to invoke method
    {Package name}.ManagementPortType_Stub.createXXX(xxxPortType_Stub.java:37) // This line is clientgen generated code
    {From this line its clear that clientgen generated code failed to get webservice port}
    2: Following is our implementation to invoke webservice:
    ManagementService service =
    new ManagementService_Impl(“WSDL URL”)
    ManagementPortType port = service.getManagerHTTPPort();
    Port.getServiceName();
    Our code is executing first two lines for every webservice request, and as per our observation these two lines (mark in bold) is taking long time to execute and due to this sometime gives ‘remote exception’ (when there is more request for web service consumption).
    3: My questions:
    1> Why does it take so long on initialization of service and port object?
    2> Is there any problem if I share “port” object for multiple request?
    3> what are the best practices in this type of implementation?
    Help would be greatly appreciated !

    Hi,
    Thanks for your reply.
    My service is deployed and working fine.
    NPE is due to {Package name}.ManagementPortType_Stub is null and code is executing createXXX() methode on it.
    Anyway i cant do anaything here because this is a clientgen generated code.

  • JAX-RPC client problems and proxy

    I have deployed a JAX-RPC service in JBoss, but on the client side, I am getting NullPointerException when I attempt to access the service. I believe I'm not creating the proxy in the client properly. Where I need help is:
    1. What should the proper ENDPOINT URI be for the service (my variable "destination" shown below).
    2. What should the code in createProxy() look like?
    WEB Services Shows:
    ===================
    VehicleInfoService ACTIVE
    Address: http://myhost:8080/VehicleInfoService/vehicle
    WSDL: http://myhost:8080/VehicleInfoService/vehicle?WSDL
    Port QName: {http://myhost:8080/wsdl/VehicleInfoService}VehicleInfoServiceIFPort
    Remote interface: testsoap.VehicleInfoServiceIF
    Implementation class: testsoap.VehicleInfoServiceImpl
    Model: http://myhost:8080/VehicleInfoService/vehicle?model
    CLIENT CODE
    ============
    import javax.xml.rpc.*;
    import javax.xml.rpc.Stub;
    import testsoap.*;
    public class TestSOAP
    VehicleInfoServiceIF vehicleInfoServiceInf;
    private String statusMessage = null;
    private static String destination = "http://myhost:8080/VehicleInfoService/v
    ehicle";
    public TestSOAP()
    try
    Stub stub = createProxy();
    // Address of the service
    stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
    destination);
    vehicleInfoServiceInf = (VehicleInfoServiceIF)stub;
    catch (Exception ex)
    statusMessage = "Error creating Proxy stub: " + ex.getMessage();
    private static Stub createProxy()
    return(Stub)(new VehicleInfoService_Impl());

    To reply to own posting, I finally discovered that I had a problem with my config.xml file. Once I corrected that, I was able to modify the createProxy entry to:
    private static Stub createProxy()
    return(Stub)(new testacp.VehicleInfoService_Impl().getVehicleInfoServiceIFPo
    rt());
    Corrected config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration
    xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="http://mybox:8080/VehicleInfoService/vehicle?WSDL"
    packageName="testsoap"/>
    </configuration>
    These changes fixed my problem. With the correct entries in config.xml, I no longer got compile errors with "getVehicleInfoServiceIFPort Not Found".

  • JAX-RPC documentliteral with -model option problems in JWSDP 2.0

    Hello,
    I am trying to deploy a service generated with JAX-RPC. Howeverr when I write URL (http://localhost:8080/webservicedeployable/webservice001) in a browser I am getting message: 404 Not Found: Invalid request. Appending ?WSDL shows propers wsdl code, so endpoint URL is allright.. There is my config file delow:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
      <service name="webservice001"
               targetNamespace="http://scdjws/webservices/wsdl"
               typeNamespace="http://scdjws/webservices/types"
               packageName="com.service001">
        <interface name="service.MyServicePort" servantName="service.MyServiceImpl"/>     
      </service> 
    </configuration>I am using command:
    wscompile -gen:server -f:documentliteral -s "C:\Documents and Settings\Michal\jbproject\mojservice\src\" -classpath WEB-INF/classes -d build -model webservice001.xml.gz config.xml -keepmy jaxrpc-ri.xml is:
    <?xml version="1.0" encoding="utf-8"?>
    <webServices xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
                 version="1.0"
                 targetNamespaceBase="http://java.sun.com/xml/ns/jax-rpc/wsi/wsdl"
                 typeNamespaceBase="http://java.sun.com/xml/ns/jax-rpc/wsi/types"
                 urlPatternBase="/ws">
      <endpoint name="service001"
                displayName="Service 001"
                description="This is service001"
                interface="service.MyServicePort"
                implementation="service.MyServiceImpl"
                model="/webservice001.xml.gz"/>
      <endpointMapping endpointName="service001"
                       urlPattern="/webservice001"/>
    </webServices>I am using Tomcat 5.5.16 and JWSDP 2.0.
    Making a call to the service throws exception:
    java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/webservicedeployable/webservice001
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
    Thank you in advance for all suggestion.
    Michal

    Hi,
    I reselved the problem by just copying the FastInfoset to the jaxrpc\lib directory (I am sure this should work in a different way).
    Well, the next problem I am getting is that the "XMLStreamWriter" class cannot be found. This class is contained in jsr173_api.jar.
    I guess my main question is the following:
    Which projects are necessary to get this simple helloWorld example to work?
    I did set the JWSDP_HOME varible. Is there another setting I have to make to have all necessary jar-files available and to be able to run the samples?
    Could anybody point me to a tutorial that does not only show a few lines of code (as the HelloWorld sample in the JWSDP-Tutorial) but that would instead lead me through a step-by-step sample application that I write by myself and actually runs at the end? The example in the JWSDP-Tutorial uses all kinds of existing config files which are not explained.
    Thanks for your help.

  • Web Service JAX-RPC/SOAP with JAXB

    Hello,
    During my research on JAX-RPC/SOAP as web service technology. I found only simple "helloworld" sample type what using simple String as aurgment. For my task, I required a more complex aurgment such as a complete contact info. I then did some sample code for JAXB and found it to be very useful as a XML/JAVA binding tool. It seems logical to use JAXB to parse and bind the complex aurgment. Though I have not seen any reference to this using it with JAX-RPC. Does JAX-RPC have the tool set to accomplish the same thing? JAX-RPC may have such thing, but using this JAXB seem logical, thus would I still "conform" to the JAX-RPC if I go this route. Any info would be much appreciative.
    Thanks in Advance,
    Mike

    The two JAX-RPC tools that I have used, the reference implementation and Apache Axis both have tools for mappiing XML to classes and vice-versa. Having used JAXB also, I have to say that both of these tools are much easier to use than JAXB.
    As far as whether it will conform, you can make a valid SOAP message using any tool you like.

  • JAX-RPC Client Handler

    Hi All,
    I am trying to get a simple example client handler to work using JAX-RPC DII.
    The web serivice is a simple one that just returns Hello + name..
    Here is the client code:
    public class Main {
         * @param args the command line arguments
        private static String BODY_NAMESPACE_VALUE = "http://helloservice/";
        private static String NS_XSD = "http://www.w3.org/2001/XMLSchema";
        private static String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
        private static String URI_ENCODING ="http://schemas.xmlsoap.org/soap/encoding/";
        public static void main(String[] args) {
            try {
                     String url ="http://localhost:8080/HelloService/MyHelloService";
                     QName serviceName   = new QName(BODY_NAMESPACE_VALUE,"MyHelloServiceService");
                     QName portTypeName = new QName(BODY_NAMESPACE_VALUE, "MyHelloServicePort");
                     ServiceFactory factory = ServiceFactory.newInstance();
                     Service service = factory.createService(serviceName);
                     Call call = service.createCall();
                     call.setPortTypeName(portTypeName);
                     call.setOperationName(new QName(BODY_NAMESPACE_VALUE, "sayHello"));
                     call.setTargetEndpointAddress(url);
                     call.setProperty(ENCODING_STYLE_PROPERTY,"");
                     //call.setProperty(ENCODING_STYLE_PROPERTY,URI_ENCODING);
                     call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
                     QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
                     call.setReturnType(QNAME_TYPE_STRING);
                     call.addParameter("name", QNAME_TYPE_STRING, ParameterMode.IN);
                     String[] params = { "Murph!" };
                     HandlerRegistry hr = service.getHandlerRegistry();
                     List<HandlerInfo> list = new ArrayList<HandlerInfo>();
                     HandlerInfo hi = new HandlerInfo(ClientSOAPHandler1.class, null,null);
                     list.add(hi);
                     HandlerInfo hi2 = new HandlerInfo(ClientLogicalHandler1.class, null,null);
                     list.add(hi2);
                     hr.setHandlerChain(portTypeName, list);
                     String result = (String)call.invoke(params);
                     System.out.println(result);
            } catch (ServiceException e)
                e.printStackTrace();
            catch (RemoteException e)
                e.printStackTrace();
    }And the code for the Handlers:
    public class ClientSOAPHandler1 extends ClientSOAPHandlerBase
        private final String HANDLERNAME="ClientSOAPHandler1";
        public ClientSOAPHandler1(){
           super();
           super.setHandlerName(HANDLERNAME);
    import javax.xml.transform.Source;
    import java.util.Set;
    import java.util.TreeSet;
    import javax.annotation.PreDestroy;
    import javax.annotation.PostConstruct;
    import javax.xml.namespace.QName;
    import javax.xml.ws.handler.MessageContext;
    import javax.xml.ws.handler.soap.SOAPHandler;
    import javax.xml.ws.handler.soap.SOAPMessageContext;
    import javax.xml.soap.SOAPMessage;
    import java.io.ByteArrayOutputStream;
    public class ClientSOAPHandlerBase implements SOAPHandler<SOAPMessageContext>
        private String handlerName=null;
        public void setHandlerName(String h) {
            this.handlerName=h;
        public String getHandlerName() {
            return this.handlerName;
        @PostConstruct
        public void myInit() {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":myInit");
            System.out.println("exiting "+handlerName+":myInit");
            System.out.println("------------------------------------");
        @PreDestroy
        public void myDestroy() {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":myDestroy");
            System.out.println("exiting "+handlerName+":myDestroy");
            System.out.println("------------------------------------");
        public Set<QName> getHeaders() {
            return new TreeSet<QName>();
        public boolean handleMessage(SOAPMessageContext context) {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":handleMessage");
            boolean direction= ((Boolean)context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY)).booleanValue();
            if (direction) {
                System.out.println("direction = outbound");
            } else {
                System.out.println("direction = inbound");
            dumpMsg(context);
            System.out.println("exiting "+handlerName+":handleMessage");
            System.out.println("------------------------------------");
            return true;
        public void close(MessageContext context) {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":close");
            System.out.println("exiting "+handlerName+":close");
            System.out.println("------------------------------------");
        public boolean handleFault(SOAPMessageContext context) {
            System.out.println("------------------------------------");
            System.out.println("in "+handlerName+":handleFault");
            System.out.println("exiting "+handlerName+":handleFault");
            System.out.println("------------------------------------");
            return true;
        public void dumpMsg(MessageContext context) {
           try {
              SOAPMessage soapmsg = ((SOAPMessageContext)context).getMessage();
              System.out.println("MSG="+getMsgAsString(soapmsg));
           } catch (Exception e) {
               e.printStackTrace();
           return;
        public String getMsgAsString(SOAPMessage message) {
            String msg  = null;
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                message.writeTo(baos);
                msg = baos.toString();
            } catch (Exception e) {
                e.printStackTrace();
            return msg;
    }The output is as follows:
    run:
    Hello Murph!
    BUILD SUCCESSFUL (total time: 1 second)
    This should print out the various println statements in the Handler, but it doesnt :(- How come? What am I missing?
    I have searched everywhere trying to find the proper way to get a client side handler to work and have had luck. Additionally, I really really need this to work....if anyone could provide help, it would be VERY appreciated...pretty please
    Thanks,
    Daniel

    Any Ideas Anyone?????

  • Problem in Web Service Client with JDeveloper 11 r2

    I have a problem while make WS client in JDeveloper 11g R2... It's WS makes in .net
    I get the next error:
    *"An error occurred while opening"*
    after
    *"java.lang.IlegalStatementException: getReader(): null text buffer"*
    Whit can help my?

    Were you able to test the WS using SOAP UI or the like ?

Maybe you are looking for