IBM Advanced Studies

 View Only
  • 1.  IBM Content Manager Webservice throwing an issue

    Posted Tue May 09, 2023 10:39 AM

    Hi Team,

    I am trying to connect to contentManagementWebService Endpoint ( https://xxxxxx//CMBSpecificWebService/services/CMWebService.wsdl) from .Net Core 6.4.0 and got below error.

    The content type text/html; charset=ISO-8859-1 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 84 bytes of the response were: '

    Do we have IBM Content Manager webservice supported in .net core 6 or is there any solution for the above issue?
    Appreciate your inputs, please reply asap.


  • 2.  RE: IBM Content Manager Webservice throwing an issue

    IBM Champion
    Posted Tue June 27, 2023 11:15 AM

    Hello! The error message you received indicates a mismatch between the expected content type of the response and the actual content type returned by the server. In this case, the expected content type is "text/xml; charset=utf-8," but the server is returning "text/html; charset=ISO-8859-1."

    Regarding your question about IBM Content Manager webservice support in .NET Core 6, as to my knowledge there isn't any specific information indicating direct support for IBM Content Manager webservice in .NET Core 6. However, it's possible to consume web services in .NET Core 6 using the available web service frameworks.

    To resolve the content type mismatch issue, you can try setting the correct content type manually in your code. Here's an example of how you can do this using the HttpClient class in .NET Core 6:

    var request = new HttpRequestMessage(HttpMethod.Get, "https://xxxxxx//CMBSpecificWebService/services/CMWebService.wsdl"); request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/xml"));

    In the example above, we explicitly set the Accept header to specify the expected content type as "text/xml." Adjust this code according to your specific use case and see if it resolves the issue.

    It's also worth noting that you should make sure the endpoint URL (https://xxxxxx//CMBSpecificWebService/services/CMWebService.wsdl) is correct and accessible.

    I hope this helps you a bit.

    Youssef Sbai Idrissi
    Software Engineer