cancel
Showing results for 
Search instead for 
Did you mean: 

Post xml content dynamically to URL using REST

Former Member
0 Kudos

Hi All,

We have requirement to pass the whole xml content to URL using Reciver REST adapter.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member194786
Active Contributor
0 Kudos

Have you set the parameter "Content-Type" with value "application/x-www-form-urlencoded" in REST channel?

Regards,

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

There is no option in REST reciver adapter to set the Content type. Could you please let me know if there is any way to configure this.

former_member186851
Active Contributor
0 Kudos

Hello Sunil,

You in which SP?

Latest SP has way to change Content type I believe.

Former Member
0 Kudos

Hi Raghu,

PO 7.5 SP 01, Please let me know in which SP this option is available

Thanks

former_member194786
Active Contributor
0 Kudos

Hi Sunil,

You can provide this value in HTTP headers tab in REST adapter. Refer to the screenshot I have provided.

Thanks,

Sanjeev.

former_member186851
Active Contributor
0 Kudos

Hello Sunil,

You can try the below approach

Since you wish to pass the entire XML as part of URL,Get the entire XML in a field using "return as string" option in message mapping.

If you wish to have some particular fields of XML then you can follow the blog without any mapping changes.

Former Member
0 Kudos

HI Raghu,

I have done the same thing, But this URL accepts encoded data so I have encoded the data passed it a filed like u said. but while dynamically passing the field value to URL through xpath this data is not getting passed to URL.

former_member182412
Active Contributor
0 Kudos

Hi Sunil,

Can you give us the example??

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Hello sunil,

Your getting any error,?Check with the configurations.Because that is a standard approach.

Former Member
0 Kudos

Hi Raghu,

while I pass the data as you said , I am geting the response as premature end of file.

Since this is an encoded URL , I have encoded the whole xml, while passing dynamically using xpath it is not  passing to the URL

Former Member
0 Kudos

Hi Praveen,

it is a encoded URL, so I encoded the  xml and passing it dynamically to URL. Is there any restriction in REST to pass the data dynamically. I am able to pass the values to respective fields but not the entire encoded xml.

former_member186851
Active Contributor
0 Kudos

Hello Sunil,

Might be due to length.

How big is ur XML and can you post like how ur URL looks like

Former Member
0 Kudos

Hi Raghu,

Pls find the xml which I am passing

Pls let me know if there is any other way to post this xml to URL dynamically.

Thanks,

Former Member
0 Kudos

URL looks like below.

former_member186851
Active Contributor
0 Kudos

Hello Sunil,

May be you need to write Java beans.Because in rest i haven't seen any other option other than this.

And can u check with WS team like they want the whole XML in the URL only or is it OK if you can send some identifier from payload in URL and XML in the message body.

Former Member
0 Kudos

Hi Raghu,

do u have any  example code.

Thanks,

Sunil V

former_member186851
Active Contributor
0 Kudos

No Sunil.

Even I searched for any blogs/documents/link didn't find any.

Did you check with WS team ?

Former Member
0 Kudos

Yaa i checked Raghu, But the problem is we have to send multiple payment nodes, For single node i am able to pass the identifiers dynamically.

Thanks for ur effort

former_member186851
Active Contributor
0 Kudos

Np Sunil.

Yes.Single or multiple values its fine.Whole XML also should work when u use return as string.I doubt at length or may be encoding.

I will update u if I find any further solution on this.

former_member182412
Active Contributor
0 Kudos

Hi Sunil,

  • Did you test the REST web service via POSTMAN by posting the whole XML in the URL??
  • First test in POSTMAN if it works do the same thing in PI.

Regards,

Praveen.