Hi Ahmed,
For writing IS service programmatically (usage of MessagContext) etc, you can refer this article and the IS package attached here. Invoke webMethods IS policy in API Gateway 10.1 and below
In your case, the MessageContext you need to import is “org.apache.synapse.MessageContext”.
Add the below jars in the build path for the package in Software AG Designer.
- axis2-kernel-.jar, axis2-transport-http-.jar and synapse-core-*.jar from <Install_Location>\WS-Stack\lib
- <Install_Location>\IntegrationServer\instances\default\packages\WmAPIGateway\code\jars\apigateway-runtime.jar
- <Install_Location>\IntegrationServer\instances\default\packages\WmAPIGateway\code\jars\static\apigateway-API.jar
The above changes are to resolve the compile time errors thrown by Designer during edit and save of the java services inside the package. Also, make sure wmAPIGateway package is added as the package dependency to this package (this is for runtime).
For screenshot references of above steps, refer the tech forums link I shared above.
Regards,
Vallab