2012-10-26 74 views
1

我正在嘗試使用Savon - ruby​​gem創建SOAPClient。Savon:使用wsse驗證的WCF Soap服務:AddressFilter不匹配在EndpointDispatcher

它是一個WCF soap服務,通過https進行WSSE身份驗證。這裏是我試過的代碼:

require 'savon' 

client = Savon::Client.new do 
    wsdl.document = "https://svc.sxxxxxify.com:8081/ConfSet.svc?wsdl" 
    config.soap_version = 2 
    wsse.credentials "[email protected]", "test123" 
end 

p client.wsdl.soap_actions 
response = client.request :get_user_clients 
p response 

但我得到這個錯誤:

http://www.w3.org/2005/08/addressing/soap/fault2012-10-26T06:07:42.247Z2012-10-26T06:12:42.247Zs:Sendera:DestinationUnreachableThe message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree. (Savon::SOAP::Fault)

請幫我解決這個問題

+0

是否savon支持WS-A。我如何通過使用savon進行ws-addressing? –

回答

1

我有一些問題。我已經通過提供一個頭條目和一個新的名稱空間來解決'To'問題。 '行動'頭也是必要的,但我只發現在檢查SoapUI日誌後。這是什麼爲我工作:

@service_url = 'https://svc.sxxxxxify.com:8081/ConfSet.svc/service' 
    @action = 'your_action' 
    @client = Savon.client(:wsdl => "#{@service_url}?wsdl", :soap_version => 2, 
    :namespaces => {"xmlns:x" => "http://www.w3.org/2005/08/addressing"}, 
    :soap_header => {"x:To" => @service_url, "x:Action" => "http://tempuri.org/#{@action}"}) 
相關問題