C# WCF方法未接收参数
我有一个不接收请求参数的WCF方法。但是如果我使用WCFTest客户端(VisualStudio附带的客户端),该方法将接收参数 如果我捕获请求,它们看起来非常相似: 如果请求是这样的,它会工作:C# WCF方法未接收参数,c#,.net,wcf,C#,.net,Wcf,我有一个不接收请求参数的WCF方法。但是如果我使用WCFTest客户端(VisualStudio附带的客户端),该方法将接收参数 如果我捕获请求,它们看起来非常相似: 如果请求是这样的,它会工作: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<consultaValeCompra xmlns="http://tempuri.org/">
<dataMovto>1</dataMovto>
<numSeqOperacao>2</numSeqOperacao>
<numDocumento>3</numDocumento>
<valorDocumento>4</valorDocumento>
<tipo>5</tipo>
<codPreVenda>6</codPreVenda>
</consultaValeCompra>
</s:Body>
</s:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<consultaValeCompra xmlns="http://valeCompra/jaws">
<dataMovto>121212</dataMovto>
<numSeqOperacao>003719</numSeqOperacao>
<numDocumento>000000000000005555466465454546</numDocumento>
<valorDocumento>000046400</valorDocumento>
<tipo>0</tipo>
<codPreVenda>0000000000</codPreVenda>
</consultaValeCompra>
</soapenv:Body>
</soapenv:Envelope>
我能看出差异,但我不明白为什么第一个有效,第二个无效
我能做些什么使它工作
谢谢。似乎
的XML名称空间(xmlns=
属性)不同:
<consultaValeCompra xmlns="http://tempuri.org/">
或者重新生成服务客户端。哪种代码导致错误的重新加载?生成的propxy?javascript(jquery?)我看到的唯一可能相关的区别是
consultaValeCompra
标记上定义的名称空间;在这个有效的例子中,它是http://tempuri.org/
-在不起作用的示例中,它是http://valeCompra/jaws
。您的服务方法的服务和/或运营合同中有哪些内容??
<consultaValeCompra xmlns="http://tempuri.org/">
<consultaValeCompra xmlns="http://valeCompra/jaws">
[ServiceContract(Namespace = "http://valeCompra/jaws")]
public class MyService
{
[...]
}