Skip to Content
0

HTTP Rest Adapter - always calling the same Service Interface

Aug 09, 2017 at 02:58 PM

94

avatar image

I have tried to setup a HTTP Rest adapter to take JSON requests. I would like to setup one adapter to handle all the requests from our Hybris system.

For this Rest adapter, I need it to support 4 different calls:

Shipment

Registration

Sample

Request

I tried setting up the Rest adapter with the following settings:

Channel Selection:

Rest Resources:

Rest Operation:

Standard - no changes past default

Operation Determination:

This works to a point. It picks the correct Operation Determination but runs the wrong OM.

Here is a snippet of the log from a Registration attempt:

What am I doing wrong? Any advice?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ryan Crosby Aug 09, 2017 at 03:12 PM
0

Hi Brian,

Based on the error it looks like it is triggering an incorrect mapping as per the operation that is setup in the configuration. The first place I would check is the integration flow configuration in relation to the operation mapping that is defined for each operation.

Regards,

Ryan Crosby

Show 11 Share
10 |10000 characters needed characters left characters exceeded

That is what makes this so wierd. I have checked the ICO objects. I have even deleted the Shipment line from the Adapter, but yet the adapter still calls the wrong one.

I can't figure out what is going on.

0

Hi Brian,

The first thing to check in relation to mapping is to see what the root message type that is generated by the system based on your REST sender configuration. That will drive what mapping is executed by the system so you want to look at your payload first.

Regards,

Ryan Crosby

0

I am generating these tests and the 2 requests are quite different. I did have a few issues with the ICO objects.

First I have 2 ICO objects created, both use the same CC (as all the above is defined in one CC).

The only other difference is that both have the Software component turned off (blanked out). If that is filled in I get an error that no objects could be found. It seems to me that the system is just picking the first ICO object it finds.

I thought I understood how to create a HTTP Rest adapter and the subsequent objects - but alas, I do not...

0

Hi Brian,

Therein lies your problem - you can reuse the channel across multiple sender interfaces but not if the configurations are not tied to interfaces within the ESR. The request handling in the REST sender channel would need to generate the exact Message Type for the system to pick the appropriate ICO if you have more than one. Without that link it will simply pick the first one that it finds.

Regards,

Ryan Crosby

0

So how do I configure the Rest adapter to work? If I set the software component on the ICO object - this is what I get for an error:

Error while sending message to module processor: Sender Channel: Catching exception calling messaging system: InterfaceDetermination did not yield any actual interface

I cannot get past that error... Any suggestions?

0

Hi Brian,

This is the part where the configuration of your REST sender channel has to generate a message that your system knows what to do with. Here is an easy way to determine what gaps you have... for each operation take your generated payload and copy/paste it into your operation mapping test tab. If the operation mapping does not process it correctly then you have a mismatch in your interface definition vs. what is generated in the REST adapter based on the source payload. You have to keep in mind that the root XML node and structure of that node must match the expected Message Type of the sender interface for which you want to execute a message. That includes the name as an exact match and is case sensitive, the namespace, and all the structural elements of the defined Message Type.

Regards,

Ryan Crosby

0

There in lies the problem Ryan. I can do exactly as you specify. I can take the input from the message monitor and paste it in the OM - it works. Here is the input:

axel@gmail.com en 0006005715 Norman, Fox & Co. 14970 Don Julian Road City Of Industry CA 91746 US Herr Axel Volz CC 0q0

above is all test data so nothing secret. I validated the namespaces were correct. The OM testing works just fine. I can find no reason why I keep getting the "interface determination did not yeild any actual interface".

0

Hi Brian,

The payload that you shared isn't an XML document - the system won't determine an appropriate interface if the message is in that format when the interface determination executes. The output from the REST sender adapter should yield an XML message that corresponds to the Message Type of your sender interface for the operation that you want to execute.

Regards,

Ryan Crosby

0

Actually it is, but the text box remove all the XML tags.

<SIOS_Hybris_SFDC__Registration xmlns="http://lonza.com/xi/Hybris">
	<REQUEST xmlns="">
		<IV_EMAIL>axel@gmail.com</IV_EMAIL>
		<IV_LAISO>en</IV_LAISO>
		<IS_ADDRESS>
			<KUNNR>0006005715</KUNNR>
			<ORGANISATION>Norman, Fox & Co.</ORGANISATION>
			<HOUSE_NO>14970</HOUSE_NO>
			<STREET>Don Julian Road</STREET>
			<SUITE/>
			<ADD_STREET/>
			<CITY>City Of Industry</CITY>
			<STATE_PROV>CA</STATE_PROV>
			<ZIP_CODE>91746</ZIP_CODE>
			<COUNTRY>US</COUNTRY>
			<VAT/>
			<EORIP_NO/>
			<CP_TITLE>Herr</CP_TITLE>
			<CP_AK_TITLE/>
			<CP_NAME_FIRST>Axel</CP_NAME_FIRST>
			<CP_NAME_LAST>Volz</CP_NAME_LAST>
			<CP_PHONE/>
			<CP_FAX/>
			<CP_EMAIL/>
			<CP_FLOOR/>
			<CP_ROOMNUM/>
			<CP_BUILDING/>
			<CP_DEPARTMENT/>
		</IS_ADDRESS>
		<IV_BU>CC</IV_BU>
		<IV_CUST_TYPE>0cq0</IV_CUST_TYPE>
	</REQUEST>
</SIOS_Hybris_SFDC__Registration>

I have copied this into the OM test window and it works with no issues. Yet I still get an error. Here is the message log for the transaction:

8/9/2017 07:42:10.042 PM Information Parsed attribute "operation": "POST" 
8/9/2017 07:42:10.042 PM Information Mapped message to http://lonza.com/xi/Hybris:SIOS_Hybris_SFDC__Registration. Matching rule: Registration->Registration 
8/9/2017 07:42:10.061 PM Information MP: processing local module localejbs/CallSapAdapter 
8/9/2017 07:42:10.061 PM Information Application attempting to send an XI message synchronously using connection REST_http://sap.com/xi/XI/System 
8/9/2017 07:42:10.079 PM Error Returning to application. Exception: com.sap.aii.adapter.xi.routing.RoutingException: InterfaceDetermination did not yield any actual interface 

The Rest adapter picks up the correct matching rule but will not work.

I have made sure the XSD also uses the same namespace as well.

0

Hi Brian

This is the message that came directly from the message monitor? If this is from the message monitor then you probably have some inconsistency in your integration flow and you should tear it down and rebuild it with all of the proper SWCV references.

Regards,

Ryan Crosby

0

You were correct, there was some issue with the 2 ico objects. I deleted (and activated that deletion) then re-created the ICO objects and now everything is working like I thought it should.

Thanks!

0
Brian Schroll Aug 09, 2017 at 03:03 PM
0

I re-read my submission but I don't think I was very clear with the problem. When I try to send a "Registration" transaction to the HTTP REST Adapter, the adapter sees it as a Registration and picks the correct Service Interface.

However the wrong Operation Mapping is actually called. The one that is called is for the Shipment transaction (not the Registration). These are on 2 very different Service Interfaces and Integrated Configuration Objects.

If you can, I am looking for insight into what is going on. I also welcome any suggestions on how to better setup the HTTP Rest adapter.

Share
10 |10000 characters needed characters left characters exceeded