我创建了一个简单的 Web 服务,只连接两个字符串。我使用wash_out gem 创建了这个Web 服务。所以我的网络服务在我的 Rails 服务器上。
带有 concat 方法的控制器:
class ContextserverController < ApplicationController
include WashOut::SOAP
soap_service namespace: 'urn:WashOut', wsdl_style: 'document'
soap_action "concat",
:args => { :concatRequest => {:a => :string, :b => :string }},
:return => {:result => :string}
def concat
# something I want to do in ruby
puts "*******************************************************************"
puts "************************ CONCAT *******************************"
puts "*******************************************************************"
puts params
puts params[:concatRequest][:a]
puts params[:concatRequest][:b]
result = params[:concatRequest][:a] + params[:concatRequest][:b]
puts "ERGEBNIS: " + result
puts "*******************************************************************"
# and then send response to BPEL process
render :soap => ( { :result => result } )
end
end
另一方面,我有我的 BPEL 流程,我想在其中调用此 Web 服务。当我想调用该过程时...
[INVOKE] Failure during invoke: Error sending message (mex={PartnerRoleMex#hqejbhcnphraka328skerr [PID {http://localhost:8080/test}TestProcess-5609] calling org.apache.ode.bpel.epr.WSAEndpoint@1f939560.concat(...) Status ASYNC}): SOAP message MUST NOT contain a Document Type Declaratio
[BpelRuntimeContextImpl] ActivityRecovery: Registering activity 15, failure reason: Error sending message (mex={PartnerRoleMex#hqejbhcnphraka328skerr [PID {http://localhost:8080/test}TestProcess-5609] calling org.apache.ode.bpel.epr.WSAEndpoint@1f939560.concat(...) Status ASYNC}): SOAP message MUST NOT contain a Document Type Declaratio on channel 27
在 Rails 服务器日志中,我看到以下内容:
Processing by ContextserverController#concat as HTML
#<ActionDispatch::Http::Headers:0x007fc82a9c56b8>
*******************************************************************
************************ CONCAT *******************************
*******************************************************************
{}
Completed 500 Internal Server Error in 12ms
我认为问题在于处理为HTML。如果我使用 Eclipse Web Service Explorer 测试 Web 服务,Web 服务将在SOAP中处理!
当我直接使用 Web Service Explorer 测试 Web 服务时:
Processing by ContextserverController#concat as SOAP
*******************************************************************
************************ CONCAT *******************************
*******************************************************************
{"concatRequest"=>{"a"=>"a", "b"=>"b"}}
a
b
ERGEBNIS: ab
*******************************************************************
Rendered /Users/jordan/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/wash_out-0.9.2/app/views/wash_with_soap/document/response.builder (1.2ms)
所以我不明白为什么当我调用该流程时该流程将作为 HTML 执行。