Consuming Web Service from WCF -


i have created wcf service, wcf service has call web service. doing adding service reference of web service in wcf , calling method of web service want use.

just example shown below :

calcwebreference.calculatorsoapclient fct =      new calcwebreference.calculatorsoapclient(); int rq = fct.add(q, r);  return rq; 

now method when tried call client giving following error

the server unable process request due internal error. more information error, either turn on includeexceptiondetailinfaults (either servicebehaviorattribute or configuration behavior) on server in order send exception information client, or turn on tracing per microsoft .net framework 3.0 sdk documentation , inspect server trace logs.

thanks did u told getting following error "could not find default endpoint element references contract 'calcwebreference.calculatorsoap' in servicemodel client configuration section. might because no configuration file found application, or because no endpoint element matching contract found in client element."

now need give end points in wcf service or in web service function web service , if how give it.

please help.

hi,

calcwebreference.calculatorsoapclient reffering web service not wcf. given below code written in wcf(sample code) calling web service :-

calcwebreference.calculatorsoapclient fct = new calcwebreference.calculatorsoapclient();              int rq = fct.add(12, 10);              return rq; 

am not putting syntax right or there additional thing need in this?

this generic wcf "something bad happened" error message. won't help.

approaches:

  • make sure web service you're calling works on own - otherwise fix it!

  • enable detailed error information, described in error message, including error details in wcf service (do in dev environments only! never in production...)

  • try launch wcf service inside visual studio , debug what's happening

in order enable detailed error reporting, need add section wcf service's configuration:

<behaviors>     <servicebehaviors>         <behavior name="debugbehavior">             <servicedebug includeexceptiondetailinfaults="true" />         </behavior>     </servicebehaviors> </behaviors> 

you might have service behavior configured - in case, add <servicedebug> tag service behavior.

if don't have service config yet - you'll need make sure service uses service config:

<service name="yourservicenamehere"           behaviorconfiguration="debugbehavior"> 

make sure have behaviorconfiguration= attribute on <service> tag, , make sure reference defined service behavior (by specifying <behavior name="..." > property).

once you've done that, error should give more information - should .innerexception on exception should point in right direction.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -