简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM