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 stm32流水灯+呼吸灯+外部中断按键
    • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
    • ¥15 NX MCD仿真与博途通讯不了啥情况
    • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
    • ¥15 gradio的web端页面格式不对的问题
    • ¥15 求大家看看Nonce如何配置
    • ¥15 Matlab怎么求解含参的二重积分?
    • ¥15 苹果手机突然连不上wifi了?
    • ¥15 cgictest.cgi文件无法访问
    • ¥20 删除和修改功能无法调用