This is a migrated thread and some comments may be shown as answers.

OpenAccess Made Easy: Web Services Example

4 Answers 134 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 2
James asked on 24 Sep 2010, 08:36 AM
Hi,

Currently I'm learning OpenAccess Made Easy (PDF). It's a good book.

My environment: VS2010 + OpenAccess Q2 2010 + WinForm Q2 2010 + SQL Server 2008 R2 Express.

I started '4.6 Web Services Example' from page 105 of 258, and all steps are OK.

In '6)' section of Page 120 of 258, the guide (PDF) says:
6) If you expand the Solution explorer, you should see a new Project DataSource show up in your
 WinFormClient project (see image below).

However, I don't see the Project DataSource folder in WinFormClient project at all after performing all steps described previously. Please see the attached screenshot.

Have I missed anything?

Thanks!

Regards,
James

4 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 2
answered on 24 Sep 2010, 10:51 AM
UPDATE: I've tried 'ORM\CS\5_NTier' solution in OpenAccess_ORM_Courseware_Projects.zip successfully on this platform: VS 2010 + OpenAccess Q2 2010 + RadControls for WinForm Q2 2010 + SQL Server 2008 R2 Express.

Original Post:

I also tried 'ORM\CS\3_OpenAccessInApplications' solutions in OpenAccess_ORM_Courseware_Projects.zip.

The steps:

1) Load the solution to VS 2010.
2) Convert the solution.
3) Remove Telerik.OpenAccess.Query reference in Model and Service projects. Add Telerik.OpenAccess.35.Extensions reference to the two projects.
4) Use 'ORM Enable' wizard to update the database connection (the same new database) for both Model and Service projects.
5) Set 'UpdateDatabase' property to true for Model project. Use the menu Telerik > OpenAccess > Database Operations > Update Database. Now, there are three tables are created for the new database: contact, contact_group and voa_keygen.
6) Double click Form1.cs in WinFormClient project, and accept the default RadControls for WinForm update prompt.
7) Re-build the solution. The re-build is successful.
8) Set 'Service' project as startup project. Ctrl + F5 to start the service. 

In the 8th step, WCF Test Client is displayed. Double click IService1 > GetContactGroups() method, and click Invoke button. A 'Failed to invoke the service' error pops up (see the attachment). The error details:

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.<br><br>Server stack trace: <br>   at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()<br>   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)<br>   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)<br>   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)<br><br>Exception rethrown at [0]: <br>   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br>   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)<br>   at IService1.GetContactGroups()<br>   at Service1Client.GetContactGroups()<br>

9) Set 'WinFormClient' project as startup project. Ctrl + F5 to start the windows application.

In the 9th step, 'Unhandled exception has occurred in your application. ' error message box is displayed. Details:

See the end of this message for details on invoking <br>just-in-time (JIT) debugging instead of this dialog box.<br><br>************** Exception Text **************<br>System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.<br><br>Server stack trace: <br>   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)<br>   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)<br>   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)<br>   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)<br>   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)<br><br>Exception rethrown at [0]: <br>   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br>   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)<br>   at WinFormClient.ServiceReference1.IService1.GetContactGroups()<br>   at WinFormClient.ServiceReference1.Service1Client.GetContactGroups() in C:\Telerik_Learn\ORM\CS\4_Service\WinFormClient\Service References\ServiceReference1\Reference.cs:line 56<br>   at WinFormClient.Form1.LoadCombo() in C:\Telerik_Learn\ORM\CS\4_Service\WinFormClient\Form1.cs:line 60<br>   at WinFormClient.Form1.Form1_Load(Object sender, EventArgs e) in C:\Telerik_Learn\ORM\CS\4_Service\WinFormClient\Form1.cs:line 128<br>   at System.Windows.Forms.Form.OnLoad(EventArgs e)<br>   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)<br>   at System.Windows.Forms.Control.CreateControl()<br>   at System.Windows.Forms.Control.WmShowWindow(Message& m)<br>   at System.Windows.Forms.Control.WndProc(Message& m)<br>   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br>   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br><br><br>************** Loaded Assemblies **************<br>mscorlib<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)<br>    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll<br>----------------------------------------<br>WinFormClient<br>    Assembly Version: 1.0.0.0<br>    Win32 Version: 1.0.0.0<br>    CodeBase: file:///C:/Telerik_Learn/ORM/CS/4_Service/WinFormClient/bin/Debug/WinFormClient.exe<br>----------------------------------------<br>System.Windows.Forms<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll<br>----------------------------------------<br>System<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll<br>----------------------------------------<br>System.Drawing<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll<br>----------------------------------------<br>System.ServiceModel<br>    Assembly Version: 3.0.0.0<br>    Win32 Version: 3.0.4506.4926 (NetFXw7.030729-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.ServiceModel/3.0.0.0__b77a5c561934e089/System.ServiceModel.dll<br>----------------------------------------<br>SMDiagnostics<br>    Assembly Version: 3.0.0.0<br>    Win32 Version: 3.0.4506.4926 (NetFXw7.030729-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/SMDiagnostics/3.0.0.0__b77a5c561934e089/SMDiagnostics.dll<br>----------------------------------------<br>System.Configuration<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll<br>----------------------------------------<br>System.Xml<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll<br>----------------------------------------<br>Telerik.OpenAccess<br>    Assembly Version: 2010.2.714.1<br>    Win32 Version: 2010.2.714.1<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Telerik.OpenAccess/2010.2.714.1__7ce17eeaf1d59342/Telerik.OpenAccess.dll<br>----------------------------------------<br>System.WorkflowServices<br>    Assembly Version: 3.5.0.0<br>    Win32 Version: 3.5.594.4926<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.WorkflowServices/3.5.0.0__31bf3856ad364e35/System.WorkflowServices.dll<br>----------------------------------------<br>System.ServiceModel.Web<br>    Assembly Version: 3.5.0.0<br>    Win32 Version: 3.5.594.4926<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll<br>----------------------------------------<br>Microsoft.VisualStudio.Diagnostics.ServiceModelSink<br>    Assembly Version: 3.0.0.0<br>    Win32 Version: 10.0.30319.1<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Diagnostics.ServiceModelSink/3.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll<br>----------------------------------------<br>System.Runtime.Serialization<br>    Assembly Version: 3.0.0.0<br>    Win32 Version: 3.0.4506.4926 (NetFXw7.030729-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Serialization/3.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll<br>----------------------------------------<br>System.IdentityModel<br>    Assembly Version: 3.0.0.0<br>    Win32 Version: 3.0.4506.4926 (NetFXw7.030729-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.IdentityModel/3.0.0.0__b77a5c561934e089/System.IdentityModel.dll<br>----------------------------------------<br>Telerik.WinControls.GridView<br>    Assembly Version: 2010.2.10.713<br>    Win32 Version: 2010.2.10.0713<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls.GridView/2010.2.10.713__5bb2a467cbec794e/Telerik.WinControls.GridView.dll<br>----------------------------------------<br>Telerik.WinControls<br>    Assembly Version: 2010.2.10.713<br>    Win32 Version: 2010.2.10.0713<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls/2010.2.10.713__5bb2a467cbec794e/Telerik.WinControls.dll<br>----------------------------------------<br>TelerikCommon<br>    Assembly Version: 2010.2.10.713<br>    Win32 Version: 2010.2.10.0713<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/TelerikCommon/2010.2.10.713__5bb2a467cbec794e/TelerikCommon.dll<br>----------------------------------------<br>Telerik.WinControls.UI<br>    Assembly Version: 2010.2.10.713<br>    Win32 Version: 2010.2.10.0713<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Telerik.WinControls.UI/2010.2.10.713__5bb2a467cbec794e/Telerik.WinControls.UI.dll<br>----------------------------------------<br>wsoc4cc3<br>    Assembly Version: 2010.2.10.713<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll<br>----------------------------------------<br>Accessibility<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll<br>----------------------------------------<br>Model<br>    Assembly Version: 1.0.0.0<br>    Win32 Version: 1.0.0.0<br>    CodeBase: file:///C:/Telerik_Learn/ORM/CS/4_Service/WinFormClient/bin/Debug/Model.DLL<br>----------------------------------------<br>System.IdentityModel.Selectors<br>    Assembly Version: 3.0.0.0<br>    Win32 Version: 3.0.4506.4926<br>    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.IdentityModel.Selectors/3.0.0.0__b77a5c561934e089/System.IdentityModel.Selectors.dll<br>----------------------------------------<br>System.Web<br>    Assembly Version: 2.0.0.0<br>    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)<br>    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll<br>----------------------------------------<br><br>************** JIT Debugging **************<br>To enable just-in-time (JIT) debugging, the .config file for this<br>application or computer (machine.config) must have the<br>jitDebugging value set in the system.windows.forms section.<br>The application must also be compiled with debugging<br>enabled.<br><br>For example:<br><br><configuration><br>    <system.windows.forms jitDebugging="true" /><br></configuration><br><br>When JIT debugging is enabled, any unhandled exception<br>will be sent to the JIT debugger registered on the computer<br>rather than be handled by this dialog box.<br><br><br>

Please suggest. 

Regards,
James
0
James
Top achievements
Rank 2
answered on 24 Sep 2010, 10:53 AM
Another question:

Should I use WCF service library for N-tier application (WinForm) using OpenAccess?

Thanks!
0
Damyan Bogoev
Telerik team
answered on 28 Sep 2010, 04:46 PM
Hi James,

1. You should look for the Project DataSource under the following path - WinFormClient | Properties | DataSources. (p1.png).
2. Please do the following steps in order to run the applications:
- Remove the Telerik.OpenAccess.Query reference from the DataAccess project and add reference to Telerik.OpenAccess.35.Extensions;
- Go to WinFormClient | Service References, right click on ServiceReference1 and choose the Update Service Reference option.(p3.png );
- Rebuild the solution and run the projects;
Now everything should work correctly (p2.png).
3. It is a good practice to use services to call the data into the data access layer, as this separates the application layers.
Hope you will find useful the provided information.

Kind regards,
Damyan Bogoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
James
Top achievements
Rank 2
answered on 30 Sep 2010, 09:32 AM
Hi Damyan,

Thank you for your answer with examples!

I'll try it soon.

Regards,
James
Tags
Getting Started
Asked by
James
Top achievements
Rank 2
Answers by
James
Top achievements
Rank 2
Damyan Bogoev
Telerik team
Share this question
or