在wash_out webservice中的空参数哈希

时间:2015-03-13 17:54:39

标签: ruby-on-rails ruby soap wash-out

我收到以下请求到我的webservice端点:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
    <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo7XpkPiPmyJPgld1ZagBfCsAAAAAuuA6NQEnhkmsWuSpwDPijc8oYdUqrF5HtbM5a3TqBq8ACQAA</VsDebuggerCausalityData>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <NotifyAssessmentReport xmlns="http://www.hr-xml.org/3">
        <DataArea>
            <AssessmentReport>
                <AssessmentSubject>
                    <SubjectID>SubjectId</SubjectID>
                </AssessmentSubject>
                <AssessmentResult>
                    <PackageID>PackageId</PackageID>
                    <Attachment>
                        <EmbeddedData mimeCode="application/pdf" xmlns="http://www.openapplications.org/oagis/9">
                        <!--binary data -->
                        </EmbeddedData>
                        <FileName xmlns="http://www.openapplications.org/oagis/9">Sample_Patrik.pdf</FileName>
                    </Attachment>
                </AssessmentResult>
            </AssessmentReport>
        </DataArea>
    </NotifyAssessmentReport>
</s:Body>

我的控制器如下所示:

class NotifyAssessmentsController < ApplicationController

skip_before_action :verify_authenticity_token

soap_service namespace: 'http://www.hr-xml.org/3', catch_xml_errors: true, wsdl_style: 'document'

soap_action 'NotifyAssessmentReport',
          :args => {:NotifyAssessmentReport => {
              :DataArea => {
                  :AssessmentReport => {
                      :AssessmentSubject => {
                          :SubjectId => :string
                      },
                      :AssessmentResult => {
                          :PackageId => :string,
                          },
                          :Attachment => {
                              :EmbeddedData => :string,
                              :FileName => :string
                          }
                      }
                  }
              }
          },
          :return => nil,
          :to => :notify_assessment_report
def notify_assessment_report
  @encoded_pdf = params[:EmbeddedData].to_s
  render :soap => nil
end

我想查询EmbeddedData,但每次都是空的。如何构建参数hash以从请求中获取数据?

0 个答案:

没有答案