我得到這個錯誤。這裏是代碼片段:WSDL使用Ruby
require 'soap/wsdlDriver'
wsdl = url
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
driver.options["protocol.http.basic_auth"] << [url, user_name, password]
url指向一個格式良好的xml。
任何解決方案?
我得到這個錯誤。這裏是代碼片段:WSDL使用Ruby
require 'soap/wsdlDriver'
wsdl = url
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
driver.options["protocol.http.basic_auth"] << [url, user_name, password]
url指向一個格式良好的xml。
任何解決方案?
你能分享wsdl
文件嗎?也許這會幫助我們更好地回答它。
無論如何,我建議首先使用wsdl2ruby
來生成Driver類。然後將它們嵌入到Ruby文件中(通過require
)。示例(來自手冊頁):
# For server side:
$ wsdl2ruby.rb --wsdl myapp.wsdl --type server
# For client side:
$ wsdl2ruby.rb --wsdl myapp.wsdl --type client
如果您在網絡瀏覽器中加載URL,是否將其重定向到其他位置?
根據我的經驗,錯誤「未知元素:{} HTML」出現的一個原因是WSDL解析器試圖解析HTTP重定向的HTML部分並且未能這樣做。因此,您應該自己處理重定向(無論是以代碼方式還是手動方式),併爲WSDL驅動程序提供最終的URL。
我試圖在SharePoint上調用列表web服務。 http://msdn.microsoft.com/en-us/library/lists.lists%28v=office.12%29.aspx – Rahul 2011-03-24 06:13:39