Table of Contents [Hide/Show]
Web Services Configuring Generated Web Services Configuration Using Web Service Provider Updating Web Reference Updating Other References Accessing your Data
1 <configuration> 2 <configSections> 3 <section name="netTiersService" 4 type="North.DataAccessLayer.Bases.NetTiersServiceSection, 5 North.DataAccessLayer" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/> 6 </configSections> 7 ... 8 </configuration>
1 2 <netTiersService defaultProvider="WsNetTiersProvider"> 3 <providers> 4 <!--*** SqlClient Provider *** 5 connectionStringName: sqlclient connection string to the db 6 useStoredProcedure: if trueindicates that we use the stored procedures, otherwise, we use parametrized queries that are embedded. 7 --> 8 9 <add name="SqlNetTiersProvider" type="Northwind.Data.SqlClient.SqlNetTiersProvider, Northwind.Data.SqlClient" 10connectionStringName="netTiersConnectionString" useStoredProcedure="false" 11providerInvariantName="System.Data.SqlClient" entityFactoryType="Northwind.Entities.EntityFactory" enableEntityTracking="true" /> 12 13 <!-- 14 *** WebserviceClient Provider *** 15 The url parameter indicates the webservices url (ex: http://localhost/NorthWind/NorthWindServices.aspx) 16 --> 17 18 <add name="WsNetTiersProvider" type="Northwind.Data.WebServiceClient.WsNetTiersProvider, Northwind.Data.WebServiceClient" url="http://localhost/NorthwindServices/NorthwindServices.asmx" /> 19 </providers> 20 </netTiersService>
1 <configSections> 2 <section name="netTiersService" type="Northwind.Data.Bases.NetTiersServiceSection, Northwind.Data" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/> 3 </configSections> 4 <netTiersService defaultProvider="WsNetTiersProvider"> 5 <providers> 6 <!-- 7 *** WebserviceClient Provider *** 8 The url parameter indicates the webservices url (ex: http://localhost/NorthWind/NorthWindServices.aspx) 9 --> 10 11 <add name="WsNetTiersProvider" type="Northwind.Data.WebServiceClient.WsNetTiersProvider, Northwind.Data.WebServiceClient" url="http://localhost/NorthwindServices/NorthwindServices.asmx" /> 12 </providers> 13 </netTiersService>
Webservice Exposed API
Updating Your Web Reference
1 using Northwind.Data; 2 using Northwind.Entities; 3 using Northwind.Data.WebServiceClient; 4 5 TList<Orders> list = DataRepository.OrdersProvider.GetAll();
1 2 /**//// <summary> 3 /// Gets all rows from the DataSource. 4 /// </summary> 5 /// <returns>Returns a TList of Entity objects.</returns> 6 public TList<Entity> GetAll() 7 ...{ 8 return GetAll(null); 9 }
1 /**//// <summary> 2 /// Gets All rows from the DataSource. 3 /// </summary> 4 /// <param name="transactionManager"> object</param> 5 /// <param name="start">Row number at which to start reading.</param> 6 /// <param name="pageLength">Number of rows to return.</param> 7 /// <param name="count">out parameter to get total records </param> 8 /// <remarks></remarks> 9 /// <returns>Returns a TList<Northwind.Entities.Orders></returns> 10 public override Northwind.Entities.TList<Orders> GetAll( 11 TransactionManager transactionManager, 12 int start, 13 int pageLength, 14 out int count) 15 ...{ 16 17 WsProxy.NorthwindServices proxy = new WsProxy.NorthwindServices(); 18 proxy.Url = this._url; 19 20 WsProxy.Orders[] items = 21 proxy.OrdersProvider_GetAll(start, pageLength, out count); 22 23 return Convert(items); 24 }