Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote Data Access with Web Services
Message
 
À
30/11/2007 15:58:44
Mickey Frklic
Dri Management Systems, Inc.
Californie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01272554
Message ID:
01272855
Vues:
15
UPDATE:
Debugging the code we noticed the following is happening when runnin in Web Service mode.

in CustomerOrdersForm() constructor for windows app we make a call to
this.Shipper.GetAllEntities();
-> step into, which calls:
this.GetAllData();
-> step into:
mmDataAccessBase DAO = this.GetDataAccessObject();

switch (this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					IDbCommand SelectCommand = DAO.CreateSelectCommand();

					if (SelectCommand != null)
					{
						this.GetDataSet(SelectCommand, this.TableName);
						DT = this.DataSet.Tables[this.TableName];
					}
					else if(!String.IsNullOrEmpty(this.UpdateSelectStatement))
					{
						this.GetDataSet(this.UpdateSelectStatement, this.TableName);
					}
					
					break;

				case CommandType.Text:
					this.GetDataSet("SELECT * FROM " +
						DAO.TableNameDelimitBegin + this.PhysicalDbcObjectName + DAO.TableNameDelimitEnd +
						(mmString.Empty(this.DefaultSortOrder) ? "" : " ORDER BY " + this.DefaultSortOrder));
					DT = this.DataSet.Tables[this.TableName];
					break;

				default:
					break;
			}
in the above code section mmDataAccessBase DAO = this.GetDataAccessObject(); appears to correct assign DAO to {OakLeaf.MM.Main.Data.mmDataAccessWebServiceSql} with the data access class as "ShipperDataAccess".

But when it gets to
case CommandType.StoredProcedure:
					IDbCommand SelectCommand = DAO.CreateSelectCommand();
DAO.CreateSelectCommand() just returns NULL - code from mmDataAccessBase.cs:
		public virtual IDbCommand CreateSelectCommand()
		{
			return null;
		}
So in our App we get no data returned. Also might be good to note this is 2.5 pre release in case something is in the middle of change here for the Remote Data Access to work correctly.

If anyone has any insight or ideas to help us getting the Remote Data Access with Web Services working correctly, we would greatly appreciate any feedback or suggestions.

-DRI Development Team-

>Dear Mere Mortals .NET Framework Support,
>
>Our company is currently looking into using the MM .NET Remote Data Access Web Services for our MM .NET Windows Application to use the web services feature of Mere Mortals for all Database calls.
>
>I have gone through the simple changes within the MM .NET Developers Guide for implementing this feature using the Jump Start: Windows Forms Application - C# to test the features before migrating these changes to our existing Company Windows MM App.
>
>These changes include the following
>(Remote Data Access with Web Services section of MM .NET Developer's Guide):
>
>1) Creating the MM .NET Data Access Service as a deployed web project to my local IIS
>
>2) Adding the Mere Mortals Framework Web Services 2005 assembly reference to both the Business Object Project and the Windows Form Project
>
>3) Modifying the Windows App Factory.cs to override CreateDataAccessSql() to return via the web service
>
>4) Adding the DefaultDataAccessMode key to the App.Config file of the Windows App and setting the value to "webservice"
>
>5) For Custom DataAccess classes, modified the CreateDataAccessObject() for each custom class to return via Local or Webservice based on value of DefaultDataAccessMode
>(Note: For this step, the guide shows a return of
>
>    return new mmDataAccessWebServiceSql("InventoryDataAccess");
>
>and I had to change it to also supply the URL as the first param
>
>    return new mmDataAccessWebServiceSql("http://localhost/MM%20.NET%20Data%20Access%20Service/DataWebService.asmx", "InventoryDataAccess");
>
>
>6) Modified the Factory.cs for the Web Service project to override CreateDataAccessObject() so that it returns the correct object based on the dataAccessClass parameter passed via the web service call.
>
>7) Added a direct reference to the Business Objects Project in the Web Service Project.
>
>At first glance it appears everything is working as expected - I even booted up SQL Profiler on my local SQL Server to verify that all the calls were coming from the ASPNET system account and not my user credentials to call the Stored Procedures used.
>
>Also in the Windows App Jump Start Sample there is a Navigation toolbar loaded that I just disabled because even tho it was pointing to an mm_DataGridView, clicking on the arrow to jump between records from the Grid caused an exception saying it was empty or a negative value.
>
>Also it appears that the this.Shipper.GetAllEntities(); function is coming back with 0 entities so my combobox bound to this Business Object shows no values.
>
>My question is.. is there more to be done to make the Sample MM .NET Windows App work with the MM .NET Remote Data Access with Web Services?
>
>Maybe something has changed that also needs to be done that is not listed in the 2.4 version of the Developer's Guide?
>
>Any help on this issue would be greatly appreciated. Again - all the code used is from the Windows App Jump Start and the Remote Data Access with Web Services portions and of course the Jump Start for the initial Business Objects Project.
>
>If anyone needs me to provide more sample code - let me know and I can easily provide that but that only part the went away from the guide was the step 5 sincemmDataAccessWebServiceSql() required 2 parameters and not just 1.
>
>Mickey
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform