DataPower

 View Only
  • 1.  Json to xml transformation failing in MPGW

    Posted Mon November 21, 2022 05:53 AM

    Hi ALL

    I am trying to create a simple Mpgw which to process simple json message in to xml which is failing not sure what is missing. hence please advice me on resolving the issue.

    I have defined request as json and response as xml.

    further instead of input comtext I have used __JSONASJSONX and the request is as shown below 


    {
    "getUserDetail":
    {
    "userName": "AEMP"
    }
    }

    the error I'm seeing is as below in the requestreule its not eveing parasing the request " Invalid JSON format"

    belowi s the screen shot or request details being sent to MPGW



    Thanks,

    Avinash



    ------------------------------
    Avinash Mohan Vundale
    ------------------------------


  • 2.  RE: Json to xml transformation failing in MPGW

    IBM Champion
    Posted Mon November 21, 2022 05:37 PM
    It says the "Document is empty".

    What context are you using?
    Is the rule set for JSON processing rather than XML?
    Is the policy set for JSON rather than XML?

    ------------------------------
    Joseph Morgan
    ------------------------------



  • 3.  RE: Json to xml transformation failing in MPGW

    Posted Tue November 22, 2022 08:50 AM
    Hi Avinsh,
    The binary INPUT context looks like XHTML not JSON. I don't know if it matters but your content type request header should be lower case. Have you tried curl or another external client to eliminate the possibility of the send message tool having an issue?

    Best Regards,
    Steve Linn

    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 4.  RE: Json to xml transformation failing in MPGW

    Posted Tue November 22, 2022 10:12 AM

    Hi Steve,

    I am unable to use curl command as i canno't reach the host and port the service is hosted from my virtual desktop.

    further I changed the content type to lower case and tried to still no luck.

    Thanks

    Avinash



    ------------------------------
    Avinash Mohan Vundale
    ------------------------------



  • 5.  RE: Json to xml transformation failing in MPGW

    Posted Mon November 28, 2022 09:34 AM

    Hi Avinash,

    We've discussed this internally, but to close this thread, I'll document that this appears to be a defect in the "Send a Test Message" tool with a JSON payload where the desired JSON isn't being POSTed correctly to your backend service.  Please open a PMR for this.

    Best Regards,

    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------