G
Giacecco
Dear all,
I am trying to manually build a soap envelope to call a web service,
because I cannot use soap4r: it has some strange compatibility problems
when interfacing my Oracle BPEL Process Manager.
My code is the following, and I think it is quite ok. I am only missing
how to set custom http headers in the request. I believe I need to set
"Content-Type" to "text/xml" and "SOAPAction" to "initiate. Please
help!
Gianfranco
require 'net/http'
Net::HTTP.start('whatever', 7777) do |http|
postString = '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
(...)
</soapenv:Body>
</soapenv:Envelope>'
response = http.post2('/whatever', postString)
case response
when Net::HTTPSuccess
puts 'Ok!'
else
response.error!
end
end
I am trying to manually build a soap envelope to call a web service,
because I cannot use soap4r: it has some strange compatibility problems
when interfacing my Oracle BPEL Process Manager.
My code is the following, and I think it is quite ok. I am only missing
how to set custom http headers in the request. I believe I need to set
"Content-Type" to "text/xml" and "SOAPAction" to "initiate. Please
help!
Gianfranco
require 'net/http'
Net::HTTP.start('whatever', 7777) do |http|
postString = '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
(...)
</soapenv:Body>
</soapenv:Envelope>'
response = http.post2('/whatever', postString)
case response
when Net::HTTPSuccess
puts 'Ok!'
else
response.error!
end
end