Invoke workbench web service from any client - Forum - Technology Partner - Progress Community

Invoke workbench web service from any client

 Forum

Invoke workbench web service from any client

  • I have developed ESB process using sonic workbench 8.0 and expose it as web service now how can I inoke this web service from any client (like java) ?

    Thanks,

    Dinesh

  • Dinesh,

    as the first step I would recommend checking if the service is really accessible. The most simple way is to get the WSDL URL and try to open it in your web browser. If it will display the WSDL, you know that it might work.

    Then you could install a SOAP test tool (for example, I use soapUI) and try to invoke the service from there.

    And then you could try to invoke it from Java. There is a lot of tutorials concerning JAX-WS, e.g. this one. You can skip the first part concerning server, and do just the second one ("Developing WebService Client").

    Regards,

    Pavol

  • Thanks for your help Pavol Mederly.

    But how could I define SOAP address in my WSDL document and access it from web browser?

    In other case of web services deployed using OE 10.2B progress explorer tool, it is possible to host this web service using sonic workbench? If so how to do this?

    Thanks,

    Dinesh

  • If you expose your process using Sonic Connect (which I assume you do), you specify the address using Sonic Connect Editor, by editing the file SonicConnectService.scsvc.

    There is a property called ".address", which is, by default, http://0.0.0.0:3580/connect/ (0.0.0.0 means any local interface at your host).

    An example (see the third property) is shown in attachment. In my case, the process was called "Support.SoapUnicode.P1" (that's why the name of the service is such a wierd one; it can be customized within the wizard).

    So, the "SOAP address" is http://0.0.0.0:3580/connect/Support.SoapUnicode.P1, and the WSDL is reachable at http://0.0.0.0:3580/connect/Support.SoapUnicode.P1?wsdl. (When accessing the service from another machine, replace 0.0.0.0 by your hostname - or you can do it directly in the Sonic editor shown in the screenshot.)

    You can see the address in your container log as well. In this case (in the log of dev_ESBTest):

    INFO: Setting the server's publish address to be http://0.0.0.0:3580/connect/Support.SoapUnicode.P1
    22.3.2012 9:21:33 org.mortbay.log.Slf4jLog info

    Hope this helps,

    Pavol

  • Thank a lot Pavol Mederly for your concern and help,

    But I can't locate http://0.0.0.0:3580/connect/ in .esbsvc file but in container log i find Management connection (re)established (Socket[addr=/169.254.128.60,port=2506,localport=57454]) this info from log

    file if the add is this I don't know how to change it. Can you please provide some steps.

    On the other hand It is possible to host already deployed web service ( say OE) in ESB if so how to do it?

    Thanks,

    Dinesh

  • Dinesh,

    the URL is not in .esbsvc file (= ESB Java Service Type), but in .scsvc file (= Sonic Connect service).

    Also, the line "Management connection (re)established..." in the container log does not belong to Sonic Connect, but it is a standard message produced by any Sonic container.

       Are you sure that you have used Sonic Connect to expose your process as a Web Service?

       And, have you deployed your Sonic Connect service into your container?

    Relevant information how to do this is in this book, namely on page 20 (plus, do not forget to deploy the Sonic Connect service to a container). A nice tutorial how to expose ESB process as a Web Service is also here.

    I would recommend you to have a look at these, especially at the tutorial.

    Concerning your second question about OpenEdge - I'm sorry I have no experiences with OE. Sonic containers can host any JAX-WS web services, so if you would produce such a service with OE, it would probably run in the container. Again, there is a demo (number 4 at this page) saying how to do it.

    Best regards,

    Pavol

  • Thank you Pavol Mederly,

    Your reply help me lot. Now I can find the URL and also able to change it. I change it as "http://localhost:3580/wsdl/getCustomerFromOE". But when I'm trying to access the wsdl file from the web browser in order to test the web service using SOAP UI software using URL as "http://localhost:3580/wsdl/getCustomerFromOE/wsdl?" but it throws error as,

    soap:Server

    Fault occurred while processing.

    Same error rises when I 'm trying to access wsdl file mentioned in the Sample Project as "http://localhost:9191/patientservice" but works well in Worbench JaxWSClient project.

    What could be the solution for this? And how can I access this WSDL file from any other client using some URL?

    Thanks in Advance.

    Regards,

    Dinesh

  • Hello Dinesh,

    the reason is simple - you have misspelled the WSDL link.

    Instead of

        http://localhost:3580/wsdl/getCustomerFromOE/wsdl?

    you should use

        http://localhost:3580/wsdl/getCustomerFromOE?wsdl

    (i.e. published URL + "?wsdl")

    Try this, it should work.

  • Thanks a lot Pavol Mederly.

    Dinesh

  • On the other case I have sucessfully developed and tested ESB process using some WSDL file say "http://localhost:8080/wsa/wsa1/wsdl?targetURI=urn:NS3". Then I 'm trying to expose this esb process as web service using bottom up approach and I choose New WSDL option and finished exposing web service. Now the new WSDL URL is "http://localhost:3580/connect/ConsumeNExpose" whic I'm trying to run from web browser the following error will occur,

    HTTP ERROR: 404

    Problem accessing /connect/ConsumeNExpose. Reason:

        NOT_FOUND

    Powered by Jetty://

    What could be the solution?

    Regards,

         Dinesh

  • Are you sure you have upload the changed Sonic Connect service to your container?

    If yes, it would be helpful if you would post your container log here; perhaps with zipped sonic project from workspace as well.

    Remeber, also, that in the browser you have to add "?wsdl" to your URL. (However, the error you got is not caused by this.)

    Best regards,

    Pavol

  • Hi Pavol,

    When I'm going to test using some scenario. The container log file displayed as follows.

    [12/04/02 14:40:30] (info) Reload ID=TESTContainer initiated...
    [12/04/02 14:40:31] ID=TESTContainer (info) [ExposeWebServices] Stopped.
    [12/04/02 14:40:31] ID=TESTContainer (info) Container suspended -- Status: offline
    [12/04/02 14:40:31] ID=TESTContainer (info) [ExposeWebServices] Destroyed.
    [12/04/02 14:40:31] (info) Unloaded ID=TESTContainer
    [12/04/02 14:40:32] ID=TESTContainer (info) TESTContainer initializing...

        Sonic ESB Professional Developer Edition [Serial Number: 999999999]
        Release 8.0.0 Build Number 520
        Copyright (c) 2001-2010 Progress Software Corporation.
        All Rights Reserved.


    [12/04/02 14:40:32] ID=TESTContainer (info) [ESBService] Initializing Service `ExposeWebServices`
    [12/04/02 14:40:32] ID=TESTContainer (info) [ESBService] Initializing Service `dev.DBService`
    [12/04/02 14:40:33] ID=TESTContainer (info) [ESBService] Service `ExposeWebServices` initialized: 1 thread(s) listening on Endpoint ExposeWebServices.Entry
    [12/04/02 14:40:33] ID=TESTContainer (info) [ESBService] Service `dev.DBService` initialized: 1 thread(s) listening on Endpoint dev.DBService.Entry
    [12/04/02 14:40:33] ID=TESTContainer (info)

        Sonic Connect
        Version 8.0 Build Number 604
        Copyright (c) 2010 Progress Software Corporation.
        All rights reserved.


    [12/04/02 14:40:35] ID=TESTContainer (info) [ExposeWebServices] Initialized.
    [12/04/02 14:40:35] ID=TESTContainer (info)

        Sonic Database Service
        Release 8.0.0 Build Number 491
        Copyright (c) 2005-2008 Progress Software Corporation.
        All Rights Reserved.


    [12/04/02 14:40:35] ID=TESTContainer (info)
    [12/04/02 14:40:35] ID=TESTContainer (info) Actional instrumentation is disabled for this container
    [12/04/02 14:40:35] ID=TESTContainer (info) Initializing Mitigation context factory class: com.sonicsw.xqimpl.actional.lg.visitor.StabilizerHelper
    [12/04/02 14:40:35] (info) Loaded ID=TESTContainer
    [12/04/02 14:40:35] ID=TESTContainer (info) [ExposeWebServices] Started.
    [12/04/02 14:40:35] ID=TESTContainer (info) Container's ESB (JMS) Connection: jms_defaultConnection
    [12/04/02 14:40:35] ID=TESTContainer (info) Container's HTTP Routing Connection: http_defaultConnection
    [12/04/02 14:40:35] (info) ...reload ID=TESTContainer complete
    [12/04/02 14:40:36] ID=TESTContainer (info) Attempting to (re)establish connection: jms_defaultConnection
    [12/04/02 14:40:38] ID=TESTContainer (info) Connection to endpoint 'ExposeWebServices.Entry' (re)established for connection 'jms_defaultConnection' at jv72-dinesh:2506

    [12/04/02 14:42:19] ID=TESTContainer (severe) [Dispatch] Exception calling service ExposeWebServices: message rejected
    [12/04/02 14:42:19] ID=TESTContainer (severe) Trace follows...
    com.sonicsw.xq.XQServiceException:  (No bean named 'ConsumeNExposeService.ConsumeNExposePort.ConsumeNExpose' is defined) (No bean named 'ConsumeNExposeService.ConsumeNExposePort.ConsumeNExpose' is defined)
        at com.progress.sonic.esb.service.connect.ConnectService.service(ConnectService.java:243)
        at com.sonicsw.xqimpl.service.debug.DebugServiceInterceptor.intercept(DebugServiceInterceptor.java:118)
        at com.sonicsw.xqimpl.service.XQServiceChain$XQInterceptorServiceWrapper.intercept(XQServiceChain.java:487)
        at com.sonicsw.xqimpl.service.XQServiceChain$XQInterceptorServiceWrapper.service(XQServiceChain.java:476)
        at com.sonicsw.xqimpl.service.XQServiceChain.service(XQServiceChain.java:152)
        at com.sonicsw.xqimpl.service.ServiceMessageHandler.callService(ServiceMessageHandler.java:477)
        at com.sonicsw.xqimpl.service.ServiceMessageHandler.handleMessage(ServiceMessageHandler.java:204)
        at com.sonicsw.xqimpl.service.XQDispatcher.onMessage(XQDispatcher.java:434)
        at com.sonicsw.esb.itinerary.model.EsbStepNode.doExecute(EsbStepNode.java:232)
        at com.sonicsw.esb.itinerary.model.EsbStepNode.execute(EsbStepNode.java:144)
        at com.sonicsw.esb.process.model.impl.DefaultActivityNode.offerIncoming(DefaultActivityNode.java:139)
        at com.sonicsw.esb.itinerary.engine.ItineraryEngine.executeProcess(ItineraryEngine.java:325)
        at com.sonicsw.esb.itinerary.engine.ItineraryEngine.handleToken(ItineraryEngine.java:188)
        at com.sonicsw.esb.itinerary.engine.ItineraryEngine.handleMessage(ItineraryEngine.java:178)
        at com.sonicsw.xqimpl.endpoint.container.EndpointContextContainer.onMessage(EndpointContextContainer.java:94)
        at com.sonicsw.xq.connector.jms.JMSEndpoint$JMSEndpointListener.onMessage(JMSEndpoint.java:577)
        at progress.message.jimpl.Session.deliver(Session.java:3057)
        at progress.message.jimpl.Session.run(Session.java:2463)
        at progress.message.jimpl.Session$SessionThread.run(Session.java:2852)
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ConsumeNExposeService.ConsumeNExposePort.ConsumeNExpose' is defined
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:971)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:246)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:238)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:238)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:238)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
        at com.progress.sonic.esb.service.connect.ConnectService.getTargetEndpoint(ConnectService.java:367)
        at com.progress.sonic.esb.service.connect.ConnectService.service(ConnectService.java:209)
        ... 18 more

    Regards,

    Dinesh

  • Spring is complaining 'ConsumeNExposeService.ConsumeNExposePort.ConsumeNExpose' bean is not defined.   Is it possible to share your project?
  • Hi William,

    Please find the attachment.

    Thank you,

    Dinesh

  • It looks to me that you just need to re-build/re-upload the project/service.  Please try right click on the project and select "Progress Sonic" -> "Upload All".