Неверно сформированный XML-ответ с использованием гема Washout

Я использую Washout Gem для подключения к Quickbooks Web Connector из Rails 3.2.8. Мне нужно отформатировать возврат как "<tns:AuthenticateResult>", но я не смог найти способ. Вместо этого я получаю"<AuthenticateResult xsi:type="tns:AuthenticateResult">Msgstr "Я пытался изменить значения snakecase и camelcase. Любая помощь будет принята с благодарностью.


Что мне нужно

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://developer.intuit.com/">
    <SOAP-ENV:Body>
        <ns1:authenticateResponse>
            <ns1:authenticateResult>
                <ns1:string>15c9ce293bd3f41b761c21635b14fa06</ns1:string>
                <ns1:string></ns1:string>
            </ns1:authenticateResult>
        </ns1:authenticateResponse>
    </SOAP-ENV:Body>

Что я получаю

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://developer.intuit.com/">
  <soap:Body>
    <tns:authenticateResponse>
      <AuthenticateResult xsi:type="tns:AuthenticateResult">
        <String xsi:type="xsd:string">abf36037372fa6cf089dbdbc33b11771908afe57</String>
        <String xsi:type="xsd:string"></String>
      </AuthenticateResult>
    </tns:authenticateResponse>
  </soap:Body>

Мой код

soap_action "authenticate",
              :args => {:strUserName => :string, :strPassword => :string},
              :return => { :authenticate_result => [{string: [:string]}]}
  def authenticate
    username = params[:strUserName]
    password = params[:strPassword]
    if (Role.find_by_token(username))
      if QuickbooksImportStatus.find_by_token(username).blank?
        QuickbooksImportStatus.create(:username => User.find(Role.find_by_token(username).user_id).username)
      end
      render :soap => {:authenticate_result => [{string: [username, '']}]}
    end
  end

1 ответ

Решение

Мы добавили возможность реализовать это. Следите за обсуждением на https://github.com/roundlake/wash_out/issues/73

Другие вопросы по тегам