Can any body post simple java service code to learn java service development.

Hi all ,
I am new to java services in webmethods.Just now i started learnig java services dvelopment.
Can any body post simple java services code…so that it will be useful for me.
Hope for reply…

Hello mumbai,

See the sample codes posted in the Software AG community site. You should find sample Java service code posted there.

http://techcommunity.softwareag.com/ecosystem/communities/codesamples/webmethods

You can watch and create your Java service:

http://idnxchange.com/video/viewvideo/53/development/wm-java-services.html

Hope this helps.

Hi

It seems link for Java sample are broken !

Regards

Here’s a quick walkthrough to create a HelloWorld java service

  1. Create the java service inside a package/folder from the package navigator. I called mine ‘helloWorldJavaService’.
    image

  2. Go to the input/output tab by pressing where highlighted
    image

  3. Define your service contract (input and outputs. In this example, we’ll take a string variable to receive a name, and a string response that contains the greeting, e.g.
    image

  4. Go back to the source, right click and find the ‘Generate Code…’ menu item and press this

  5. It’ll ask you to save your service, press to do so, then you’ll see the Code Generation dialog. Select ‘For implementing this service’ and press Finish
    image

  6. A pop-up dialog will inform you that the generated code has been copied to the clipboard
    Press ‘Ok’
    image

  7. Now back in your java service code, in the highlighted area:
    image
    press to paste the generated code.

  8. It should then look something like this:
    image

The generated code contains the lines to take the input from the pipeline and put them into java variables, and also to return java variables into the pipeline.

  1. Now you just need to add whatever code you like, and change the output variable, I’ve highlighted the bits I’ve just added:
    image

  2. Now you can run your service:

and you should see the right result :blush:

1 Like

Hi,

Do you have an complete Angular application Sample wiith ACME on your repository ?

Regards

If you want to call an Integration Server service from an angular application then I would create a REST descriptor for the service to expose this as a REST endpoint, then consume this REST endpoint in the angular application.

Angular structure/code/examples differ across versions (it’s one thing which frustrates me about angular). If you search the web you can probably quickly find an example based on the version of angular you’re using, but here’s a starting point from the angular docs: Angular - Communicating with backend services using HTTP

If the Integration Server endpoint is being called from the front-end (browser) and the IS/Angular server have different addresses, then you may need to consider CORS, or proxying the request from the server hosting the angular app to the integration server. You should also think about securing the REST endpoint to reduce attack vectors from malicious actors, whether that be via an API Gateway, or other security configuration and appliances.