C# 带有可移植类库的soapweb服务

C# 带有可移植类库的soapweb服务,c#,web-services,soap,portable-class-library,C#,Web Services,Soap,Portable Class Library,我有一个可移植类库,我需要在其中使用soap web服务—我正在使用.NET Framework 4.5和visual studio 2012-。。我向它添加了一个服务引用,并通过创建一个客户端和使用事件处理程序来使用它的操作来使用它。但它会返回此异常: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown o

我有一个可移植类库,我需要在其中使用soap web服务—我正在使用.NET Framework 4.5和visual studio 2012-。。我向它添加了一个服务引用,并通过创建一个客户端和使用事件处理程序来使用它的操作来使用它。但它会返回此异常:

The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

我注意到客户端配置文件是空的。我想知道如何使用此服务

您最好使用它来捕获请求-响应对并从那里开始工作。首先要看到的是实际的响应,而不是.NET消息,请检查返回的内容。这应该足以让您走上正确的轨道。

是否缺少System.ServiceModel.Client配置文件?