Accessing RestMessageContext from java service

Hi Yunus,

Adding jars to classpath is for the designer IDE (eclipse-based) to understand the dependencies and provide IDE support for the Java code such as code suggestions, auto-import, showing compile errors, etc, which is helpful for easier development of the java code.

However, for marking the dependency at the Integration Server level, you need to add the wmAPIGateway package in the package dependencies of your IS service package. Othewise you would get the errors you mentioned.

Writing Java service to programmatically access the MessageContext is a old approach. Newer versions (10.3 and later) support a lot of usecases which can be achieved via flow service using pipeline variables without having to write java service. More details here.. Please take a look at this article if you are not already aware of this.

Regards,
Vallab.

1 Like