SOAP WCF问题-由于语法格式错误,服务器无法理解该请求 [英] SOAP WCF Issue - The request could not be understood by the server due to malformed syntax

查看:665
本文介绍了SOAP WCF问题-由于语法格式错误,服务器无法理解该请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我们有WCF合同,可以接受StudySize列表作为输入.研究大小是包含ID和文件大小的数据容器类.

操作合同在下面

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

问题:

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

详细地,服务器由于错误失败"而失败,由于语法格式错误,服务器无法理解该请求.

如果我将此来源研究的大小减小至300,则表示成功.从服务器上获取200.请让我知道为什么会显示400

列表包含500个研究规模的成员

我的观察:

已验证web.config中的http运行时最大请求长度为100 KB.我请求的内容长度是76 KB.因此,请求长度在这里不会成为问题.

还引入了新的发送超时(最多10分钟),这对我们没有帮助

请让我知道问题的根源是什么,请让我知道如何解决该问题





解决方案

您好,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


这篇关于SOAP WCF问题-由于语法格式错误,服务器无法理解该请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆