web-servicesumbracoumbraco5

how to call a webservice in umbraco


I am having an URL like this I need to call this URL from umbraco CMS thia URL is my webservice

eg
http://www.mydomain.com/webservices/MyWebservice.asmx/MyFunction

But this webservice should only be called through a .net user control after executing some statements can anyone share your ideas or link with me


Solution

  • Following are the steps....

    1) Create a visual studio project Say ServiceClient.

    2) Create at user control say ServiceAgnet.ascx.

    3) Add a SErvice reference to http://www.mydomain.com/webservices/MyWebservice.asmx/MyFunction

    4) Use the service in ServiceAgnet.ascx

    5) Publish the code.

    6) Put the ASCX in umbraco user control directory.

    7) Put the DLL in Bin folder of Umbraco installation.

    7) Create a macro using above User Control.

    8) Put the macro on page and you can see the websvice being used.

    9) Most Important Put the service refernce secion in web.config form you Visual studio project to Umbraco web.config unless it fails.

    Hope above helps.