Invoking a Web Service from a Java Service Type (Sonic 8.5) - Forum - Technology Partner - Progress Community

Invoking a Web Service from a Java Service Type (Sonic 8.5)

 Forum

Invoking a Web Service from a Java Service Type (Sonic 8.5)

  • I have used Sonic Connect to creae a Web Service Client and can invoke the Web Service from within a Process. Now I'd like to invoke the Web Service from within a Java Service Type and I'd appreciate a bit of advice.

    Is the best approach to:

    1) Invoke the Spring configuration created by Sonic Connect from within the JST? Some sample code would be really helpful.

    2) Re-create the Web Service client as a JAX-WS POJO using Sonic Connect Java Proxy and invoke that from the JST? Some sample code would be helpful?

    3) Use some other method?

    I have experience using Web Serivces in .NET but not as yet in Java so a little hand holding would be appreciated.

    Thanks

    Steve

  • Out of curiosity, any reasons why you would invoke Web Service from Java Service Type instead of using Sonic Connect?

  • Out of curiosity, any reasons why you would invoke Web Service from Java Service Type instead of using Sonic Connect

    Performance.

    Due to the nature of our application, processing some transactions takes quite a few Steps, including several CBRs. Comapred to our existing ESB (hand crafted in .NET), Sonic is taking about 6.5 - 7 times as long - which is unacceptable. I've done a fair bit of analysis and the problem doesn't appear to be in our JST code, but is simply that CBR appears quite expensive and it is not possible to dramatically reduce the number of Steps. Since we are replacing an existing ESB there are some design constraints that I simply cannot work around.

    I've worked out what looks like a fairly simple way to do some critical processing in a JST and it will be a lot more convenient if I can invoke a remote web serice directly from Java code.

    Since Sonic Connect does such a fine job of creating the services in Spring it seems a reasonable approach to continue using them, if possible. If that isn't possible I'll probably resort to JAX-WS.

    Regards

    Steve

  • Getting technical support to look at the CBR performance issue may be good.  It could be something fixable.

    My initial thought is that I would keep the SC as is and you can have your (optimized) JST step to pass message to the SC step (ESBP proceess may look like: JST -> SC).   I am guessing  you are using CBR to do further processing based on responses from SC? (JST -> SC -> CBR)   So, you are trying to optimize the CBR after the call as well.  Would something like this work (JST -> SC -> JST)?  It would allow SC to be reused.

    To reuse Spring config without a SC, it will involve programming with some unpublished ESB APIs.  If you absolutely need to invoke Web Service from Java code, I would look at CXF to generate Java client stub from a WSDL.