开发者

The server committed a protocol violation. Section=ResponseStatusLine" For PHP webservice

I am calling a web service in my 开发者_如何学PythonC# Code. The webservice is bulit in PHP. I am calling its loadunload method. The webservice returns me the

"The server committed a protocol violation. Section=ResponseStatusLine"

error if I call the service with in 5 to 10 second delay. Here is the code I am using to call the service.

private MyServiceMachine client = new MyServiceMachine ();
client.loadunload();
Thanks in advance for help.

Here is the Excpetion I am getting Exception Details:

Message:    The server committed a protocol violation. Section=ResponseStatusLine
Source: System.Web.Services
StackTrace:    at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at SPLocker.Core.lendingMachineService.lendingMachine.loadUnLoad(String MID, String TS, String RE, Object BS)
   at SPLocker.Core.TransactionHelper.loadUnLoad(EnumLendingServiceMode mode, Int32[] BoxIDs, Boolean IsAllBOXes)
TargetSite: System.Net.WebResponse 


http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/ff098248-551c-4da9-8ba5-358a9f8ccc57


Another possibility: when doing a POST, the server responds with a 100 continue in an incorrect way.

This solved the problem for me:

request.ServicePoint.Expect100Continue = false;


Sounds like an error being returned by the C# HttpWebRequest class, rather than that by the endpoint server.

Turn on debugging is my reommendation.

Link

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜