cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver HTTP (GET) channel configuration

former_member694142
Participant
0 Kudos

Hi Experts,

We have a requirement where the scenario is to develop a Proxy to HTTP (GET) synchronous interface.

The target url given by the third party is as below form:

https://abcd.com/InjectMessage?code=awefv_inject&username=xyzw&password=258963&msg=FeedBack&from=<Customer # preceded by 91>&user.name=<Customer Name>&user.city=<Hotel Name>

Kindly help me with the receiver HTTP GET channel configuration.

Do i need to add header details in advanced tab? If yes, pls guide how.

Also would like to know about Main Payload Parameter Name field in Request details in General tab.

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Ashish

Noticed from your screenshot that you are on PI 7.4. And I noticed from your other thread that you also have REST adapter.

I'd suggest using the REST adapter for your HTTP GET scenario. REST adapter provides more functionality when dealing with HTTP scenarios.

You can check the following blog which shows you how you can configure the adapter that uses dynamic URL.

Regards

Eng Swee

former_member694142
Participant
0 Kudos

Hi Eng Swee Yeoh,

Thanks Sir for replying!!

I will try using the REST adapter and will let you know the same

former_member694142
Participant
0 Kudos

Hi Eng Swee Yeoh,


I tried using REST adapter. But it is giving me below error.


Returning to application. Exception: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.rest.ejb.common.exception.HttpCallException: HTTP GET call to https://abcd.com/InjectMessage?code=awefv_inject&username=xyzw&password=258963&msg=FeedBack&from=<Customer # preceded by 91>&user.name=<Customer Name>&user.city=<Hotel Name> not successful. HTTP/1.0 403 Forbidden


Th message is under system error with status details as channel not found.


Can you please guide me how to proceed further?



former_member694142
Participant
0 Kudos

uploading image for your reference. Please guide!

engswee
Active Contributor
0 Kudos

Can you provide screenshot of the error under Message Log? Also screenshot of your channel config.

Former Member
0 Kudos

Are you able to make the REST call successfully using SOAPUI or POSTMAN REST client ? I suggest you try that first and then try to configure the REST adapter accordingly.

former_member694142
Participant
engswee
Active Contributor
0 Kudos

Here's my feedback:-

i) The URL pattern looks incorrect. You need to put an actual value for the &from field. Also, the placeholders for user.name and user.city is incorrect, you need to use the same name defined under "Pattern Element Name" and put them in curly brackets {} instead of <>. Example below (910000 is just a random number, you need to use an actual valid number there)

https://abcd.com/InjectMessage?code=awefv_inject&username=xyzw&password=258963&msg=FeedBack&from=9100000&user.name={Customer_Name}&user.city={Hotel_Name}

ii) I'd suggest that you follow the advice by Dev Noronha and try to test out the URL using a REST client first,

former_member694142
Participant
0 Kudos

Hi Eng Swee Yeoh,

Thanks for your suggestion Sir

I have configured the way you have suggested but now i am getting a new error on the channel.

PFA screenshot and help me for the same

former_member694142
Participant
0 Kudos

Hi Dev,

I have tested the integration on below link and it is working as expected also. We got the desired response as well.

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?utm_... 

engswee
Active Contributor
0 Kudos

Please provide screenshot of your test and result using Chrome's REST client.

Also provide screenshot of Message Log of a message tested through PI end to end. The channel ping result do not give enough details.

For both screenshots please make sure the whole URL is visible.

former_member694142
Participant
0 Kudos

Hi Eng Swee Yeoh,

it seems that there was some security issue for which we have done URL white listing and now we are able to send the request proper to the third party

Channel ping status is green now.

Only part which is remaining in the whole interface is that the Vendor is sending response in plain text due to which we are getting error as

Transmitting the message using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error encountered while executing mapping: com.sap.aii.af.service.mapping.MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_API_RS_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.

Do i need to put a xslt mapping or java mapping to convert plain text to xml so that we get a successful response?

The response will be plain text like: "The survey has been completed successfully" coming from the vendor which is not supported in PI.

Please help how to proceed in this case.

engswee
Active Contributor
0 Kudos

Good to hear of the progress.

Regarding plain text response, yes, you would need Java mapping to convert that to the appropriate XML response format of the proxy.

engswee
Active Contributor
0 Kudos

Ashish

If you are not familiar with Java mapping, you can check out my blog below

It can help simplify your mapping logic. For your case, you can refer to the CustomPlain2DOM mapping per the link below and adjust to your scenario.

equalize-xpi-mapping/CustomPlain2DOM.java at master · engswee/equalize-xpi-mapping · GitHub

former_member694142
Participant
0 Kudos

Thank you so much Sir!

You always guided correctly...your blogs and replies are really helpful

Thanks again for guiding and helping me out as I am quite new to SAP PI.

engswee
Active Contributor
0 Kudos

Dear Ashish

Very pleased to have been of assistance and hear that you have resolved your issue.

There is a lot that can be learnt on SCN for new and old alike. I'd encourage you to continue participating on SCN, not only for your own queries but also take time to read up others as well.

Regards

Eng Swee

Answers (1)

Answers (1)

former_member186851
Active Contributor
0 Kudos

Hello Ashsish,

If the HTTP message from the receiver channel to the target system should be an HTML form submission, choose   Set Form and enter the   Main Payload Field Name to specify the name of the request parameter whose value contains  the XI main payload.

Below is the guide for HTTP Adapter configuration

Configuring the Java HTTP Adapter on the Receiver Channel - Advanced Adapter Engine - SAP Library

former_member694142
Participant
0 Kudos

Hi Raghu,

Thanks for your reply!

Please let me know how to fill values in that Main Payload Field Name as per the URL given.


https://abcd.com/InjectMessage?code=awefv_inject&username=xyzw&password=258963&msg=FeedBack&from=<Customer # preceded by 91>&user.name=<Customer Name>&user.city=<Hotel Name>


I want to know the format of filling that particular field .