This discussion is archived
0 Replies Latest reply: Aug 30, 2012 11:54 PM by 799835 RSS

Client found response content type of 'text/plain', but expected 'text/xml'

799835 Newbie
Currently Being Moderated
Hi All

We have developed a J2EE- JAX-RPC web service using Weblogic's 'ServiceGenTask'.
Invoking web service via java client and SOAP UI works like charm but fails when the
service invoked via .NET client.

Below is the .NET sample code and the Stack Trace:

.NET CODE:
----------------------------------------------------------------------------------------

System.Net.ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate {      return true;  });
testwebservice.ESI est1 = new testwebservice.ESI();
esi_detail = est1.getDetails("someuserid", "password"<Details> <Id>" + txt_eino.Text +"</Id> </Details>");

----------------------------------------------------------------------------------------

Stack Trace:

System.InvalidOperationException was unhandled by user code
Message=Client found response content type of 'text/plain', but expected 'text/xml'.
The request failed with the error message:
--
HTTP/1.1 100 Continue

<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header/><env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><m:getCertificateDetailsForWSUResponse xmlns:m="http://mynamespace"><result xsi:type="xsd:string"><CertificateStatus>valid</CertificateStatus>
</m:getCertificateDetailsForWSUResponse></env:Body></env:Envelope>
--.
Source=System.Web.Services
StackTrace:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at shcilestamp.EstampIndia.getCertificateDetailsForWSU(String string, String string0, String string1) in c:\Users\Revenue\AppData\Local\Temp\Temporary ASP.NET Files\sra\6fd93bb3\8d227466\App_WebReferences.iojpamot.0.cs:line 105
at default_1.btn_verify_estamp_Click(Object sender, EventArgs e) in c:\Users\Revenue\Desktop\OFFICE\sra\default.aspx.cs:line 1006
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Note: The same client code is able to access the service deployed in our DR site without any fault.
However it fails to invoke service deployed in Production site.

Is this anything to do with the Content-type settings at the web/app server layer?
Any help will be appreciated.

Thanks & Best Regards
Avinash

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points