私は石鹸が初めてで、すでに問題を抱えています!私はsoap4r gemを使用しています。
gem 'soap4r', :git => 'git://github.com/felipec/soap4r.git'
require 'soap/wsdlDriver'
require 'soap/rpc/driver'
require 'soap/mapping/mapping.rb'
そして、次のように rpc ドライバーを初期化します。
def initialize
@username = "username"
@password = "password"
endpoint = "https://someurl.php"
namespace = "abc:somenamespace"
@driver = SOAP::RPC::Driver.new(endpoint, namespace)
end
ブラウザからエンドポイントにアクセスすると、次のエラーが発生します。
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
<faultactor xsi:type="xsd:string"/>
<faultstring xsi:type="xsd:string">Operation '' is not defined in the WSDL for this service
</faultstring>
<detail xsi:type="xsd:string"/>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
また、irbからこれを行うと:
client = SOAP::WSDLDriverFactory.new("endpoint?wsdl").create_rpc_driver
このエラーが発生しています:
RuntimeError: part: return cannot be resolved
from /home/sadiksha/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/wsdl/soap/methodDefCreator.rb:144:in `rpcdefinedtype'
from /home/sadiksha/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/wsdl/soap/methodDefCreator.rb:56:in `collect_rpcparameter'
.
.
.
しかし、私がこれを行うと:
client = SOAP::WSDLDriverFactory.new(endpoint).createDriver
メソッドのリスト
client.methods(false)
getName メソッドが 1 つあります。client.getName({:username => "username", :password => "password") でそのメソッドにアクセスしようとすると、次のエラーが表示されます
SOAP::FaultError: Username doesn't exist
from
長くなりすぎてすみません!私は長い間それについて探してきました。しかし、具体的な答えを見つけることができませんでした。誰かが私の質問に答えてくれることを願っています。認証エラーの可能性があると考えています。