且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SOAP WCF问题-由于语法格式错误,服务器无法理解该请求

更新时间:2023-08-21 11:21:28

您好,SukumarNellore, >>如果sourceStudies大小为500,则意味着如果列表包含500个研究大小的成员,则服务器将收到400个不良请求.

我通过以下方法进行了测试,但无法重现您的问题.如果您可以与我们分享一个简单的代码,并在服务端和客户端配置文件,将会很有帮助.

//服务

[运营合同]

字符串GetMissingAndDifferentStudiesFromList(List< StudySize> sourceStudies);

//客户

Service1Client客户端=新的Service1Client();

StudySize ss = new StudySize {Id = 1,FileSize = 1};

StudySize [] sourceStudies =新的StudySize [600];

对于(int i = 0; i< sourceStudies.Count(); i ++)

{

   sourceStudies [i] = ss;

}

字符串result = client.GetMissingAndDifferentStudiesFromList(sourceStudies);

此外,我建议您尝试在WCF中进行跟踪和消息记录. >

***的问候

爱德华


Hi All

We have WCF Contract which can accept list of StudySize as input . Study size is a data container class contains ID and File Size.

The operation contract is below

[OperationContract]
void GetMissingAndDifferentStudiesFromList(List<StudySize> sourceStudies, string stackUId, out List<string> missingStudies, out List<string> diffStudies, long pixelFileSizeToIgnore, long dtsFileSizeToIgnore);    

ISSUE:

If the sourceStudies size is 500, meaning if the list contains 500 study size members am getting 400 -bad request from server.

In detail the server is failing with the error as "  The request could not be understood by the server due to malformed syntax "

If i reduce this source studies size to 300 it is successful. am getting 200 from the server. Please let me know why it says 400

when the list contains 500 members of study size

My Observations:

Have verified the http run time max request length in web.config which is 100 KB. and the content length of my request is 76 KB. hence the request length would not be an issue here.

Also introduce the new send time out to 10 mins which  is not helping

Please let me know what is the root cause behind the issue and  please let me know how i can resolve the issue





Hi SukumarNellore,

>> If the sourceStudies size is 500, meaning if the list contains 500 study size members am getting 400 -bad request from server.

I made a test with below, but I could not reproduce your issue. It would be helpful if you could share us a simple code and your configure files in Service side and client side.

//service        

[OperationContract]

string GetMissingAndDifferentStudiesFromList(List<StudySize> sourceStudies);

//client

Service1Client client = new Service1Client();

StudySize ss = new StudySize { Id=1, FileSize=1 };

StudySize[] sourceStudies = new StudySize[600];

for (int i = 0; i < sourceStudies.Count(); i++)

{

   sourceStudies[i] = ss;

}

string result=client.GetMissingAndDifferentStudiesFromList(sourceStudies);

In addition, I would suggest you try IErrorHandler, and debug this at service side to check the real error. Or, I would suggest you try Tracing and Message Logging in WCF.

Best Regards,

Edward