API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Response Header Content-Type

    Posted Fri September 27, 2024 02:09 PM

    Hello

    raw soap response has Content-Type: text/xml;charset=UTF-8, when I click on json response : "The content you are trying to view cannot be viewed as JSON" because of the content-type

    flow : jwt validation -> header Validation -> XSLT(converting json into soap)-> invoke -> xslt(xml to json, have content-type: "application/json") -> set variable(defined content-type: "application/json" - 2nd time) but still raw SOAP response has content-type: text/xml. My API is in OPEN API v3.0.0 . Any pointers.



    ------------------------------
    Mohan Vamsi Mullapudi
    ------------------------------


  • 2.  RE: Response Header Content-Type

    Posted Mon September 30, 2024 04:20 AM

    Have you set the "consumes" and "produces" correctly in your open api document to describe what content types your API accepts and will produce?

    Please include what APIC and DP versions (exact fixpack), along with whether using the v5c or apigw.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 3.  RE: Response Header Content-Type

    Posted Tue October 01, 2024 01:39 PM

    Hi Mohan,
    You indicate "set variable(defined content-type: "application/json" - 2nd time)".  How are you doing that?  The variable to be set that is returned to the client is message.headers.content-type.  If you're doing that, you should see a response header containing application/json.  If you're setting some variable only named content-type, that has no bearing to what is returned to the client.

    Best Regards,
    Steve Linn



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