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条回答

    报告相同问题?

    悬赏问题

    • ¥15 程序不包含适用于入口点的静态Main方法
    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记