Recently I had the requirement to create an interface that needs to accept a Http request with some extra parameters, and I had to route a file to different folders depending on those parameters.
The PI’s environement is PI 7.31 Java Stack only so I had to create an integrated configuration with a Http (sender) adapter and N File (receiver) adapters.
At this point you could be thinking what could be the tricky thing in this “simple” scenario. Well, the “problem” is the use of the URL parameters set in the Http adapter and the ones that you want to use as condition in the receiver or interface determination.
The sender adapter is an HTTP_AAE adapter with some URL parameters set:
In my interface we need to route based on Mailbox (URLParamOne)
So the condition defined in the integrated configuration was this one:
In the expression editor:
Once configured the conditions and the receivers, the simple scenario should be finished but….
When I began to test, one error went me crazy: Error: com.sap.aii.adapter.xi.routing.RoutingException: InterfaceDetermination did not yield any actual interface
What could be the problem if I have set the URLParamOne from the context and must be the same defined in the HTTP channel?
The problem is the NAMESPACE of this parameter
Analyzing the problem i found that the URL parameter came as http://sap.com/xi/XI/System (message trace, dynamic configuration):
<sap:Record namespace=”http://sap.com/xi/XI/System“ name=”URLParamOne“>ROUTE1</sap:Record>
And as you can see defining the condition, the context object has the next namespace http://sap.com/xi/XI/System/HTTP_AAE
So, the parameter is not recognized and the routing raise an error.
Using the adapter module AF_Modules/DynamicConfigurationBean in HTTP sender adapter I could solve the problem making a basic variable change as follows:
As you can see, first I get the value from the URLParamOne | http://sap.com/xi/XI/System and store it in module.filename value, after that, i set the URLParamOne | http://sap.com/xi/XI/System/HTTP_AAE with that value.
Hope this blog helps, I went crazy with it