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.
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)
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 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.
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
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.
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.
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?
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?
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
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
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.
Ok, that’s the problem. ActiveRecord doesn’t discover table columns
correctly. You should open a ticket for ActiveRecord with this
particular example attached.