i have created a custom web service in sharepoint which works fine, i am trying to use this web service in a user control but get missing assembly reference error, i have copied the webservice dll in GAC and done safe control entry, i have not done this before, please help me.
|
UPDATED (In light of comments) You just change the inherits parameter of your @ Control directive to point to a custom class (which inherits from UserControl) then delete the designer file and the class that VS added for you. You will lose the link between code behind and design view though so you will need to make Protected WithEvents variables for all your controls. Other than that you should be able to continue using your user controls and add a web reference as per any other VS project. Same technique as AC uses for Pages here: http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx ORIGINAL ANSWER Am I right in thinking that you just want to add a reference to a web service in Visual Studio? Assuming your using Visual Studio 2008 then either right click your project and click on 'Add Web Reference' or if this is not visible then click on 'Add Service Reference' then click 'Advanced' then 'Add Web Reference'. You will then get the 'Add Web Reference' dialog which will allow you to enter the URL to your web service. Clicking 'Add Reference' from here will then create a proxy class for the service in your project. You can then use this to call the service from your user control. More info can be found here: http://msdn.microsoft.com/en-us/library/d9w023sx.aspx |
|||||||||
|
|
You should use WSPBuilder to generate a project with a webservice.
|
|||||||
|