﻿<?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?)  » Webservice with a business object</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 22 May 2026 12:01:29 GMT</lastBuildDate><ttl>20</ttl><item><title>Webservice with a business object</title><link>http://forum.strataframe.net/FindPost32346.aspx</link><description>Does someone have a sample of using a business object in a webservice?</description><pubDate>Mon, 06 Jan 2014 09:03:22 GMT</pubDate><dc:creator>Ross L Rooker, Sr.(1)</dc:creator></item><item><title>RE: Webservice with a business object</title><link>http://forum.strataframe.net/FindPost32357.aspx</link><description>Thanks Trent. Worked like a charm.</description><pubDate>Mon, 06 Jan 2014 09:03:22 GMT</pubDate><dc:creator>Ross L Rooker, Sr.(1)</dc:creator></item><item><title>RE: Webservice with a business object</title><link>http://forum.strataframe.net/FindPost32356.aspx</link><description>Ross:&lt;br/&gt;&lt;br/&gt;It isn't going to be any different using the BO in a web service.&amp;nbsp; The only difference is that you will want to setup your data sources in the global.asax&lt;br/&gt;&lt;br/&gt;&lt;ol&gt;&lt;li&gt;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"&lt;br/&gt;&lt;br/&gt;&lt;img src="http://forum.strataframe.net/Uploads/Images/70d5d71e-4d25-4a6f-9836-972a.png" alt="http://forum.strataframe.net/Uploads/Images/70d5d71e-4d25-4a6f-9836-972a.png" /&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Next, you will want to define your data sources when the application starts up.&amp;nbsp; The global.asax will have a method called "Application_Start", add your data sources there:&lt;br/&gt;&lt;br/&gt;&lt;img src="http://forum.strataframe.net/Uploads/Images/1a8bd454-8c9e-4429-8055-b17c.png" alt="http://forum.strataframe.net/Uploads/Images/1a8bd454-8c9e-4429-8055-b17c.png" /&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Now you are ready to use your BOs in your project.&amp;nbsp; First, make sure that you have a reference to the assembly that houses your business objects.&amp;nbsp; You can do this in a Web Service project or JSON, either one.&amp;nbsp; If this is your first go around, you may want to use a web service to get your feet wet.&amp;nbsp; If this isn't going to be really high traffic, then the web service will be fine.&amp;nbsp; JSON is lighter weight, but there is also more wiring required.&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[codesnippet]&lt;strong&gt;Note:&lt;/strong&gt; You can also just create a web handler which can be even lighter weight than JSON.&amp;nbsp; I have used web handlers for things like activation servers and really high traffic servers.&amp;nbsp; 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.[/codesnippet]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;Create a new web service (MyWebservice.asmx).&amp;nbsp; Then create a web method and use your BO:&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[codesnippet]&lt;br/&gt;&lt;br/&gt;[WebMethod]&lt;br/&gt;public string MyTestWebMethod()&lt;br/&gt;{&lt;br/&gt;&amp;nbsp; using(MyBO bo = new MyBO())&lt;br/&gt;&amp;nbsp; {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bo.FillWithWhatever();&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Do whatever you need to do&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Return the results&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return bo.MyFullName;&lt;br/&gt;&amp;nbsp; }&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;[/codesnippet]&lt;/span&gt;&lt;br/&gt;&lt;/li&gt;&lt;/ol&gt;</description><pubDate>Fri, 03 Jan 2014 14:57:42 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Webservice with a business object</title><link>http://forum.strataframe.net/FindPost32355.aspx</link><description>Hello&lt;br/&gt;&lt;br/&gt;I can help you in the webservice ,&lt;br/&gt;&lt;br/&gt;what kind of sample , are you waiting ?&amp;nbsp;&amp;nbsp; a dataset serialize or a simple value&amp;nbsp; ?&lt;br/&gt;&lt;br/&gt;ps : i prefer a json service rest instead of webservice, cause json is more light than xml format, in large data case.</description><pubDate>Fri, 03 Jan 2014 12:10:15 GMT</pubDate><dc:creator>Tony Charpentier</dc:creator></item></channel></rss>