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,

Similar Messages

  • Exception when running a JAX-WS client against a JAX-RPC service

    I have a JAX-WS client invoking a JAX-RPC web service on Weblogic 10.3. The service was originally built for Weblogic 9.2, it's been rebuilt and runs fine on 10.3.
    Some operations work fine, but invoking one operation results in the following exception:
    at secsvc.client.GetRolesForUserInApplicationResponse$JaxbAccessorF_role.get(Unknown Source)
         at com.sun.xml.internal.bind.v2.runtime.reflect.NullSafeAccessor.get(Unknown Source)
         at com.sun.xml.internal.bind.v2.runtime.reflect.Accessor.getUnadapted(Unknown Source)
         at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$7.get(Unknown Source)
         at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit$PartBuilder.readResponse(Unknown Source)
         at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.readResponse(Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
         at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
         at $Proxy29.getRolesForUserInApplication(Unknown Source)
    This operation works fine if invoked by an RPC client.
    Any idea what's going on?
    Mikey

    Hi Jitu,
    I changed the wsdl. And so I don�t get the warning anymore. My Webservice also runs well, now. Thanks anyway for the reply.
    There is a nice tech article on the sun network, which solved my problem. The basic idea is to split the wsdl into 2 wsdl documents. one containing all the porttypes messages and so on. And the other wsdl contains the binding and service elements.
    If you are interested check out this link:
    http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/index2.html
    thanks,
    footman

  • 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,

  • 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.

  • 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

  • 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

  • No new mail notification in Outlook - CAS Exchange RPC Client Access problem

    Hi, we're facing this problem:
    Users start complaining they suddenly don’t receive new mail notifications in Outlook (2010/2013)  anymore
    Inbox does not show the new mail either
    When the user changes folders in outlook, the new mail does show in the Inbox folder
    Restarting Outlook shows the new mail as well.
    The same new e-mail arrives instantly (with notifications) in Owa and on mobile devices
    Sometimes the new mail notification pops up after a longer period of time (from 30 seconds to 10 minutes). But more often not at all.
    This issue seems to occur at random. We’ve been problem free for a week, and sometimes it comes back three times a day.
    Clients running Outlook 2010, 2013 cached or online, on site and off site. So it seems server related, not client.
    It was seen first around January 8th. We did not make any changes around that time that we can link to this problem.
    Only one CAS server (EXCH1-RTD) shows this issue. CAS servers on other sites are ok
    EXCH1-RTD has CAS and HUB transport roles. The same site has two mailbox only servers. EXCH2-RTD (mailbox server for normal mailboxes). And EXCH3-RTD (mailbox server for archive mailboxes)
    No entries in the event logs that seems to be related
    As the problem only occurs with Outlook clients, I suspected RPC issues. We cannot gracefully stop the “Microsoft Exchange RPC Client Access” service on EXCH1-RTD  while the issue occurs. We
    can only kill the process and restart the service, solving the issue instantly.
    What we’ve tried until now:
    Updated all Exchange servers from Exchange 2010 SP3 RU6 to RU8-v2 (server OS=W2K8R2)
    Updated all Exchange servers  to latest critical Windows updates
    Recalculated requirements using MS Sizing tool.  Upgraded EXCH1-RTD  VM from 8GB and 2 vCPU (1 core/cpu) to 16GB
    and 4vCPU (1 core/cpu)
    Ran various perfmon counters and compared them with other Exchange servers, not finding any obvious anomalies.
    Any ideas would be greatly appreciated!
    Ron

    Hi Ron,
    From your description, OWA works well, the issue is related to Outlook side. In your case, I recommend you use Outlook safe mode to determine whether the issue is related to add-ins. If the issue persists, you can create a new profile to check the result.
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Microsoft Exchange RPC Client Access will not start.

    A few days ago all my outlook clients were disconnected.  Looking into it and the Microsoft Exchange RPC Client Access service had died.  Tried several restarts of the system but the service will not go into a running state.  It always says
    Starting. But it is actually terminating and restarting.  In the system log get Event 7031 - "The Microsoft Exchange RPC Client Access service terminated unexpectedly.  It has done this 1 time(s).  The following corrective action will be
    taken in 5000 milliseconds: Restart the service."  I can't find anything else on the error in any log file.  Some other info not sure if this related or not.  The contentIndex are corrupt and will not rebuild. Get a state of "Failed"
    with an error message of "The database has been dismounted."  Also at time the system is very sluggish.  Mostly right after a reboot for an hour or two.  Details about the system are; Running Exchange 2013 SP1 on server 2012 R2.  All
    roles on one machine.  About 20 mailboxes. Database is about 40gig. No VM, just a normal server. plenty of diskspace, memory and CPU.   The system has been running fine for about a year.  Also, mobile devices and OWA work fine.  Mail flow
    is fine.  Outlook just can't connect.  
    Tried restoring the databases and logs from before the problem started but that did not help.
    Not sure what to try from here.
    Thanks

    Hi,
    Please check whether an unavailable Public Folder database is pointed to in your Exchange 2013 mailbox database as the default public folder database setting.
    If there is no legacy public folder database and you are working in a pure Exchange 2013 environment, please remove the default public folder database setting on each Exchange 2013 Mailbox database that points to the deleted public folder database object
    in ADSI Edit:
    1. Open ADSIEdit, Connect to the Configuration container.
    2. Expand Configuration, expand CN=Configuration,DC=Domain,DC=com.
    3. Expand CN=Services -> CN=Microsoft Exchange -> CN=Domain -> CN=Administrative Groups -> CN=Exchange Administrative Group -> CN=Databases.
    4. In the right hand pane you will see a list of databases. Right-click the listed database object -> Properties.
    5. Check whether the msExchHomePublicMDB value is set to an unavailable value. If you see reference to the old database, please clear the value.
    6. Click OK.
    7. Check the rest of the databases to make sure that they are not populated in the same way.
    For more information about this, please refer to:
    http://support2.microsoft.com/kb/2962915/en-us
    Regards,
    Winnie Liang
    TechNet Community Support

  • RPC Client Access Logs - Throttling Policy

    Trying to get useful information on who is being throttled by a specific policy.
    Created the policy: New-ThrottlingPolicy -Name LimitMessagesSent -RecipientRateLimit 5 -ThrottlingPolicyScope Organization
    Enabled RPC Client access logging: <add key="LoggingTag" value="ConnectDisconnect, Logon, Failures, ApplicationData, Warnings, Throttling" /> and bounced the service.
    Forced the throttling by sending many emails.
    Opened the log and found this:
    2014-07-23T21:24:28.820Z,40,1,/o=Exch/ou=Monitoring Mailboxes/cn=Recipients/cn=HealthMailbox872ac0efb9c44ddf9d0d1d4f0e4dbb55,,Microsoft.Exchange.RpcClientAccess.Monitoring.dll,15.0.0.0,Cached,,,,ncacn_http,Client=Microsoft.Exchange.RpcClientAccess.Monitoring,,,,,00:00:00.0160000,"BS=Owner:Sid~CAMPUS\SM_6f8aaf3f77f94192a~Rca~false,Conn:1,MaxConn:40,MaxBurst:150000,Balance:149988.3,Cutoff:Unlimited,RechargeRate:900000,Policy:LimitMessagesSent,IsServiceAccount:False,LiveTime:00:02:00.0650494",,,
    Makes no mention of the user that was throttled. How can I troubleshoot if I cannot see the user in the logs?
    Thanks.

    Hi 
    We need to assign this newly created throttling policy to the end users else it will not be effective.
    The below commands will help you out.
    Use below command to assign this newly created throttling policy to the user
    Set-Mailbox MBXName -ThrottlingPolicy LimitMessagesSent 
    Run the below command to ensure that the throttling policy is assigned 
    Get-Mailbox MBXName | Select Throttling Policy
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com

  • RPC client access log and IIS log, difference??

    RPC logging is in "C:\Program Files\Microsoft\Exchange Server\V14\Logging\RPC Client Access" by default.
    And IIS logs is in "C:\inetpub\logs\LogFiles\W3SVC1" by default.
    Just want to know which client will generate which Log?
    For example, exchange server 2010 supports:
    Outlook Web App
    Outlook anywhere
    Exchange ActiveSync
    POP3 and IMAP4
    Autodiscover
    So far as I know, "exchange activesync" is always appear in IIS log. But outlook users(all in domain), most of them are always appear in RPC log, but sometime a few users appear in IIS log. 
    For example:(IIS log)
    2014-03-31 00:01:51 172.23.0.100 POST /EWS/Exchange.asmx - 443 TEST\alice 172.26.0.41 Microsoft+Office/14.0+(Windows+NT+6.1;+Microsoft+Outlook+14.0.7116;+Pro) - 200 0 0 312
    RPC log:
    2014-03-31T00:42:09.964Z,1024,1,/o=first organization/ou=exchange administrative group(fydibohf23spdlt) /cn=recipients/cn=alice,,OUTLOOK.EXE,14.0.7108.5000,Cached,,,ncacn_http,,OwnerLogon,0,00:00:00.0156287,,
    I want to understand the logging rules, please help?

    Hi, Steve:
    Thanks very much for your reply. I have a question to your reply here.
    RPC-->Outlook clients, and then EWS(includes Outlook 2011??) What's the difference between Outlook clients and Outlook 2011(I think it should be 2010?), but is that Outlook 2010 not belong to 'Outlook clients'?
    Best Regards,
    Ryo

  • 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 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 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?????

  • 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,

Maybe you are looking for

  • Network connection problems, please help!

    I have had an iPod Touch (4th generation) for over a year now and it worked fine. Today, something went wrong with my network connection. One moment it says that I'm connected to a network, and a few seconds later it says I'm not connected... Then a

  • Jabber for Mac CTI DX650 issues

    Hello, I have a user who had Jabber for Mac setup using CTI for control of a 7942.  Everything was working, then we switched it out with a DX650.  Made all the changes needed in Call Manager same as some other users.  However, it will not connect to

  • Licence for Photoshop v 9  as part of CS2

    I have a licence code for the above and have tried downloading  Photoshop Elements v9  package However  I have noticed that CS2 isn't downloadable and when I try and enter the licence code it says its not valid  Any suggestions ?  Any help much appre

  • Safari will not bookmark web sites but Firefox will do so

    I am using 10.4.8 on a PPC iMac and have discovered recently that Safari does not save new bookmarks for me. I go to Firefox and Firefox will do so. Any suggestions? iMac G5 2.1g   Mac OS X (10.4.8)   Safari 2.0.4

  • Error message using Boot Camp

    I am getting the following error message while trying to install Windows 7 via Boot Camp: "Your disk could not be partitioned.  An error occurred while partitiioning the disk" I selected a 20Gb partition for Windows, leaving 150Gb for OS X (Mavericks