cancel
Showing results for 
Search instead for 
Did you mean: 

API that catches HTTP Post encoded in CXML

ctlarson
New Contributor II

I am trying to build an API endpoint that can catch an HTTP Post that is encoded in XML. The error I am getting is:Document input views only accept JSON-encoded data. I understand that there are snaps that allow me to conver the XML to JSON once the data is in the pipeline but I cant get the HTTP Post into my pipeline to begin with. Unfortunately, I do not have the luxury of converting the XML to JSON as this is data from over 100 different vendors.

Does anyone know if SnapLogic is able to handle an HTTP Post encoded in XML?

Thanks for any help in advance!

1 ACCEPTED SOLUTION

According to my esteemed colleague @akidave, we do allow POST data directly to XML Parser snap through a triggered pipeline which in your case would be the API end point. If your first snap in the pipeline is the XML Parser, you should be able to process it and your pipeline is a triggered pipeline, you should be able to send the XML encoded POST data to this triggered pipeline.

View solution in original post

3 REPLIES 3

psathyanarayan
Employee
Employee

I don’t think we can send a XML encoded POST data to a Snaplogic pipeline API end point. It needs to be JSON encoded. If the POST data can be staged in a staging area, you could use the Multi File Reader Snap and then connect the XML Parser Snap to it and process it further.

Hope this helps.

According to my esteemed colleague @akidave, we do allow POST data directly to XML Parser snap through a triggered pipeline which in your case would be the API end point. If your first snap in the pipeline is the XML Parser, you should be able to process it and your pipeline is a triggered pipeline, you should be able to send the XML encoded POST data to this triggered pipeline.

stodoroska
New Contributor III

If you don’t know if the incoming request will be xml or json and you want your API to be capable of consuming both requests, here is a sample pipeline where you can do that.

image

In the binary router you are checking if the pipeline request is xml or json and after that deciding which branch to process.XMLToJson_2019_05_16.slp (6.7 KB)