1

我有一个使用 wcf 服务的soap lite 客户端。我在 basichttpbinding 上测试了所有内容,它工作正常。当我将绑定切换到 wshttpbinding 时:

<endpoint binding="wsHttpBinding" bindingConfiguration="customWsBinding"
          contract="LogisticServiceLibrary.ILogisticService" />

并将soap lite版本更改为使用1.2:

$client = SOAP::Lite
        ->proxy($endpoint)
    ->soapversion('1.2');

然后它给了我一个错误,下面是 SOAPUI 的输出:

2011 年 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>> "POST /LogisticService
HTTP/1.1[\r][\n]" 2011 年 11 月 30 日星期三 18:36:14 EST:DEBUG:>> "TE:
deflate ,gzip;q=0.3[\r][\n]” 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>>
“连接:TE,关闭 [\r][\n]” 11 月 30 日星期三 18 日: 36:14 EST 2011:DEBUG:>>
“接受:文本/xml[\r][\n]” 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>>
“接受:multipart/*[\r] [\n]" 2011 年 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>>
"接受:应用程序/soap[\r][\n]" 2011 年 11 月 30 日星期三 18:36:14 EST
:DEBUG:>> “用户代理:SOAP::Lite/Perl/0.712[\r][\n]” 2011 年 11 月 30 日星期三
18:36:14 EST 2011:DEBUG:>> “内容长度:49496[\r][\n ]"
2011 年 11 月 30 日星期三 18:36:14 EST:DEBUG:>> "Content-Type: application/soap+xml;
charset=utf-8[\r][\n]" 2011 年 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>>
"SOAPAction: http://tempuri.org/ILLogisticService/IssueOrder[\r][\n ]"
2011 年 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>> "主机: localhost:8008[\r][\n]"
11 月 30 日星期三 18:36:14 EST 2011:DEBUG:>> "[\ r][\n]" 2011 年 11 月 30 日星期三 18:36:14
EST :DEBUG:>> " xmlns:namesp1="http://namespaces.soaplite.com/perl"
xmlns:xsi="http://www .w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
肥皂:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> xmlns="http://tempuri.org/"> xmlns:i="http://www.w3.org/2001 /XMLSchema-instance" xmlns=""
xmlns:a="http://schemas.datacontract.org/2004/07/LogisticServiceLibrary"
2011 年 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:<< "HTTP/1.1 400错误
请求[\r][\n]" 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:<< "HTTP/1.1 400
错误请求[\r][\n]" 11 月 30 日星期三 18:36:14 EST 2011:DEBUG:<<
"Content-Length: 0[\r][\n]" Wed 11 月 30 日 18:36:14 EST 2011:DEBUG:<<
"Server: Microsoft-HTTPAPI/1.0[\r][ \n]" 2011 年 11 月 30 日星期三 18:36:14 EST
:DEBUG:<< "日期:2011 年 11 月 30 日星期三 23:36:14 GMT[\r][\n]"
2011 年 11 月 30 日星期三 18:36:14 EST:DEBUG:<< "[\r][\n]"

它说 400 Bad Request ... 知道发生了什么吗?

4

1 回答 1

2

使用WSHttpBinding要求客户端使用 SOAP 1.2 并理解 ws-addressing、ws-reliablemessaging、ws-security、ws-policy 和 ws-policyassertion。我怀疑 SOAP::Lite 是否理解其中的任何内容,因此使用了“Lite”命名法。BasicHttpBinding非常基础,就像 SOAP::Lite 一样 :)

于 2011-12-01T01:30:31.983 回答