none
BizTalk Server JSON encoder issue RRS feed

  • Question

  • If in  the below schema , record name and field name both are same. Getting the exception using JSON encoder while converting from XML to JSON. Is there any solution for this issue?
    <Items IsPrimary="true">
             
    <Type>Type_0</Type>
            
    <Items>1234</Items>
     
    </Items>

    If I put the JSON encoder in Encode stage in Send Pipeline, getting below error.

    A message sent to adapter "FILE" on send port "SendPort1" with URI "D:\.....\Out\%MessageID%.json" is suspended. 
     Error details: There was a failure executing the send pipeline: "AppJSONServices.SndPipeline_XML2JSON, AppJSONServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7f5f0e6cca69f82e" Source: "JSON encoder" Send Port: "SendPort1" URI: "D:...\Out\%MessageID%.json" Reason: Value cannot be null.
    Parameter name: key  
     MessageId:  {28AEDEA4-1C69-47D6-8807-72B48605D7F5}
     InstanceID: {483115A6-B946-4BB3-BC3D-42BF713B6CA2}

    Thursday, June 30, 2016 8:47 AM

Answers

  • This is know issue for Json encoder, u can follow below link for reference where issue is already opened with microsoft. There I have explained in one of my comment which is workaround to avoid this error.

    https://social.technet.microsoft.com/Forums/sharepoint/en-US/df55fb74-bb7f-4873-93b2-b712e317f174/biztalk-json-encoder-reason-input-string-was-not-in-a-correct-format?forum=biztalkgeneral

    Thanks,

    Sandesh Sahane

    • Proposed as answer by Angie Xu Sunday, July 10, 2016 7:30 AM
    • Marked as answer by Angie Xu Monday, July 11, 2016 2:20 AM
    Saturday, July 2, 2016 9:53 PM

All replies

  • Hi

    Can you check the schema for the Items message?

    What are xsd types for IsPrimary, Type and the last Items element? They should be basic types like string, int or decimal.


    Thanks Arindam


    Thursday, June 30, 2016 9:19 AM
    Moderator
  • I have tried to pass your XML example in a JSON Assemble Pipeline Component, and I receive no errors:

    RemoveOuterEnvelope: False:

    {
      "Items": {
        "@IsPrimary": "true",
        "Type": "Type_0",
        "Items": "1234"
      }
    }

    RemoveOuterEnvelope: True:

    {
      "@IsPrimary": "true",
      "Type": "Type_0",
      "Items": "1234"
    }

    Can you try and parse the XML without a schema represenation deployed in BizTalk?

    Morten la Cour

    Friday, July 1, 2016 2:47 PM
  • This is know issue for Json encoder, u can follow below link for reference where issue is already opened with microsoft. There I have explained in one of my comment which is workaround to avoid this error.

    https://social.technet.microsoft.com/Forums/sharepoint/en-US/df55fb74-bb7f-4873-93b2-b712e317f174/biztalk-json-encoder-reason-input-string-was-not-in-a-correct-format?forum=biztalkgeneral

    Thanks,

    Sandesh Sahane

    • Proposed as answer by Angie Xu Sunday, July 10, 2016 7:30 AM
    • Marked as answer by Angie Xu Monday, July 11, 2016 2:20 AM
    Saturday, July 2, 2016 9:53 PM
  • Hi,

    If this issue is really urgent for you, you could also contact Microsoft support to check the status of this issue.

    For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:

    http://support.microsoft.com/contactus/?ws=support

    Regards,

    Angie



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 7, 2016 6:29 AM
  • The Record name and element name should not be same. The JSON Encoder in 2013R2 will throw this error if you have the record and element name is same.

    <Items IsPrimary="true">
              
    <Type>Type_0</Type>
             
    <Items>1234</Items>
      
    </Items>

    It works if you change the element name.

    Monday, September 17, 2018 6:27 PM
  • The Record name and element name should not be same. The JSON Encoder in 2013R2 will throw this error if you have the record and element name is same.

    <Items IsPrimary="true">
              
    <Type>Type_0</Type>
             
    <Items>1234</Items>
      
    </Items>

    It works if you change the element name.

    Same in BizTalk 2016. No attention to this!?

    Currently, I am supposed to call an API outside my control. Is there no bug report/fix for this yet!?
    (My other option is to develop my own pipeline component re-doing the same work Microsoft promised they done already...and, my customer payed for it...)

    Thursday, January 24, 2019 7:47 AM