4
我在更改SOAP xml的命名空間時遇到問題。我不知道如何改變 「的xmlns:ENV =」 到 「的xmlns:soapenv =」 和 「的xmlns:TNS =」 到 「的xmlns:網絡=」Ruby/Savon:遇到肥皂請求的命名空間問題
我試圖建立:
什麼我目前得到
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.webserviceX.NET/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<tns:ConvertTemp>
<tns:temperature>100</tns:temperature>
<tns:fromUnit>degreeCelsius</tns:fromUnit>
<tns:toUnit>degreeFahrenheit</tns:toUnit>
</tns:ConvertTemp>
</env:Body>
</env:Envelope>
我的代碼:
client = Savon.client(wsdl: "http://www.webservicex.net/ConvertTemperature.asmx?WSDL")
message = { temperature: '100',FromUnit: 'degreeCelsius' , ToUnit: 'degreeFahrenheit'}
response = client.call(:convert_temp, message: message)
感謝您的幫助。
我有同樣的肥皂問題,你能解釋一下你是如何解決這個問題的嗎? –
將此添加到您的clientconvert_request_keys_to::none, –