StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
Webservice with a business object
Webservice with a business object
Post Reply
Like
2
Webservice with a business object
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Ross L Rooker, Sr.(1)
Ross L Rooker, Sr.(1)
posted 11 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 50,
Visits: 163
Does someone have a sample of using a business object in a webservice?
Reply
Like
2
Reply
Trent Taylor
Trent Taylor
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
Ross:
It isn't going to be any different using the BO in a web service. The only difference is that you will want to setup your data sources in the global.asax
Make sure that you have a global.asax in your web service project, if not, you can just add one through the "Add New Item"
Next, you will want to define your data sources when the application starts up. The global.asax will have a method called "Application_Start", add your data sources there:
Now you are ready to use your BOs in your project. First, make sure that you have a reference to the assembly that houses your business objects. You can do this in a Web Service project or JSON, either one. If this is your first go around, you may want to use a web service to get your feet wet. If this isn't going to be really high traffic, then the web service will be fine. JSON is lighter weight, but there is also more wiring required.
Note:
You can also just create a web handler which can be even lighter weight than JSON. I have used web handlers for things like activation servers and really high traffic servers. I create my own EDI format and then serialize it back and forth between the client and server, and you can't get any lighter since I am 100% in control of every byte being transmitted.
Create a new web service (MyWebservice.asmx). Then create a web method and use your BO:
[WebMethod]
public string MyTestWebMethod()
{
using(MyBO bo = new MyBO())
{
bo.FillWithWhatever();
//-- Do whatever you need to do
//-- Return the results
return bo.MyFullName;
}
}
Reply
Like
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
Webservice with a business object
Ross L Rooker, Sr.(1)
-
11 Years Ago
Hello I can help you in the webservice , what kind of sample , are...
Tony Charpentier
-
11 Years Ago
Ross: It isn't going to be any different using the BO in a web...
Trent L. Taylor
-
11 Years Ago
Thanks Trent. Worked like a charm.
Ross L Rooker, Sr.(1)
-
11 Years Ago
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search