You need to sign in to do that
Don't have an account?
VKSINGH
sending xml data from salesforce to external server using http post request (Restful API).
hi every one, need ur help
When i m sending the hard code xml data through http,in response i m getting the status is ok n status code is 200,but the xml data is going to the external server in some encoded form.I m not using any encoding(like UTF-8) in my code,but still the external server getting xml in encoded form.
Can any one tell me,how to remove this problm,cos if the external server receives the correct xml format data it will response back to correct value,for which i m looking.
I'm not actually sure, but I'll take a guess and assume it's becuase the data you are sending is compressed it?
All Answers
I'm not actually sure, but I'll take a guess and assume it's becuase the data you are sending is compressed it?
yes simon u r right,
i found that error, n i already fixed it,yes it is bcs of i m doing compression.
but, Thanx for u rply..:)
i have another problm now,i m sending hard code xml here,but i have to generate xml dynamically,could u hepl me how to do that n what changes i have to made in my code.
Thanx in advance
Can you please post your final code here...please.
hey i am same VKSingh.
Now where r u geeting error n what ?
above code works fine for sending xml through to an end point.
only remove this line : req.setCompressed(true);
let me know if u have any prblm
I hardcoded and tested.It works.Now want to make it dynamic.I am working on std object account.Account should be created in my third party tool when type is customer.Rest cases it shouldnt.
how can i do this??
Thank you
I should use xmlstreamwriter.Thanks
Yes..XmlStreamwrite. to generate dynamic xml and send it to http post.