Client found response content type of 'text/html; charset=UTF-8', but expected 'text/xml'.

my company has a soap webservice exposed.... a python webservice... my duty is to have my application consume the exposed service.

c# is unable use the service whe i try to set the reference to the service.

Client found response content type of 'text/html; charset=UTF-8', but expected 'text/xml'.

that's the error that am getting ... any one knows how to consume a pythong web service


Thanks guys girls



Answer this question

Client found response content type of 'text/html; charset=UTF-8', but expected 'text/xml'.

  • Leoang

    Well your own services are based on UTF-8 and that tag is poper so you might want to add a bit to the client to recognize there is more to the word than ASCII.



  • WilsonNg

    Hello buzzsaw,

    do you have more info about the python web services stack which was used for implementing the service

    If you manage to successfully consume the service by using another platform, I suggest you to use tcptrace to take a look to what is actually sent on the wire. It should be text/xml.


  • eddie d

    are you hitting the endpoint of the service

    for example in iis / .net if the service is on www.foo.com/ws/test.asmx

    and you ask for say www.foo.com/ws/

    you will get html with an error like "Document not found"

    if it's a soap web service what does the wsdl file say about the service and what to call on it

    can visual studio do an "add web reference" on it


  • Trf_papa

    There are two ways to see the raw response from the webservice. If you are running it on your dev machine. run the webservice in debug mode. and then run your application in debug mode which calls the webservice.

    when your application will call the webservice function and you will see your breakpoint highlighted into the dev ide, in which you are running your webservice in debug mode.

    Like this you can view the behavior of your webservice.

    Second you can save the page and open it in a web browser to see what response is being sent to your request.


  • Sharvie

    That was the ultimate solution that i had to implement. Thanks
  • abmeynaks

    Hi Gary,

    did you get any response to your question on saving off the raw response

    Me too I'm trying to override the SoapHPPTClientProtocol but to no avail, I don't capture any message.

    Perhaps it's because the override is called in the BeforeSerialize-SoapMessageStage!

    Any help really appreciated!

    TIA,

    Detlef



  • anfortas

    This usually happens when an error has occured on Web Service side, and the server returns a HTML page that explains the error.

    Save the response off as a HTML page and use a browser to view the error.



  • ulu

    Did you save off the response at the server or at the client If you did it at the client, how I'm driving myself nuts trying to figure out how to get deeper into the SoapHTTPClient stuff to find the raw response.

    Thanks, Gary



  • Client found response content type of 'text/html; charset=UTF-8', but expected 'text/xml'.