小编Ami*_*bar的帖子

WCF执行错误:此工厂启用了手动寻址,因此必须预先发送所有发送的消息

我有一个使用WebHttpBinding托管的WCF服务.服务非常简单,是一个接受多个参数的操作合同.使用"添加服务引用"后自动生成的我的WCF客户端无法直接使用WCF服务.该错误仅发生在WebHttpBinding而不是其他错误.

服务器端

[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "Submit2String", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped)]
string Submit2String(string input1, string input2);
Run Code Online (Sandbox Code Playgroud)

客户端

ExpenseServiceClient proxy = new ExpenseServiceClient();
proxy.Submit2String("test1", "test2");
Run Code Online (Sandbox Code Playgroud)

当我测试运行上面的代码时,我收到以下错误:

Error: InvalidOperationException was unhandled by user code
Manual addressing is enabled on this factory, so all messages sent must be pre-addressed.
Run Code Online (Sandbox Code Playgroud)

以下是使用"添加服务引用"后自动生成的配置文件的外观:

 <system.serviceModel>
  <bindings>
    <webHttpBinding>
      <binding name="webHttp">
        <security mode="None">
          <transport clientCredentialType="None" />
        </security>
      </binding>
    </webHttpBinding>
  </bindings>
  <client>
    <endpoint binding="webHttpBinding" 
              bindingConfiguration="webHttp"
              contract="ExpenseService.IExpenseService"  
              address="http://localhost/myservices/ExpenseService.svc">
    </endpoint>
  </client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

c# wcf webhttpbinding

3
推荐指数
1
解决办法
1万
查看次数

System.Data.OleDb.OleDbException:操作必须使用可更新的查询

我糊涂了.我正在尝试使用ASP.Net将单个记录添加到Access 2000数据库中.但是,当我尝试添加新记录时,我收到以下错误:

异常详细信息:System.Data.OleDb.OleDbException:操作必须使用可更新的查询.

asp.net oledb oledbexception

3
推荐指数
1
解决办法
4778
查看次数

标签 统计

asp.net ×1

c# ×1

oledb ×1

oledbexception ×1

wcf ×1

webhttpbinding ×1