SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have developed a custom asmx webservice and deployed successfully on my url and on browser ive checked and working perfect. Now I want to consume in my Visual WebParts code behind do this Ive added Service Reference..defined web reference also and include that web reference in using section. when I go to instantiate the webservice i cannot like when i type mProxy the intellisense does not show looks like object declaration has some problems. why is that

here is the code

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data;
using Microsoft.SharePoint;
using System.Collections.Generic;
using Microsoft.SharePoint.WebControls;
using S_Portal_WebParts.SPWebService;
namespace S_Portal_WebParts.NewPurchaseRequisition
    public partial class NewPurchaseRequisitionUserControl : UserControl
        SPWebService.OraSPDataXchange myProxy = new SPWebService.OraSPDataXchange();
share|improve this question

First check if intellisense shows up for other .NET classes. If not, you may need to restart the visual studio.

If still the problem is there, Try to build the proxy class using svcutil (and not service\web reference).You can manually add the generated proxy(.cs) and config files to your project. Below is the example :

svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service
share|improve this answer

Sometimes intellisense doesnt pick it up. Try:

Save and exit project. Goto folder and delete the bin files (debug and release) open project and rebuild. Try now.

Also when you were adding the webservice and clicked to discover what did you see? did you see your new method?

You can right click the webservice name OraSPDataXchange and select "Go to definition", check that it has you code. If not then rebuild the webservice and try again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.