Webservices


Author
Message
Kevin Lingofelter
Kevin Lingofelter
StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)
Group: Forum Members
Posts: 77, Visits: 804
Hello,

I have a BO project to ecapsulate all the data access.

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).

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.

Thanks!

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Kevin,

StrataFrame can definitly be used within web services and has functionality to serialize and de-serialize business objects.  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.  It depends on what you are trying to accomplish.  If you want your WinForms and WebForms application to be a central point of communication, then this might be a way to go.  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.  Otherwise, it is usually better to just point the WinForms application to the remote location with your connection string.

BTW, I haven't forgotten about you and your Access View issue.  We are working on getting out the 1.4 build, so I appologize for any delays.

Kevin Lingofelter
Kevin Lingofelter
StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)
Group: Forum Members
Posts: 77, Visits: 804
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.

Kevin

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
There is no such thing as an "elementary" question Wink.  In the case of a WebService, there is really no need to use the StrataFrame Connection Manager and wizard.  Since this will reside in a static location, it will behave more like a website than a windows application.

You can define your connection strings manually by adding the following code:

'------------------------------------
' Setting the data sources manually
'------------------------------------

'-- SQL Server
DataLayer.DataSources.Add(New SqlDataSourceItem("", "myconnectionstring"))

'-- Oracle
DataLayer.DataSources.Add(New OracleDataSourceItem("", "myconnectionstring"))

'-- Microsoft Access
DataLayer.DataSources.Add(New AccessDataSourceItem("", "myconnectionstring"))

'-- Visual Fox Pro
DataLayer.DataSources.Add(New VfpDataSourceItem("", "myconnectionstring"))

Let me know if this answers your question.


Kevin Lingofelter
Kevin Lingofelter
StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)
Group: Forum Members
Posts: 77, Visits: 804
Ah...so does this code go into each web method? AFAIK, there's no startup code for webservices. Is that correct?
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You can do this, but you do not need to add the connection everytime.  The DataSources are a shared and a webserive runs in an application pool like a website.  So you do not need to add teh data connection each time.  One thing you can do if you are going to use a WebMethod is to just check on the count of the DataSources collection.  If it is 0, then add the connection.  Otherwise, leave it alone because it has already been setup.

<WebMethod()> _
    Public Function SampleMethod() As String
        '-- Determine if the connection has been established
        If MicroFour.StrataFrame.Data.DataBasics.DataSources.Count = 0 Then
            DataBasics.DataSources.Add(New SqlDataSourceItem("", "MyConnectionSTring"))
        End If

        Return "Whatever"
    End Function

- or - Tongue

Much Better Solution
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...

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
     DataBasics.DataSources.Add(New SqlDataSourceItem("", "MyConnectionSTring"))
End Sub

Kevin Lingofelter
Kevin Lingofelter
StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)StrataFrame Novice (123 reputation)
Group: Forum Members
Posts: 77, Visits: 804
Perfect! Thanks a million!

Kevin

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Glad to help!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search