Hello, I have been building out some webservices on top of our MS SQL database. Things have been great so far, but I have run into one problem. The complex type in the WSDL for the User model is showing up empty. Here is the wsdl. - <xsd:complexType name="User"> <xsd:all /> </xsd:complexType> Here is the API def: api_method :get_user, :expects => [{:user_id => :int}], :returns => [User] Nothing really stands out as to why this is occuring. The other tables are working fine. I know I could create a struct to return, but that is extra work and not a real answer to the problem. In ruby script\console, this works and returns a user object without any problems: u = User.find(:first) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bump -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I have found the problem. SQL Server has a reserved keyword for "user". In my model, I have set_table_name "[User]". I am guessing the web api is having problems with this because of the brackets? Not sure where to go from here. Kent? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/8/06, Jason Best <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have found the problem. SQL Server has a reserved keyword for "user". > In my model, I have set_table_name "[User]". I am guessing the web api > is having problems with this because of the brackets? Not sure where to > go from here. Kent? >I don''t think it has anything to do with AWS, since AWS never access your database directly, only via ActiveRecord. When the schema type is generated for your model class, ActiveRecord::Base.columns method is used to obtain names and types of elements that comprise your model. So you should look for the solution to your problem in ActiveRecord internals. -- Kent --- http://www.datanoise.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I renamed the database table name and it works fine. This won''t work though as the database schema is already tied to existing .NET applications. Why if it were an ActiveRecord problem, would I still be able to work with the model in console. AWS is the only thing not working with this setup. Kent Sibilev wrote:> On 12/8/06, Jason Best <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> I have found the problem. SQL Server has a reserved keyword for "user". >> In my model, I have set_table_name "[User]". I am guessing the web api >> is having problems with this because of the brackets? Not sure where to >> go from here. Kent? >> > > I don''t think it has anything to do with AWS, since AWS never access > your database directly, only via ActiveRecord. When the schema type is > generated for your model class, ActiveRecord::Base.columns method is > used to obtain names and types of elements that comprise your model. > So you should look for the solution to your problem in ActiveRecord > internals. > > -- > Kent > --- > http://www.datanoise.com-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/9/06, Jason Best <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I renamed the database table name and it works fine. This won''t work > though as the database schema is already tied to existing .NET > applications. Why if it were an ActiveRecord problem, would I still be > able to work with the model in console. AWS is the only thing not > working with this setup.Fair enough. Can you run in the console the following $ User.columns.each{|c| puts "#{c.name} #{c.type.inspect}"}; nil and post here the results? Thanks. -- Kent --- http://www.datanoise.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
larrywright-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Dec-10 14:03 UTC
Re: ComplexType is empty WSDL
On Dec 9, 9:53 pm, Jason Best <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I renamed the database table name and it works fine. This won''t work > though as the database schema is already tied to existing .NET > applications. Why if it were an ActiveRecord problem, would I still be > able to work with the model in console. AWS is the only thing not > working with this setup.Can you use a View in SQL Server with a different name that just maps directly to the Users table? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That is what I did as a work around. Larry Wright wrote:> On Dec 9, 9:53 pm, Jason Best <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> I renamed the database table name and it works fine. This won''t work >> though as the database schema is already tied to existing .NET >> applications. Why if it were an ActiveRecord problem, would I still be >> able to work with the model in console. AWS is the only thing not >> working with this setup. > > Can you use a View in SQL Server with a different name that just maps > directly to the Users table?-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
$ User.columns.each{|c| puts "#{c.name} #{c.type.inspect}"}; nil UserId :integer UserName :string Password :string FirstName :string LastName :string Disabled :boolean Email :string JobTitle :string CanSign :boolean WorksFor :integer Keyword :string PrivateKey :string PublicKey :string CreatedOn :datetime ModifiedOn :datetime => nil Kent Sibilev wrote:> On 12/9/06, Jason Best <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> I renamed the database table name and it works fine. This won''t work >> though as the database schema is already tied to existing .NET >> applications. Why if it were an ActiveRecord problem, would I still be >> able to work with the model in console. AWS is the only thing not >> working with this setup. > > Fair enough. Can you run in the console the following > > $ User.columns.each{|c| puts "#{c.name} #{c.type.inspect}"}; nil > > and post here the results? > > Thanks. > > -- > Kent > --- > http://www.datanoise.com-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Scratch that one, I still had it mapped to the view ;) It''s not returning any of the column names, just => nil Jason Best wrote:> $ User.columns.each{|c| puts "#{c.name} #{c.type.inspect}"}; nil > UserId :integer > UserName :string > Password :string > FirstName :string > LastName :string > Disabled :boolean > Email :string > JobTitle :string > CanSign :boolean > WorksFor :integer > Keyword :string > PrivateKey :string > PublicKey :string > CreatedOn :datetime > ModifiedOn :datetime > => nil > > > Kent Sibilev wrote: >> On 12/9/06, Jason Best <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >>> >>> I renamed the database table name and it works fine. This won''t work >>> though as the database schema is already tied to existing .NET >>> applications. Why if it were an ActiveRecord problem, would I still be >>> able to work with the model in console. AWS is the only thing not >>> working with this setup. >> >> Fair enough. Can you run in the console the following >> >> $ User.columns.each{|c| puts "#{c.name} #{c.type.inspect}"}; nil >> >> and post here the results? >> >> Thanks. >> >> -- >> Kent >> --- >> http://www.datanoise.com-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/11/06, Jason Best <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Scratch that one, I still had it mapped to the view ;) > > > It''s not returning any of the column names, just > > => nil >Ok, that''s the problem. ActiveRecord doesn''t discover table columns correctly. You should open a ticket for ActiveRecord with this particular example attached. -- Kent --- http://www.datanoise.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Done, Thanks a million Kent. Kent Sibilev wrote:> Ok, that''s the problem. ActiveRecord doesn''t discover table columns > correctly. You should open a ticket for ActiveRecord with this > particular example attached. > > -- > Kent > --- > http://www.datanoise.com-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
http://dev.rubyonrails.org/ticket/6818 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---