[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

WCF Project Client missing one method

I have created a WCF project and everything appears to work fine, at least for the most part.  All of the methods work fine and appear in the client so I can run them and test them just fine.  The issue that I am having is there is one method that I am trying to pull which is a delete method by a id and it won't appear in my list of methods for the client.  How do I resolve this issue?

public OfficeMaps DeleteMapLocationByMapID(int mapid)
        {
            OfficeMaps map = new OfficeMaps();

            SqlConnection connection = new SqlConnection();
            DataSet dataset = new DataSet();
            SqlDataAdapter adapter = new SqlDataAdapter();

            SqlCommand command = new SqlCommand("SP_DeleteMapByID");
            command.CommandType = CommandType.StoredProcedure;

            map.MapId = mapid;

            connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MapSite"].ToString();
            connection.Open();
            command.Connection = connection;

            command.Parameters.Add(new SqlParameter("@MapId", map.MapId));

            command.ExecuteReader();

            return map;
        }

Open in new window

0
VBBRett
Asked:
VBBRett
1 Solution
 
Vel EousResearch & Development ManagerCommented:
Have you declared that your DeleteMapLocationByMapID is accessible to the client using the OperationContractAttribute?

http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.aspx

Any operations/methods which are not decorated with this attribute will not be consumable via the client, regardless of their access modifier.

If you have added a manual reference to your service in your client (via references) then just check it is up to date.

If you are using a proxy, do the same and possibly make use of the svcutil program to generate the proxy on your behalf.

http://msdn.microsoft.com/en-us/library/aa347733(v=vs.100).aspx
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now