xmdlkz 2015-06-15 15:42
浏览 2110

httpClient 调用wcf服务 contract binding不一致

用axis掉用没问题,用http调用就有问题,求大牛帮忙解决一下。
报的异常如下:
The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
最好能告诉我愿意,还有能否只改客户端就实现用httpClient调用。
后台看来一下,请消息体是一样的,请求头不一样。
附上axis的请求:

POST /BankService.svc HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 42.8.96.156:8080
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://tempuri.org/IBankService/AddRecharge"
Content-Length: 758

<?xml version="1.0" encoding="UTF-8"?>

soapenv:Body



2

0

0

2015-06-15T01:09:24.984Z

0

1



2cdc7243bddce98d461f29f97de460f83ec282516c34733a2c9a2b0296239a8b

/soapenv:Body
/soapenv:Envelope

httpClient 请求:
POST /BankService.svc HTTP/1.1
Connection: close
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 42.8.96.156:8080
Transfer-Encoding: chunked
Content-Type: text/xml; charset=utf-8

2f6
<?xml version="1.0" encoding="UTF-8"?>

soapenv:Body



2

0

0

2015-06-15T01:09:24.984Z

0

1




2cdc7243bddce98d461f29f97de460f83ec282516c34733a2c9a2b0296239a8b


/soapenv:Body
/soapenv:Envelope

异常详细情况:



a:ActionNotSupported

The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

/s:Fault
/s:Body
/s:Envelope

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
    • ¥15 C#调用python代码(python带有库)
    • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
    • ¥15 活动选择题。最多可以参加几个项目?
    • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
    • ¥15 vs2019中数据导出问题
    • ¥20 云服务Linux系统TCP-MSS值修改?
    • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
    • ¥20 怎么在stm32门禁成品上增加查询记录功能
    • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面