in reply to Perl web service consumed by c# client returns null.

Isn't the error message quite clear? It looks as if the web service fails to provide a Content-Type header, but the client expects one. According to RFC7231, the web service SHOULD provide that header, and apparently the C# client doesn't want to guess. The message tells you that the client expects a content type of text/xml, which is fair enough.
  • Comment on Re: Perl web service consumed by c# client returns null.

Replies are listed 'Best First'.
Re^2: Perl web service consumed by c# client returns null.
by pryrt (Abbot) on Dec 12, 2019 at 18:22 UTC
    It looks as if the web service fails to provide a Content-Type header, but the client expects one.

    I'm not the original Anonymous Monk, but will respond: I would have thought the same thing, except that the error message is included in the message, and appears to be showing the content that the client received. That message shows not one but two Content-Type headers. If the error message isn't showing what was received from the service, but some other content, I would be confused as a user of that client.

    I'm wondering if seeing two Content-Type headers instead of one-and-only-one is confusing the client. Or maybe the headers don't have the expected newline sequence, so it shows up when printed as being on multiple lines, but the client either sees it as one line or sees extra characters at the start or end of each of the header lines.

    (edit first paragraph for clarity)

      Ah, indeed. Thanks for pointing that out!

      So the first header is Content-type (with a lowercase "t" in type), and it seems to come before the HTTP 1.1 line. This is an invalid HTTP response and might cause the client to abort parsing. If that's the case, then the error message isn't as good as it could be...

      That or the client does not see headers at all. Header items should be separated by \r\n . The end of headers is denoted by \r\n\r\n