none
How to Map JSON Response in Mapp RRS feed

  • Question

  • The response I am getting back on my receive port is shown below

    "<ns0:ServiceResponse xmlns:ns0="http://abcd.ServiceResponse_JSON">

      <Response>somevaluehere</Response>

    </ns0:ServiceResponse>"

    I have a Many to One map i.e. on Source side I have 2 Schemas (one of them is the JSON response which is shown above) and one Destination schema. Transformation is ok, but the Value of <Response> is null in transformed message, although I am getting value in my response message as sown above.

    For JSON Response I have created a custom Pipeline that decode the message into JSON because from Webapi I am getting JSON response,

    I notice one more thing that If I used a custom Receive Pipeline with flat file schema to receive the response and used in my map then I get the Response value, but not in JSON.

    Can anyone let me know what is going wrong here.

    Friday, October 21, 2016 7:46 PM

Answers

  • Sorry, but your situation is still not very clear.

    If you're getting two different responses, you will need two maps and decide which to use in the Orchestration.

    Perhaps you're overthinking this.  It's probably very basic BizTalk.  Don't worry so much about the wire formats, it should be all Xml in the app.

    You convert to/from JSON on the Pipeline.

    Monday, October 24, 2016 2:25 PM
    Moderator
  • HI

    This is easy to achieve, first you need to understand is that what ever the message arrived from the api, you will convert it to xml to be accessed in Biztalk.

    Now that being said,

    If you have to use two message from two separate apis(ones which sends xml response..other which sends json response(but you will still have to disassemble it into xml for it to be used in orchestration))..now once you have the two responses, call the map which has two input messages from the api response and your desired output message

    Regards,


    Mandar Dharmadhikari

    Monday, October 24, 2016 4:21 PM
    Moderator
  • Hi,

    Believe your Pipeline component is working just fine since you do see the xml response as indicated in your question. So do not worry around toggling the pipeline type.

    This appears to be mapping issue if you dont see the <Response>somevaluehere</Response> value getting propagated  to the destination in your map.

    I would have turned on tracking for my orchestration, saved or constructed  the 2 required IP source  messeges to the map then created a input xml for the map and committed a test map to see what is the output I am getting there and based on that then corrected my map .  Articles below for testing mutipart map.


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.

    Thursday, October 27, 2016 3:16 PM

All replies

  • The response I am getting back on my receive port is shown below

    "<ns0:ServiceResponse xmlns:ns0="http://abcd.ServiceResponse_JSON">

      <Response>SomeValueHere</Response>

    </ns0:ServiceResponse>"

    I have a Many to One map i.e. on Source side I have 2 Schemas (one of them is the JSON response which is shown above) and one Destination schema. Transformation is ok, but the Value of <Response> is null in transformed message, although I am getting value in my response message as sown above.

    For JSON Response I have created a custom Pipeline that decode the message into JSON because from Webapi I am getting JSON response,

    I notice one more thing that if I used a custom Receive Pipeline with flat file schema to receive the response and used in my map then I get the Response value, but not in JSON.

    Can anyone let me know what is going wrong here?

    Friday, October 21, 2016 7:40 PM
  • So, can you clarify a couple of points?

    "I have a Many to One map i.e. on Source side I have 2 Schemas (one of them is the JSON response which is shown above) and one Destination schema."

    Is this in an Orchestration?  You cannot use multi-Message Maps in the Ports.

    "For JSON Response I have created a custom Pipeline that decode the message into JSON"

    We presume you mean Encode.  What does this have to do with the Receive Map.

    "flat file schema"

    How is this involved?  You can't receive different content types on the same Receive.

    Friday, October 21, 2016 8:33 PM
    Moderator
  • Yes I have an orchestration, and I have 2 different request/response port,

    One port is for request and response for one api, this api using the XML request response

    Second port is using the JSON request and response, what I want is that I should have Mapp that can have source schema for both responses of both of these messages.

    Thanks

    Monday, October 24, 2016 12:45 PM
  • Sorry, but your situation is still not very clear.

    If you're getting two different responses, you will need two maps and decide which to use in the Orchestration.

    Perhaps you're overthinking this.  It's probably very basic BizTalk.  Don't worry so much about the wire formats, it should be all Xml in the app.

    You convert to/from JSON on the Pipeline.

    Monday, October 24, 2016 2:25 PM
    Moderator
  • HI

    This is easy to achieve, first you need to understand is that what ever the message arrived from the api, you will convert it to xml to be accessed in Biztalk.

    Now that being said,

    If you have to use two message from two separate apis(ones which sends xml response..other which sends json response(but you will still have to disassemble it into xml for it to be used in orchestration))..now once you have the two responses, call the map which has two input messages from the api response and your desired output message

    Regards,


    Mandar Dharmadhikari

    Monday, October 24, 2016 4:21 PM
    Moderator
  • Hi,

    Believe your Pipeline component is working just fine since you do see the xml response as indicated in your question. So do not worry around toggling the pipeline type.

    This appears to be mapping issue if you dont see the <Response>somevaluehere</Response> value getting propagated  to the destination in your map.

    I would have turned on tracking for my orchestration, saved or constructed  the 2 required IP source  messeges to the map then created a input xml for the map and committed a test map to see what is the output I am getting there and based on that then corrected my map .  Articles below for testing mutipart map.


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.

    Thursday, October 27, 2016 3:16 PM