Yes Steve you are right. Phlakie i would suggest you to read "Enterprise
Solution Patterns" available at msdn.com/patterns web site. Following are a
couple of resources that should help you out with your design and
imeplementation.
Facade Pattern:
http://en.wikipedia.org/wiki/Facade_pattern
Web Service Facade Solution
http://msdn.microsoft.com/library/de...eLegacyApp.asp
best regards,
Hammad
"Steve" wrote:
[color=blue]
> I believe what Hammad means is that you create a class library for example,
> with all of your business logic in it, reference this in your web service and
> make the calls through it.
>
> So you'd have something like this in your WS...
>
> ..............................................
> private MyBusinessComponent oBusiness ;
>
> public MyWebService
> {
> oBusiness = new MyBusinessComponent() ;
> }
>
> [WebMethod]
> public bool SaveBusinessObject(object oObject)
> {
> oBusiness.SaveBusinessObject(oObject) ;
> }
> ..............................................
>
> rather than...
>
> ..............................................
> private MyBusinessComponent oBusiness ;
>
> public MyWebService
> {
> }
>
> [WebMethod]
> public bool SaveBusinessObject(object oObject)
> {
> ValidateObject() ;
> MySQLCommand.Execute(sqlString) ;
> }
> ..............................................
>
> "phlakie" wrote:
>[color=green]
> > Thanks so much for your help. Taking up your side note. Can you explain
> > better what you mean using web methods as facade over my business logic. I'm
> > new to both web services and enterprise application programming. Thanx.
> >
> > "Hammad Rajjoub" wrote:
> >[color=darkred]
> > > Hello,
> > >
> > > You should use Exception handling to cater this scenario.
> > >
> > > On a side not i would suggest you not to write your business logic (stored
> > > proc calls etc) in ur web method. Rather use web methods as facade over your
> > > business logic.
> > >
> > > regards,
> > > "phlakie" wrote:
> > >
> > > > I made a call to a stored procedure in a web method. The stored procedure
> > > > either returns an error or an integer. How do I catch this error in the web
> > > > method? Thanks.[/color][/color][/color]