New Posts New Posts RSS Feed: Extend Webservice class???
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Extend Webservice class???

 Post Reply Post Reply
Author
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Topic: Extend Webservice class???
    Posted: 21-May-2009 at 7:29am
Is there a way to add to the Webservice class? I tried creating another partial class but the methods I added do not show up in the webservice.
 
I am trying to add custom methods. These methods do not return Model entities they return DynamicEntities.
 
As of right now I have to add my methods back in everytime I save the Object Mapper.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jun-2009 at 8:25am

Got to love the quick reply. IdeaBlade come on.

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jun-2009 at 2:36pm
We apologize.  Sometimes posts slip through unnoticed.  When you need immediate help with a problem email support@ideablade.com directly.
 
You can extend the WebService partial class, and be sure to decorate the methods with the [WebMethod] attribute so that the methods are visible.  The Web Service Publishing sample application in the 300 Advanced Series of the Instructional Units contains a sample web service with additional web methods in a partial class.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jun-2009 at 8:21am
I have tried that but the class methods are not visible in the partial class.
 
ExecuteQuery is not accessable. In the example it uses ExecuteIEntityQuery which is also not accessable.
 
My Extended Webservice:

using System;

using System.Web.Services;

using System.Web.Services.Protocols;

using IdeaBlade.Persistence;

using IdeaBlade.Persistence.WS;

using IdeaBlade.Util;

 

namespace LOC.CEMS.Model

{

    public partial class Webservice

    {

 

        [WebMethod]

        [SoapHeader("SecurityHeader", Direction = SoapHeaderDirection.InOut)]

        public System.Data.DataSet GetQueryResults(IdeaBlade.Persistence.WS.Query pQueryForQueryId, params object[] args)

        {

            Query[] mResults = ExecuteQuery<Query>(pQueryForQueryId, string.Empty);

            …..

        }

    }

}

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jun-2009 at 10:10am
Is "Webservice" the name of the auto-generated class also?  (Note that the s is lowercase in your class.)  Is the auto-generated class also in the LOC.CEMS.Model namespace?  In order to "extend" the auto-generated class, the fully-qualified type name must be the same, otherwise the compiler generates a new class altogether, which sounds like what you're seeing.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jun-2009 at 10:15am
I looked over that 50 times atleast and still didn't catch it until I went to copy and paste to show you that I had it the same. Need to get my brain - eye communication checked.
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down