I am calling WCF service from web application. It works fine for local webservice. When service deployed to dev server, it gives me above error. Webservice returns List of custom objects in xml format.
[OperationContract()]
[WebInvoke(Method = "POST", UriTemplate = "/track/get", ResponseFormat = WebMessageFormat.Xml)]
List<tokenCount> GetTracking(System.IO.Stream data);
If I return just a string from webservice, it works fine. Other operations in webservice work fine.
oRequest.ContentLength = aBytes.Length;
oRequest.KeepAlive = false;
oRequest.ProtocolVersion = HttpVersion.Version10;
oRequest.ConnectionGroupName = Guid.NewGuid().ToString();
oRequest.Timeout = 60000;
using (Stream oRequestStream = oRequest.GetRequestStream())
{
oRequestStream.Write(aBytes, 0, aBytes.Length);
using (HttpWebResponse oResponse = (HttpWebResponse)oRequest.GetResponse())
{
using (StreamReader oReader = new StreamReader(oResponse.GetResponseStream(), Encoding.UTF8))
{
Response.ContentType = "application/xml";
//resDoc = CreateMetaFile(oReader.ReadToEnd());
string r = oReader.ReadToEnd();
}
}
}