﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Webservices</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 13:39:52 GMT</lastBuildDate><ttl>20</ttl><item><title>Webservices</title><link>http://forum.strataframe.net/FindPost859.aspx</link><description>Hello,&lt;/P&gt;&lt;P&gt;I have a BO project to ecapsulate all the data access.&lt;/P&gt;&lt;P&gt;I'd like to now create a webservice project to utilize the BOs I created (which will be consumed by both web and win forms).&lt;/P&gt;&lt;P&gt;Would webservices be a good fit here? I haven't played with webservices much, so I am beginning my google quest, but wanted to see if anyone here has implemented this and would be willing to share their ideas.&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Fri, 21 Apr 2006 11:04:07 GMT</pubDate><dc:creator>Kevin Lingofelter</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost881.aspx</link><description>Glad to help!</description><pubDate>Fri, 21 Apr 2006 11:04:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost879.aspx</link><description>Perfect! Thanks a million!&lt;/P&gt;&lt;P&gt;Kevin</description><pubDate>Fri, 21 Apr 2006 10:42:26 GMT</pubDate><dc:creator>Kevin Lingofelter</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost878.aspx</link><description>You can do this, but you do not need to add the connection everytime.&amp;nbsp; The DataSources are a shared and a webserive runs in an application pool like a website.&amp;nbsp; So you do not need to add teh data connection each time.&amp;nbsp; One thing you can do if you are going to use a WebMethod is to just check on the count of the DataSources collection.&amp;nbsp; If it is 0, then add the connection.&amp;nbsp; Otherwise, leave it alone because it has already been setup.&lt;/P&gt;&lt;P&gt;&amp;lt;WebMethod()&amp;gt; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Function SampleMethod() As String&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Determine if the connection has been established&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If MicroFour.StrataFrame.Data.DataBasics.DataSources.Count = 0 Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataBasics.DataSources.Add(New SqlDataSourceItem("", "MyConnectionSTring"))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "Whatever"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/P&gt;&lt;P&gt;- or - :P&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Much Better Solution&lt;/STRONG&gt;&lt;BR&gt;You can add a global.asax to your webservice project and add the code once in the Application_Startup method and never worry about it...&lt;/P&gt;&lt;P&gt;Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataBasics.DataSources.Add(New SqlDataSourceItem("", "MyConnectionSTring"))&lt;BR&gt;End Sub</description><pubDate>Fri, 21 Apr 2006 10:34:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost873.aspx</link><description>Ah...so does this code go into each web method? AFAIK, there's no startup code for webservices. Is that correct?</description><pubDate>Thu, 20 Apr 2006 18:14:58 GMT</pubDate><dc:creator>Kevin Lingofelter</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost871.aspx</link><description>There is no such thing as an "elementary" question ;).&amp;nbsp; In the case of a WebService, there is really no need to use the StrataFrame Connection Manager and wizard.&amp;nbsp; Since this will reside in a static location, it will behave more like a website than a windows application.&lt;/P&gt;&lt;P&gt;You can define your connection strings manually by adding the following code:&lt;/P&gt;&lt;FONT color=#008000 size=2&gt;&lt;P&gt;'------------------------------------&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;' Setting the data sources manually&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'------------------------------------&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'-- SQL Server&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;DataLayer.DataSources.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; SqlDataSourceItem(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"myconnectionstring"&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'-- Oracle&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;DataLayer.DataSources.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; OracleDataSourceItem(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"myconnectionstring"&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'-- Microsoft Access&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;DataLayer.DataSources.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; AccessDataSourceItem(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"myconnectionstring"&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;'-- Visual Fox Pro&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;DataLayer.DataSources.Add(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; VfpDataSourceItem(&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;"myconnectionstring"&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Let me know if this answers your question.&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 20 Apr 2006 17:47:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost867.aspx</link><description>Sounds good. Can you give me a pointer or two on wiring webservices to the BO? How does the connection string management work? Sorry, I know these are pretty elementry questions.&lt;/P&gt;&lt;P&gt;Kevin</description><pubDate>Thu, 20 Apr 2006 16:54:55 GMT</pubDate><dc:creator>Kevin Lingofelter</dc:creator></item><item><title>RE: Webservices</title><link>http://forum.strataframe.net/FindPost865.aspx</link><description>Kevin,&lt;/P&gt;&lt;P&gt;StrataFrame can definitly be used within web services and has functionality to serialize and de-serialize business objects.&amp;nbsp; We have several users that have create webservices projects with StrataFrame. As for whether it is a good fit for your project, I don't know.&amp;nbsp; It depends on what you are trying to accomplish.&amp;nbsp; If you want your WinForms and WebForms application to be a central point of communication, then this might be a way to go.&amp;nbsp; The only time you really need to do this (for WinForms) is when you are going to have a connection at a remote location and will not have a VPN between to two locations.&amp;nbsp; Otherwise, it is usually better to just point the WinForms application to the remote location with your connection string.&lt;/P&gt;&lt;P&gt;BTW, I haven't forgotten about you and your Access View issue.&amp;nbsp; We are working on getting out the 1.4 build, so I appologize for any delays.</description><pubDate>Thu, 20 Apr 2006 16:26:31 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>