Web Service from WCF -


in project have call web service(.net) wcf service. getting runtime errors while doing same, please tell how achieve same can check, missing in approach.

hi,

the code in wcf looks this(sample code)

 public int addwcf(int a, int b)         {             proxy_http.calculatorsoapclient ad = new proxy_http.calculatorsoapclient("calculatorsoap");             int ab = ad.add(a,b);               return ab;         } 

the 1 in web service looks :-

public calculator () {          //uncomment following line if using designed components          //initializecomponent();      }     [webmethod(description = "this method can used add 2 integers", messagename = "addmethod")]     public int add(int num1, int num2)     {         return num1 + num2;     }      [webmethod(description = "this method can used subtract 2 integers", messagename = "subtractmethod")]     public int subtract(int num1, int num2)     {                     return num1 - num2;             }   

the error occurs in wcf part instance of web service created, following error given when

“could not find endpoint element name 'calculatorsoap' , contract 'proxy_http.calculatorsoap' in servicemodel client configuration section. might because no configuration file found application, or because no endpoint element matching name found in client element.”

the exception message suggests couldn't find endpoint in configuration file name calculatorsoap implementing contract proxy_http.calculatorsoapclient.

please check configuration file (web.config in case wcf service webhosted), whether has endpoint name calculatorsoap under <client> section of <system.servicemodel> implementing proxy_http.calculatorsoapclient.

please note names case-sensitive.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -