我正在使用Washout Gem从Rails 3.2.8连接到Quickbooks Web Connector。我需要将返回格式设置为“<tns:AuthenticateResult>
”,但我无法找到方法。相反,我得到“<AuthenticateResult xsi:type="tns:AuthenticateResult">
”。
我试过更改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