Hi Team,
I have a usecase where I have 2 TargetEndPoints.
My first TargetEndPoint is :
http://www.mocky.io/v2/5cb569053300002e165d7a96
Response for this Target is : application/json
{ "Details" : { name: "Rishu", age: 22, city: "India" }}
My second TargetEndPoint is :
http://www.mocky.io/v2/5cb5697833000020185d7a99
Response for this Target is : application/xml
Rishu SinghNow when I’m sending 1st Post Request from Postman :
{
“target” : “json”,
“response” : “xml”
}
My Expected Response is : (It Must hit the TargetEndpoint 1 and convert it as Xml )
Now when I’m sending 2nd Request :
{
“target” : “json”,
“response” : “json”
}
My Expected Response is : (It Must hit the TargetEndpoint 1 and return as same as json response )
{ “Details” : { name: “Rishu”, age: 22, city: “India” }}
Now when I’m sending 3nd Request :
{
“target” : “xml”,
“response” : “json”
}
My Expected Response is : (It Must hit the TargetEndpoint 2 and convert it as Json )
{ “Books”:
{
“JavaScript”: “Rishu”,
“Paython”: “Singh”
}}
Now when I’m sending Post 4nd Request from Postman :
{
“target” : “xml”,
“response” : “xml”
}
My Expected Response is : (It Must hit the TargetEndpoint 2 and return as same as xml )\
Rishu SinghIn my ProxyEndpoint to route request I used :
request.content = "application/json" ApigeeeMockyIo request.content = "application/json" ApigeeNew defaultAnd I used JsonToXml Policy on response side of TargetEndpoint1(ApigeeeMockyIo) ,Similarly I used XmlToJson Policy on response side of TargetEndpoint2(ApigeeNew).
But On every hit I’m getting FaultError .
Any Advice what’s wrong here?
Is I need to add any other policy for this work?
Thanks
Rishika