How to configure HTTP intercepter in webmethods

I have created the java service like below by implementing HTTPInterceptorIFC interface but how I will register it so that my service will be called?, what are the steps required for this?.

javaService.java (1.9 KB)

Thank you!

Please refer the section Creating an HTTP Interceptor in the administrators guide
for more details.
-NP

1 Like

Hello @Nagendra_Prasad ,

Thanks for your response.
I have gone through the above documentation but it is not clear.
Below is the package structure and my java class name is intercepter_SVC.
image (14)

I have set the below extended property to Intercepter.javaService.intercepter_SVC
watt.server.http.interceptor.outbound.impl

After doing this I restarted the server but got the below error.

java.lang.ClassNotFoundException: Intercepter.javaService.intercepter_SVC
at com.wm.app.b2b.server.ServerClassLoader.findClass(ServerClassLoader.java:805)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at com.wm.app.b2b.server.ServerClassLoader.loadClass(ServerClassLoader.java:1189)
at com.wm.app.b2b.server.ServerClassLoader.loadClass(ServerClassLoader.java:1133)
at com.softwareag.is.interceptor.HttpInterceptorManager.init(HttpInterceptorManager.java:59)
at com.wm.app.b2b.server.Server.run(Server.java:781)

Need help to understand what exactly we need to put in the extended setting.

Thank you in advance!

1 Like

To start with , I would suggest you to figure out which interceptor you need based on your usecase , inbound vs outbound.

  • The watt property you have mentioned is for the outbound interceptor , the property for the inbound interceptor is watt.server.http.interceptor.impl

  • If you need outbound interceptors, your class needs to implement com.softwareag.is.interceptor.HttpOutboundInterceptorIFC versus com.softwareag.is.interceptor.HttpInterceptorIFC for the inbound.

  • A Classnotfoundexception indicates that the class is not found in the following paths as mentioned in the documentation link

Build the class and add it to a jar file.
Place the jar file in one of the following locations that Integration Server adds to the classpath:
Software AG_directory \ Integration Server_directory \instances\instanceName\lib\jars\custom
Software AG_directory \ Integration Server_directory \lib\jars\custom
Software AG_directory \ Integration Server_directory \instances\instanceName\packages\packageName\code\jars\static

  • You can confirm if your class is available for the IS runtime to pick up.

-NP

2 Likes

Sorry @Nagendra_Prasad , In my case I want to implement inbound interceptor , outbound was mentioned by mistake.

I have my jar in place and it is also visible in class path, but still I am getting the class not found error. Not sure where exactly I am doing wrong…
Please my configuration below.



Thank you in advance!

1 Like

Hi @mukesh.b.behera
The location of the jar looks fine to me. Please note that the jar needs to be a java jar meaning that the java class needs to be in the right folder as per the package format.
For example intercepter_SVC class must be inside the Intercepter/javaService folder of the jar.

-NP

Hello @mukesh.b.behera -

I recently had to intercept HTTP calls into an Integration Server as well without the need to install and configure an external tool. I still have the Java project I created but instead of typing everything here, I figured I’d just throw it out on GitHub in case others find it useful and want to contribute.

For now, it’s a simple Eclipse Java project, but if the need arises, we can convert it to a Maven project or whatever we decide is beneficial.

Here’s the link: GitHub - nibltech/wm-http-interceptor: Sample HTTP interceptors for the webMethods Integraiton Server

Hope this helps,
Percio

2 Likes

Thanks for your Help @Percio_Castro1.

1 Like