Pages

Sunday, August 1, 2010

SOAP over JMS with WebLogic

With WebLogic 10.3 you can also do SOAP over JMS instead of HTTP. In this blogpost you will see how you can achieve this with WebLogic JMS and with JDeveloper as IDE. The JMS transport offers the following benefits: reliability, scalability, and quality of service but it does require slightly more overhead and programming complexity than HTTP. And you can't use JAX-WS, JAX-WS on WebLogic can't use any other protocol then HTTP, you need to use JAX-RPC instead. This leads to a second problem, JAX-RPC is not well supported in JDeveloper wizards so you need to use ANT.

First step is to configure JMS. I will show you the steps on the Integrated WebLogic of JDeveloper.
Create a persistent Store. You can use a normal FileStore and target this to the DefaultServer.
Create a JMS Server and use the FileStore and also target this to the DefaultServer.
Create a JMS Module and target this to the DefaultServer.
Create a Sub Deployment ( part of your JMS Module ) and target this to your JMSServer.
Now you can create some resources for this JMS Module. You need to create a Connection Factory and use your Sub Deployment. Create a JMS Queue and also use the same Sub Deployment. The JNDI Names are very important you need this in your JAX-RPC Web Service Class.
The WebLogic JMS part is ready, you can restart the WebLogic Server from JDeveloper and check if you see the JNDI Resources in the DefaultServer ( Go to Servers in the WebLogic Console , Click the DefaultServer, on the top of the page there is a JNDI hyperlink )

In JDeveloper you can create a new Workspace / Project.
Create a new Java Class which will be our JAX-RPC Web Service class. Here you need to add the WLJmsTransport Annotation with the queue and connectionFactory attribute. You can't use the forward slash in the JDNI name so replace this with a dot. The rest is like a normal Web Service in JAX-WS or JAX-RPC.
package nl.whitehorses.ws.jms;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

import weblogic.jws.WLJmsTransport;
@WebService(portName = "HelloWorldJMSPort",
            serviceName = "HelloWorldJMSService")

@WLJmsTransport(serviceUri="HelloWorldJMSService",
                contextPath="HelloWorldJMSService",
                queue="jms.SoapQueue", 
                portName="HelloWorldJMSPort", 
                connectionFactory="jms.CF") 

public class HelloWorld {

    @WebMethod
    @WebResult(name = "result")
    public String sayHello(@WebParam(name = "message") String message ) {
      
      return message;
    }
}
Next step is to deploy this to the WebLogic Server. You need to do this with ANT. Add an empty build file to your project and the Weblogic jar to the ANT classpath.
Open the build.xml and add the following.
<project name="webservices-hello_world" default="all">

 <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask"/>

 <target name="build-service">
  <jwsc srcdir="src" destdir="deploy/helloWorldEar">
   <jws file="nl/whitehorses/ws/jms/HelloWorld.java" type="JAXRPC"/>
  </jwsc>
 </target>

 <taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy"/>


 <property name="wls.username" value="weblogic"/>
 <property name="wls.password" value="weblogic1"/>
 <property name="wls.hostname" value="localhost"/>
 <property name="wls.port" value="7101"/>
 <property name="wls.server.name" value="DefaultServer"/>

 <target name="deploy">
  <wldeploy action="deploy" name="helloWorldEar" source="deploy/helloWorldEar"
            user="${wls.username}" password="${wls.password}" verbose="true"
            adminurl="t3://${wls.hostname}:${wls.port}"
            targets="${wls.server.name}"/>
 </target>

 <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask"/>

 <target name="client">
  <clientgen wsdl="http://${wls.hostname}:${wls.port}/HelloWorldJMSService/HelloWorldJMSService?WSDL"
             destdir="src" 
             packagename="nl.whitehorses.client.jms"
             type="JAXRPC"/>
  <javac srcdir="src" 
         destdir="classes"
         includes="nl/whitehorses/client/jms/**/*.java"/>
 </target>

</project>
First step is to make an deployment with the JAXRPC option. Run the build-service target. After that you can run the deploy target.
If everything went well, you can go to the WebLogic deployments. 
 Select the Web Service and go to the Testing Tab. You can't test this Web Service with this Test Client.
 Select the WSDL hyperlink and take a look at the endpoint.
The last part is to test this Web Service. For this you need to generate a Web Service Proxy client. Run the client target in ANT. After that you can make your own TestClient where you will be using these client classes.
package nl.whitehorses.client.jms;

import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;
import javax.xml.rpc.Stub;

import weblogic.wsee.jaxrpc.WLStub;

public class TestService {
    public TestService() throws RemoteException, ServiceException {

        HelloWorldJMSService service = new HelloWorldJMSService_Impl(
           "http://localhost:7101/HelloWorldJMSService/HelloWorldJMSService?WSDL");

        HelloWorld port = service.getHelloWorldJMSPort();

        Stub stub = (Stub)port;

        stub._setProperty(WLStub.JMS_TRANSPORT_JNDI_URL,"t3://localhost:7101");
 

        try {
            String result = null;
            result = port.sayHello("Hello");
            System.out.println("Got JMS result: " + result);

        } catch (RemoteException e) {
            throw e;
        }

    }

    public static void main(String[] args) {
        TestService testService;
        try {
            testService = new TestService();
        } catch (RemoteException e) {
            e.printStackTrace();
        } catch (ServiceException e) {
            e.printStackTrace();
        }
    }
}

Here you can download my JDeveloper 11g Workspace.

Extra update from Ales.

When you want to use both one for SOAP/HTTP and also for SOAP/JMS you need to define a port for each communication protocol and it need to have its own service.

you can use the following logging options.

-Dweblogic.wsee.verbose=weblogic.wsee.connection.transport.jms.*
-Dweblogic.wsee.verbose= weblogic.wsee.server.jms.*

This shows which JMS listeners are instantiated and on which ports they are listening.

51 comments:

  1. Nice post..I only managed to get the solution deployed using ant from the command line, after running setDomainEnv in the default domain. If I tried to run the ant tasks from JDeveloper I received the following error:

    "taskdef class weblogic.wsee.tools.anttasks.JwscTask cannot be found"

    This may be useful for others..

    ReplyDelete
  2. Hi,

    Did you update the weblogic jar in the ANT section of the project options else you will use my path to the weblogic.jar

    thanks Edwin

    ReplyDelete
  3. Can you please let me know how to integrate with Maven.
    Thanks

    ReplyDelete
  4. PLS, tell us, how to integrate this with maven build (it is more universal).

    ReplyDelete
  5. I integrate this with maven (and ant plugin), and i have one question, how to prevent ant from making WAR file ? I whant JAR instead.

    Ps.
    I'm not ant(ology) spec :) so maybe it's obvious for You and You can help ;).

    BTW, i can post You pom.xml for MAVEN project (with dependecys)

    ReplyDelete
  6. Hi,

    take a look at this http://www.rgagnon.com/javadetails/java-0532.html

    but I think you need a war for the servlet part and this needs to be configured in the web.xml

    thanks

    ReplyDelete
  7. Can You describe how transactions works int this implementation?

    ReplyDelete
  8. Yes, how transaction works ? I add some code that throws exception to Your code and messages doesn't back to queue. Why ?

    ReplyDelete
  9. Hi,

    Ok I did not handle any exception in jax-rpc so can you follow this guide http://www.ibm.com/developerworks/xml/library/ws-tip-jaxrpc.html and try your test again.

    thanks

    ReplyDelete
  10. Ok, i tested all from that Exceptions and still messages don't back to queue. I set messages redelivery limit to 3 and after that wrong messages should land in failqueue but they don't. They just disappear. Maybe I made error in code. Take a look, and pls help :) i have to make this reliable
    package example;

    /*import java.rmi.RemoteException;

    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;*/
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebResult;
    import javax.jws.WebService;

    import weblogic.jws.Transactional;
    import weblogic.jws.WLJmsTransport;
    /**
    *
    * @author me
    *
    */
    //@Session(ejbName="transactionEJB")
    //@JndiName(local="transactionEJB")
    @Transactional(value=true)
    @WebService(portName = "HelloWorldJMSPort", serviceName =
    "HelloWorldJMSService")
    @WLJmsTransport(serviceUri="HelloWorldJMSService",
    contextPath="HelloWorldJMSService", queue="jms.SoapQueue",
    portName="HelloWorldJMSPort", connectionFactory="jms.CF")
    public class HelloWorld /* implements SessionBean */{
    private static final long serialVersionUID = 1L;

    @WebMethod
    @WebResult(name = "result")
    public String sayHello(@WebParam(name = "message") String message ) {
    if(message.equals("exce"))
    {
    throws new ANY_EXCEPTION_FROM_IBM_SITE;
    }
    else
    return message;
    }

    /*@Override
    public void ejbActivate() throws EJBException, RemoteException {}

    @Override
    public void ejbPassivate() throws EJBException, RemoteException {}

    @Override
    public void ejbRemove() throws EJBException, RemoteException {}

    @Override
    public void setSessionContext(SessionContext arg0) throws EJBException,
    RemoteException {}*/
    }

    ReplyDelete
  11. Hi,

    I don't have any problems.

    this was my error

    public class HelloWorld {

    @WebMethod
    @WebResult(name = "result")
    public String sayHello(@WebParam(name = "message") String message ) {
    int i = 1/0;
    return message;
    }
    }

    and the stacktrace I received in the client


    java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Failed to invoke end component nl.whitehorses.ws.jms.HelloWorld (POJO), operation=sayHello
    -> Failed to invoke method
    -> / by zero
    ] FaultActor [null] Detail [java.lang.ArithmeticException: / by zero
    at nl.whitehorses.ws.jms.HelloWorld.sayHello(Unknown Source)


    I also see in the monitoring of the queue the soapfault messages

    I tested it with the code of this blogpost

    thanks

    ReplyDelete
  12. Thanks a lot!!
    Its really helpful..

    ReplyDelete
  13. Hi,

    Supporting Web Services over JMS is a common requirement since it is a reliable alternative to web service over HTTP. My question is, how can i do this via Oracle Service Bus. Suppose i have two queues, one for MessageIN and other one for MessageOUT. Now i want to call them through Web service from OSB.


    Thanks
    Haider

    ReplyDelete
  14. Hi,

    Did you read this blogpost.

    http://biemond.blogspot.com/2010/09/soap-over-jms-with-oracle-service-bus.html

    Thanks

    ReplyDelete
  15. Hi,
    Is it possible to rollback the Web Service transaction?
    I tried to do rollback in case of some exception but the message doesn't come back to the queue.
    How can I achive this behaviour?

    ReplyDelete
  16. Hi,

    be careful , not to create a loop. At least add an error queue to this queue with a retry of 3 times.

    I think the message is already committed when you get the message on weblogic.

    you can check this WLJmsTransport annotation
    @WLJmsTransport(serviceUri="HelloWorldJMSService",
    contextPath="HelloWorldJMSService", queue="jms.SoapQueue",
    portName="HelloWorldJMSPort",
    connectionFactory="jms.CF")

    thanks

    ReplyDelete
  17. Hi Edwin,

    Thank you for this blog, its very helpful.

    I am currently implementing a SOAP/JMS webservice and I have a problem with the Queue. The messages from the client get stuck in the Queue and do not reach the Webservice.


    I was wondering : Is there any configuration step needed to e.g create a Listener that handles the communication between the Queue and the Webservice?

    Currently, I do the following:
    1) create the Queue and the ConnectionFactory:
    Queue:
    Module :SOAJMSModule
    name: helloWorldQueue
    JNDI name : jms/helloWorldQueue
    subdeployment: SOASubDeployment
    JMS Server: SOAJMSServer
    target: soa_server1
    ConnectionFactory:
    name: helloWorldCF
    JNDI name: jms/helloWorldCF

    2) update WSDL according to the Documentation (http://docs.oracle.com/cd/E11035_01/wls100/webserv_adv/jmstransport.html).

    3) In jwsc script, I use the WLJmsTransport element:

    WLJmsTransport contextPath="HelloWorld/services"
    serviceUri="HelloWorldService"
    portName="HelloWorldServiceJMS"
    queue="jms.helloWorldQueue"
    connectionFactory="jms.helloWorldCF"


    Please, do you have any ideas what could go wrong?

    Thank you,
    Ales

    ReplyDelete
  18. Hi

    if the message is in the queue then it must be in the WLJmsTransport annotation of the web services.

    check the jndi names of the queue and the CF and off course the targetting of the queue and the CF.

    good luck

    ReplyDelete
    Replies
    1. Hi Edwin,

      Thanks! That is probably what I am missing : How do you I configure the "targetting of the queue and the CF"?

      It is something that I need to do when creating the queue? Or, is it the WLJmsTransport annotation that should handle this?

      Thank you,
      Ales

      Delete
    2. Hi,

      You need to do this in the WebLogic console. You can do this with sub deployments on the jms module.
      Create a jms server which is targeted to a wls server. A jms module which is targeted to the jms server .
      Create a sub deployment on the jms module which is targeted to the jms server . Create the queue which uses this sub deployment .
      Create a cf which points to the wls server and you are done.

      On the ws you need to use the jndi names of the queue and cf and replace / by a . Do this in the annotation.

      Thanks

      Delete
  19. Hi Edwin,

    Thank you. I resolved the problem.

    It was actually something else. The issue was that I defined two ports : one for SOAP/HTTP, other for SOAP/JMS. And JMS listener was not listening on the correct one.

    As I have found out, the rule is:
    In order to provide a webservice available through multiple communication protocols, you need to define :
    (i) a port per each communication protocol,
    (ii) expose each port under a different serviceUri.

    I missed the (ii).

    Also, I found very useful the following logging options:
    -Dweblogic.wsee.verbose=weblogic.wsee.connection.transport.jms.*
    -Dweblogic.wsee.verbose= weblogic.wsee.server.jms.*

    This shows which JMS listeners are instantiated and on which ports they are listening.

    Thank you for all the help.

    ReplyDelete
    Replies
    1. Thanks,

      Great to hear, it works for you, I added your findings to my blog.

      Delete
  20. Hi
    trying to enable SOAP over JMS in a cluster...

    When looking up the WSDL through the admin console the doc claims that
    the endpoint should show jms://server1:port1,server2:port2/... based on the
    cluster address if that is configured.

    In my case even with the cluster address properly configured, the wsdl
    resolves the dynamic jms endpoints to the first server in the cluster and not the list

    Any ideas would be appreciated ???

    ReplyDelete
    Replies
    1. Hi,

      the documentation says
      http://docs.oracle.com/cd/E17904_01/web.1111/e13735/jmstransport.htm

      Clustering Considerations:

      If you are using the Web service JMS transport feature in a cluster, you must:
      Create a local JMS queue, rather than a distributed queue, when creating the JMS queue.
      Explicitly target this JMS queue to each server in the cluster.

      So deploy it to the cluster and the service should look at his local queue.

      in the ws client use this

      Stub stub = (Stub)port;
      stub._setProperty(WLStub.JMS_TRANSPORT_JNDI_URL,"t3://server1,server2:7101");

      I think jms url in the wsdl does not matter I think

      thanks

      Delete
    2. Hi Edwin,
      ok :(

      I actually have a WDQ with 2 member queues each targeted to a server in the cluster.
      And as for the WSDL not bringing back the right URL, that is a problem, since this is the way a potential client gets the list of servers...

      IMHO.

      Furthermore, what you are saying is that the client needs to be aware of the particular managed servers ip:port combinations every time it is invoked; that could end up changing overtime!

      Thanks for your response, I will look into this and provide you any updates on my findings.

      Delete
    3. Ok,

      I am curious what your ws client is, I think it uses and needs this as stub property , this is the real endpoint.
      stub._setProperty(WLStub.JMS_TRANSPORT_JNDI_URL,"t3://localhost:7101");

      Although you cannot invoke the Web service using HTTP, you can view its WSDL using HTTP, which is how the clientgen is still able to generate JAX-RPC stubs for the Web service.

      Note:
      Using JMS transport is an added-value WebLogic feature; non-WebLogic client applications, such as a .NET client, may not be able to invoke the Web service using the JMS port.

      thanks

      Delete
  21. Hi Edwin,

    This is really good article, but it covers rather obsolete implementation (SOAP/JMS over JAX-RPC). Do you have any idea if Oracle plans support for W3C's recommendation "SOAP over Java Message Service 1.0" (http://www.w3.org/TR/2012/REC-soapjms-20120216) over JAX-WS?

    Thank you!

    ReplyDelete
    Replies
    1. Hi,

      Sorry I don't know . IBM got one.
      But you can use WS -Reliable Messaging instead. It's very reliable with handshaking and also uses JMS.

      thanks

      Delete
  22. Hi Edwin,

    Thank you for this, it's really helpful.
    However, I had a problem when I tried to run the ant build. Any idea what's wrong?

    ...
    [jwsc] [JAM] Warning: failed to resolve class org.apache.xmlbeans.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class javax.ejb.SessionBean
    [jwsc] JWS: C:\JDeveloper\mywork\SoapOverJMS\SoapOverJMS\src\nl\whitehorses\ws\jms\HelloWorld.java Validated.
    [jwsc] [JAM] Warning: failed to resolve class org.apache.xmlbeans.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class com.bea.xml.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class org.apache.xmlbeans.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class com.bea.xml.XmlObject
    [jwsc] [JAM] Warning: failed to resolve class javax.ejb.SessionBean
    [jwsc] [JAM] Warning: failed to resolve class javax.xml.rpc.holders.Holder
    [jwsc] [JAM] Warning: failed to resolve class javax.ejb.SessionBean
    [jwsc] [JAM] Warning: failed to resolve class javax.ejb.SessionBean
    [jwsc] Compiling 2 source files to C:\Users\V-TIMM~1\AppData\Local\Temp\_qd6bhc
    [jwsc] C:\JDeveloper\mywork\SoapOverJMS\SoapOverJMS\src\nl\whitehorses\ws\jms\HelloWorld.java:8: package weblogic.jws does not exist
    [jwsc] import weblogic.jws.WLJmsTransport;
    [jwsc] ^
    [jwsc] C:\JDeveloper\mywork\SoapOverJMS\SoapOverJMS\src\nl\whitehorses\ws\jms\HelloWorld.java:12: cannot find symbol
    [jwsc] symbol: class WLJmsTransport
    [jwsc] @WLJmsTransport(serviceUri="HelloWorldJMSService",
    [jwsc] ^
    [jwsc] 2 errors

    ReplyDelete
  23. Find the problem, it's weblogic.jar path problem. Thanks.

    ReplyDelete
  24. Hi Edwin,
    Us OSB BS via JMS to invoke this WS and get the response, does it work?
    jms request
    the dataflow similar BS --------------> WS
    jms response
    BS <-------------- WS

    thanks

    ReplyDelete
    Replies
    1. Hi,

      I think so, here you got some more information
      http://biemond.blogspot.nl/2010/09/soap-over-jms-with-oracle-service-bus.html

      thanks

      Delete
  25. Hi Edwin,
    Thanks for your response.
    After reading the second blog, I still don't know how to set the biz get response from the webservice which have provided the response.


    could you show me some setting on biz , please? Thank you.

    the message flow:
    http public
    client -----> proxy services ------> biz ------> queue
    <------ <------ ^ ^
    | |
    | response |
    --<-------------Java

    Thank you

    ReplyDelete
    Replies
    1. Hi,

      What is your use case, cause OSB does not support asynchronous. you need to have an other proxy who listen for the response.

      thanks

      Delete
  26. Hi Edwin,

    Is possible enable a BPEL process to work over JMS trasnport? I'm using jdeveloper but I don't find a way to do it... any idea of this? is there some link that help?

    Thank you,
    Luciano

    ReplyDelete
    Replies
    1. Hi,
      Just add a jms adapter to your composite and wire this to your BPEL. BPEL works with partnerlinks.

      thanks

      Delete
  27. Hi,
    Thanks for the great post. I've managed to get everything working (Using foreign jms (Qpid/AMQP)). The throughput is abysmal. It only creates one thread to listen for messages. Do you know if there is is any way to improve throughput? I think I've tried just about everything w.r.t worker managers etc.)

    ReplyDelete
    Replies
    1. Hi,

      Why are you using Foreign Server, is this for persistence ( cause with wls you can use db persistence ) and is it Ok when you use normal JMS.

      plus maybe you can set more threading parameters on the foreign server.

      thanks

      Delete
    2. Hi ,

      Even am looking for a use case of integrating OSB and Azure , please throw some light on how to accomplish it.

      Thanks,
      VB.

      Delete
  28. Hi, I followed this blog and I am now seeing the helloWorldEar deployed under my local WebLogic 10.3.6, I am seeing the HelloWorldJMSService/HelloWorldJMSService?wsdl from the Deployment Tests and I generated successfully a Web Service Proxy client by running the client target in ANT. As the last step, I tried run the TestService.java but I got stuck with the error below. What do you think could be the reason?

    C:\Oracle\Middleware\JDev11g\jdk160_24\bin\javaw.exe -client -classpath C:\@d\Laboratorio\20130109\SoapOverJMS\SoapOverJMS\.adf;C:\@d\Laboratorio\20130109\SoapOverJMS\SoapOverJMS\SoapOverJMS\classes;C:\Oracle\Middleware\JDev11g\oracle_common\modules\oracle.webservices_11.1.1\wsclient.jar;C:\Oracle\Middleware\JDev11g\wlserver_10.3\server\lib\weblogic.jar -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\JDev11g\wlserver_10.3\server\lib\DemoTrust.jks -Dhttp.proxyHost=br-lihi-proxy -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=10.56.*|10.55.*|*.br-lihi.libertyinternational.com|*.indiananet.com.br|*.indiana.com.br|intranet.indiana.com.br|localhost|localhost.localdomain|127.0.0.1|::1|SISTEMA026.br-lihi.libertyinternational.com|SISTEMA026 -Dhttps.proxyHost=br-lihi-proxy -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=10.56.*|10.55.*|*.br-lihi.libertyinternational.com|*.indiananet.com.br|*.indiana.com.br|intranet.indiana.com.br|localhost|localhost.localdomain|127.0.0.1|::1|SISTEMA026.br-lihi.libertyinternational.com|SISTEMA026 nl.whitehorses.client.jms.TestService
    Can't get credentials associated with foreign jmsconnection factory: javax.naming.NameNotFoundException: Unable to resolve 'jms.CF'. Resolved 'jms' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jms.CF'. Resolved 'jms']; remaining name 'CF'
    java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Failed to send message using connection:(SoapClientConnection@30039545 )
    -> Failed to lookup jms connection
    ] FaultActor [null] Detail [weblogic.wsee.connection.ConnectionException: Failed to lookup jms connection
    at weblogic.wsee.connection.transport.jms.JmsTransport.send(JmsTransport.java:282)

    ReplyDelete
    Replies
    1. Hi,

      Did you do this,
      You need to create a Connection Factory and use your Sub Deployment. Create a JMS Queue and also use the same Sub Deployment. The JNDI Names are very important you need this in your JAX-RPC Web Service Class.

      and is the CF target to the jms server or wls server and has the CF, jms/CF as jndi name.

      thanks

      Delete
  29. Hi Edwin,

    This is a great example to follow. How could I invoke the webservice ayschronously. I do not want the client to block whilst the webservice method completes. Any ideas would much appreciated

    Thanks

    ReplyDelete
    Replies
    1. Hi

      use BPEL or do something like this http://biemond.blogspot.nl/2011/02/building-asynchronous-web-service-with_27.html

      But when the client is a web application you will still wait for the answer, when the client is a service bus then this can work.

      thanks

      Delete
  30. Hi Edwin,

    Is it possible to configure a remote queue for the WebService. The JMS Queue is not local to where the webservice is running. This will be running on another WLS instance?
    The calling client will be running in a different WL instance, we will place the message on the JMS queue on this instance. We would then like the Webservice running on a different machine/box to listen to messages from this queue.

    How would we set the following property in the WSDL to reference the queue on the calling client?


    Thanks

    ReplyDelete
    Replies
    1. Hi,

      Don't see a property of the WLJmsTransport annotation where you can provide an url. so just like a MDB you need to have the queue locally.

      maybe it can work with weblogic remote jndi.

      Thanks

      Delete
  31. Hi, Edwin,

    Is it possible to configure a SAF for the response message that the message will be sent to the local SAF queue and be forward to another remote queue?


    Thank you.

    ReplyDelete
    Replies
    1. Hi,

      Don't think so , it create a temporary local queue but with WebLogic 12.1.2 and JAX-WS you have now total control on the response queue.
      http://biemond.blogspot.ae/2013/08/jax-ws-soap-over-jms.html

      Thanks

      Delete
  32. Hi Edwin,

    Coming into your example that was quite useful. Anyway, I'm facing a problem in certain cases, let me try to explain:

    1. OSB Proxy with wss10_username_token_with_message_protection_client_policy
    2. Java client to invoke the OSB Proxy

    Using a code similar to your example it works fine if the OSB Proxy Service is Synchronous (Request and Response).
    If my OSB Proxy is asynchronous, because the service invoked by the proxy it's just a one-way service i always got the following error:

    [exception in thread "main" com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: java.lang.NullPointerException
    at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:292) ]

    Do you have any clue what can cause this error?

    ReplyDelete
    Replies
    1. Hi,

      is it fire and forget?, cause OSB does not really support async and how did you generate the proxy client?

      Thanks

      Delete
  33. Yes, I was trying with a fire and forget osb proxy service but i couldn't solve this issue! The Java Client keeps waiting for a response from the OSB proxy service and it raises an error because doesn't get response.

    Anyway, i solved it changed the interface of my osb proxy service to synchronous, e.g, the proxy keeps invoking a fire and forget business service, but always return a message (my internal message header) as response

    With this approach it works fine, has you have shown in your example.

    Thanks a lot,

    ReplyDelete