Discussions

News: "Web Services and J2EE" Article Posted on TheServerSide

  1. The fourth article in the Developing Web Services Series, "Web Services and J2EE", has been posted. This article introduces the basic wrapper Web service and the transparent integration framework and explain the situations in which each approach provides substantial advantages. It also show how SOAP messages can be sent over the JMS protocol.

    Read Web Services and J2EE.

    Feel free to discuss the article here.

    Threaded Messages (17)

  2. A very interesting article. I cannot wait until I try the demo. Still, I have a question:
    describing the "Transparent J2EE integration" it is stated that:
    <quote>
    The client application can then use this remote reference to invoke methods on the J2EE resource. Each method invocation is transported over SOAP to the J2EE proxy, which redirects the request to the actual J2EE resource. You'll notice that no code modifications are required in either the J2EE resource or in the client code. Only a configuration change is required in the client to point to the SOAP-based JNDI provider.
    </quote>
    My question, How can you invoke on the J2EE proxy over SOAP? Don't you need to translate the SOAP xml message to something understood by the J2EE proxy? And to achieve that don't you nee to write code?
    Thanks,
    //Sam.
  3. The WASP framework automatically generates all the code necessary to invoke the proxy. All that you need on the client is an interface class (the same interface that you need to access J2EE directly). WASP automatically generates a dynamic proxy to implement the interface. The dynamic proxy converts your standard RMI request into a SOAP request that gets sent to the J2EE proxy. The J2EE proxy then redirects the request to the J2EE resource using RMI.

    Anne Thomas Manes
    CTO, Systinet
  4. Hi,

    I'll try the examples right now and I must admit concerning integration within J2EE I'm already fascinated by reading the article but how does a VB client invoke the J2EE proxy ? What I see is that I'll receive a Soap-Implementation for my J2EE EJB Remote interface but a VB client wouldn't understand something like that !?

    Oliver
  5. A brilliant article that shows what the future can offer regarding to integrating IT systems.
    The WASP server works fine and the examples are ! easy ! to apply and they work, too !
    I don't know why companies are still laying off IT people. Those guys should read this series and they'll understand - hopefully - in what they should invest. In J2EE, Webservices, SOAP and skilled IT workers...like the ones from Systinet..:-)

    AXA Insurance
    Oliver
  6. There are two approaches how to access EJB via SOAP from VB in the WASP framework. The client-side JNDI API calls are redirected to the JNDI service on the server. You can obviously talk to this service from any SOAP client (see its WSDL at http://localhost:6060/internal/jndi/). The only obstacle is that you have to be able to handle remote reference structures that are returned back from the server. It isn't a rocket science, just simple SOAP structure with WSDL and instance ID that must be propagated through specific SOAP header then.

    WASP also offers great shortcut for stateless session EJBs that can be accessed directly. You can simply access the WSDL of any stateless session EJB at http://localhost:6060/internal/ejb/session/stateless/?jndiName=JNDIName where JNDIName is the name of the EJB in the JNDI. Once you have the WSDL you can use it from any SOAP client.

    ZD
  7. Hi,

    Thanks. It works. I've fetched the wsdl and called my/any EJBs with WASP DDI without doing almost nothing.
    Fantastic !
    Now it's time to talk to my management..:-)

    Oliver
    AXA Insurance
  8. This article is supreb. But could any one help me getting to the links for the previous 3 articles. Please could anyone mail me the links to vijay.narayanan@lycos.com
  9. Here you are:

    http://www.theserverside.com/resources/article.jsp?l=Systinet-web-services-part-1
    http://www.theserverside.com/resources/article.jsp?l=Systinet-web-services-part-2
    http://www.theserverside.com/resources/article.jsp?l=Systinet-web-services-part-3


    ZD
  10. Zdenek~

    The recent article was excellent. Although the previous articles were good too, it is really nice to see how WASP handles integration with J2EE.

    I am running into a problem though invoking the StockClient program while working through the example. I have set everything up properly (deployed EJB, restarted J2EE server, compiled and deployed web service etc...) When running the StockClient though I am getting an org.omg.CORBA.COMM_FAILURE exception. I ran the program through a TCPTunnel utility and the SOAP message is being passed to WASP properly and the WSDL interface is being returned, but then it throws the exception. Do you think I have some sort of configuration issue with my J2EE RI?

    Thanks,

    Harris
  11. Harris,

    I need more details. Could you please send me the generated WSDL file and exception to tutorial at systinet dot com . I'll also need the exact version of your JDK and J2EE RI. Then we are certainly able to help.

    ZD
  12. Thanks for a great article. I have a question about a more complex scenario. Let's say I have a stateful session bean and a few value objects that go with it, for example SalesSession.updateOrder(OrderInfo order). I also have an XML schema that corresponds to OrderInfo, which I have agreed to use with my partners. How would I set up the mapping using WASP on the client and server sides? Does using the transparent JNDI invocation create any side issues for (de)serialization of parameters in WASP?
  13. First, the SOAP server encodes the OrderInfo structure with the SOAP Section 5 encoding by default. If you neeed to use your own schema, you can write custom serializer/deserializer. Basically you need to write the transalation code and then register it with the framework (associate the serializeation code with the type). If you need to know how to do it with WASP, please let me know at tutorial at systinet dot com .

    ZD
  14. Hi

    This is very interesting article.
    i went ahead and tried the demo but it did't worked for me.
    can you pls help me.
    i am getting this Message when i try to run the deploy_j2ee.bat

    Message is :
    Could not connect to localhost
    Sender object Deploytool (Main) : Could not connect to localhost
    added manifest
    adding: com/systinet/demos/stock/StockQuote.class(in = 249) (out= 195)(deflated 21%)
    adding: com/systinet/demos/stock/StockQuoteBean.class(in = 1203) (out= 621)(deflated 48%)
    adding: com/systinet/demos/stock/StockQuoteHome.class(in = 304) (out= 209)(deflated 31%)
    ignoring entry META-INF/
    adding: META-INF/ejb-jar.xml(in = 999) (out= 430)(deflated 56%)
    added manifest
    adding: StockModule.jar(in = 2470) (out= 1908)(deflated 22%)
    adding: StockModule.xml(in = 999) (out= 430)(deflated 56%)
    ignoring entry META-INF/
    adding: META-INF/application.xml(in = 396) (out= 243)(deflated 38%)
    adding: META-INF/sun-j2ee-ri.xml(in = 265) (out= 152)(deflated 42%)
    Could not connect to localhost
    Sender object Deploytool (Main) : Could not connect to localhost
    Press any key to continue . . .


    Thx for any help
  15. Vikas,

    Please make sure that you started the J2EE server and wait until it says that it is started on its console. You can start the J2EE server using the startJ2EE.bat script that is in the demo sources in the bin directory. If this doesn't help please send me an e-mail to tutorial at systinet dot com and we can further investigate the problem.

    ZD
  16. Hi!
    I will try to this example. I had use insted of J2EE VisualAge for Java.
    It is very good article. Can you show me how i learning mail service?

    Thank a lot.
  17. WHY STOCK QUOTESERVICE DOESN'T LOAD[ Go to top ]

    Dear

    This is excellent series to start web services technologies. I am trying part-1 for this. When i try to deploy StockQuote exapmle with deploy.bat, after authentication (username : admin , password : changeit), it displayed message:

    D:\wasp_demo\bin>deploy

    D:\wasp_demo\bin>call env.bat

    D:\wasp_demo\bin>set WASP_HOME=D:\wasp461

    D:\wasp_demo\bin>set WASP_DEMO=D:\wasp_demo

    D:\wasp_demo\bin>set PATH=D:\wasp461\bin;D:\j2sdk1.4.1_05\bin;.

    D:\wasp_demo\bin>set CLASSPATH=D:\wasp461\lib\wasp-advanced.jar;D:\wasp_demo\src
    ;D:\wasp461\lib\wasp-advanced.jar;D:\wasp_demo\src;D:\wasp461\lib\wasp-advanced.
    jar;D:\wasp_demo\src;.,D:\Sun\j2eesdk1.4_beta2\lib\j2ee.jar

    D:\wasp_demo\bin>cd D:\wasp_demo\src\com\systinet\demos\stock

    D:\wasp_demo\src\com\systinet\demos\stock>javac -d D:\wasp_demo\src StockQuoteSe
    rvice.java

    D:\wasp_demo\src\com\systinet\demos\stock>deployTool --deploy -t http://localhos
    t:6060 -c com.systinet.demos.stock.StockQuoteService -u /StockQuoteService/
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      This command is deprecated.
      Please, next time use "Deploy" or "Undeploy" instead.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Authentication required:
      username:admin
      password:
      using security provider:HttpBasic
    Exception:
    Cannot load class com.systinet.demos.stock.StockQuoteService

    ### WHY STOCKQUOTESERVICE DOESN'T LOAD###
    Thanks in advance
  18. C:\wasp_demo\bin>deploy

    C:\wasp_demo\bin>call env.bat

    C:\wasp_demo\bin>set WASP_HOME=c:\wasp-advanced

    C:\wasp_demo\bin>set WASP_DEMO=c:\wasp_demo

    C:\wasp_demo\bin>set PATH=c:\wasp-advanced\bin;D:\j2sdk1.4.1_01\bin;.

    C:\wasp_demo\bin>set CLASSPATH=c:\wasp-advanced\lib\wasp-advanced.jar;c:\wasp_demo\src;C:\Program Files\Cordys\WCP\wcp.jar;C:\Program Files\Cordys\WCP\jldap.jar;C:\Program Files\Cordys\WCP\xerces.jar;
    C:\Program Files\Cordys\WCP\ldapjdk.jar;C:\Program Files\Cordys\WCP\jms.jar;C:\Program Files\Altova\xmlspy\XMLSpyInterface.jar;.;

    C:\wasp_demo\bin>cd c:\wasp_demo\src\com\systinet\demos\stock

    C:\wasp_demo\src\com\systinet\demos\stock>javac -d c:\wasp_demo\src StockQuoteService.java

    C:\wasp_demo\src\com\systinet\demos\stock>deployTool --deploy -t http://localhost:6060 -c com.systinet.demos.stock.StockQuoteService -u /StockQuoteService/
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      This command is deprecated.
      Please, next time use "Deploy" or "Undeploy" instead.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Exception:
    Cannot load class com.systinet.demos.stock.StockQuoteService


    ****************************************************
    I am using WASP Java Server (wasp-java-5.0)
    and JDK 1.4.1 (j2sdk1.4.1_01)
    ****************************************************

    Can someone help me with this ?

    Regards

    Praveen