-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elaborate doc on reusable types #95
Comments
Will try to reproduce it tomorrow. |
Could you please provide an |
Thanks for giving it a look. metadata.inspect : |
Did you manage to reproduce the issue ? |
Not really. Is the issue connected to the PR you made? |
Hi, Controller soap_action "getSessionId",
args: {
:username => :string,
:password => :string
},
:return => SessionId,
:to => :get_session_id,
:response_tag => "getSessionIdResponse"
def get_session_id
render :soap => SessionId.fetch(params[:username], params[:password])
end Model: class SessionId < ResponseObject
map :getSessionIdResult => :string
def self.fetch(login, password)
a_string = "0123456789"
return { :getSessionIdResult => a_string }
end
end The code above code works if you replace return { :getSessionIdResult => a_string } with return { :value => { :getSessionIdResult => a_string } } in SessionId fetch() and here is the generated soap response: <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://www.sonos.com/Services/1.1">
<soap:Body>
<getSessionIdResponse>
<value xsi:type="tns:value">
<getSessionIdResult xsi:type="xsd:string">
0123456789
</getSessionIdResult>
</value>
</getSessionIdResponse>
</soap:Body>
</soap:Envelope> but i would like to have something like this: <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://www.sonos.com/Services/1.1">
<soap:Body>
<getSessionIdResponse>
<getSessionIdResult xsi:type="xsd:string">
0123456789
</getSessionIdResult>
</getSessionIdResponse>
</soap:Body>
</soap:Envelope> any lead ? Thank you |
Ah, I see now. I wasn't able to reproduce that exactly because I used |
The bug is fixed. It breaks backward compatibility however. Therefore I ticked it to 0.8. Try master pls. Let's ensure it works to release it. |
Hi inossidabile, I've been working on the example what you're talking about and the bug it's fixed, but I'm having some problems when I change the config.wash_out.style = 'document'. For some reason the params[:var] of the soap_action are not transfered to the contained variable, as result of this, It's impossible to use WSDL style 'document'. If you want to try you just have to change: config.wash_out.style = 'document' and, in the class "SessionId < ResponseObject" a_string = login + pasword PS: Thank's in advance for the GEM, It's so usefull |
Hi again, Maybe I made a mistake, If I add at the begining of the controller next to It works, but when I was reading your source_code soap.rb I thought that this included do included It by default. So don't lose your time with my previous question :) |
Hi,
I'm having a problem using washout 0.7.1 with Rails 4.0.0.rc1 and Savon 0.9.2
I beleive it's because of how i used reusable types, but I'm not sure. It would be awesome to have a more complete example in the doc, section "Reusable Types"
Here is an example of what I'm doing, where ResponseObject inherits from WashOut::Type
controller:
model:
The model classes MediaCollection and MediaMetadata follow the same pattern as the Metadata class (with eventually other nested reusable types)
Running something like this gives me :
NoMethodError (undefined method '[]' for nil:NilClass) app/controllers/soap_controller.rb:35:in `get_metadata'
Any help would be appreciated.
Thank you,
Regards,
Mehdi.
The text was updated successfully, but these errors were encountered: