SOAP4R?

W

Wilmar Sulaiman

Dear all,

I tried to send "Hello World" msg via SOAP4R , the reason why I used
SOAP4R is to get the XML as an output. I found that the XML is not
generated the correct output. I wonder where I did wrong in my program?
Sorry I am really newcomer to Ruby any references should be good,
because it's really hard learning ruby since there is not much
documentation available on the net.

cheers,
Wilmar

--- TestSoap.cgi-
require 'dbi'
require 'soap/cgistub'

class TestSOAP < SOAP::CGIStub

def on_init
add_method(self, 'retrieve_row')
retrieve_row
end

def retrieve_row
print 'Content-type: text/html\n\n'
puts 'Hello World'
end

end

status = TestSOAP.new('TestSOAP', nil).start

-- XML output pointing to this cgi -

<env:Envelope>
-
<env:Body>
-
<env:Fault
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<faultcode xsi:type="xsd:string">Server</faultcode>
<faultstring xsi:type="xsd:string">Method 'GET' not allowed.</faultstring>
<faultactor xsi:type="xsd:string">TestSOAP</faultactor>
-
<detail xsi:type="n2:SOAPException">
<excn_type_name
xsi:type="xsd:string">SOAP..RPC..CGIStub..CGIError</excn_type_name>
-
<cause xsi:type="n3:SOAP..RPC..CGIStub..CGIError">
<message xsi:type="xsd:string">Method 'GET' not allowed.</message>
-
<backtrace xsi:type="n1:Array" n1:arrayType="xsd:anyType[5]">
-
<item xsi:type="xsd:string">
/usr/local/lib/ruby/1.8/soap/rpc/cgistub.rb:74:in `validate'
</item>
-
<item xsi:type="xsd:string">
/usr/local/lib/ruby/1.8/soap/rpc/cgistub.rb:49:in `init'
</item>
-
<item xsi:type="xsd:string">
/usr/local/lib/ruby/1.8/soap/rpc/cgistub.rb:168:in `run'
</item>
<item xsi:type="xsd:string">/usr/local/lib/ruby/1.8/logger.rb:684:in
`start'</item>
<item xsi:type="xsd:string">/var/www/cgi-bin/TestSoap.cgi:20</item>
</backtrace>
</cause>
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top