我使用savon version 2(使用Ruby on Rails)來調用Web服務,我需要向我的Envelope注入一些額外的命名空間。喜歡的東西:Rails - Savon設置多個命名空間
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing"
xmlns:newNamespace1="http://someURL.pt/Test1"
xmlns:newNamespace2="http://someURL.pt/Test2"
xmlns:newNamespace3="http://someURL.pt/Test3"
我當前的代碼是:
client = Savon.client do
wsdl "https://someValidURL?wsdl"
namespace "http://someURL.pt/Test1"
namespace "http://someURL.pt/Test2"
namespace "http://someURL.pt/Test3"
end
response = client.call(...the webservice call...)
...但在我的請求,薩翁只把最後一個命名空間
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsns="http://someURL.pt/Test3"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
我沒有找到任何文件關於這個Savon Git project。
有沒有人有這個問題的解決方法?
PS-我也檢查一種可能的解決方案是設置所有的xml請求(信封)請求,但...呃...太像一個黑客。
如果這是不可能的,有其他好的寶石要做到這一點,請告訴我=)