hi,i'm developing an app for wp7 which uses a service on my web app.the problem is ,it was working well till this morning i keep receiving the following error (from both actual host and local host) in my wp7 app:
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
As sukumarraju suggested, you can turn on the "includeExceptionDetailsInFaults" option so that WCF service side will return full error information. And for testing, you can build a console client to call your WCF services so as to ensure the service itself
is working(isolate the issue to wp7 client).
Also, if you're running the WP7 app through emulator on local machine, you can also try using fiddler to capture the HTTP traffice between client and the service to see if there is any error information in the HTTP messages:
BTW, it seems you're using SOAP XML based WCF service(via basicHttpBinding) for the windows phone client. If there is no particular requirments on SOAP/XML, you can consider change your WCF service to RESTful style which is more convenient for windows phone
or other mobile clients to invoke. Here are some information on building REST style WCF service and consume it in WP7 client:
changing "includeExceptionDetailsInFaults" ended to an empty error..but after next try,it was working!i suspect there might be sth wrong with the web service..though it's workinjg now,i'm thinking how to handle this error?i mean where should i catch it?
So if the problem occurs randomly without fixed pattern. Then, you can consider enablinng the WCF tracing to log potential error/exceptions during WCF processing time:
BTw, such kind of settings like "includeExceptionDetailsInFaults" and the tracing & logging is for debug time usage. for production deployment, you should always turn off them for performance purpose.
WCF tracing to log potential error/exceptions during WCF processing time:
Hi Steven,
Can you confirm whether tracing logs exceptiosn to log file? During recent WCF RESTFul service debugging processing enabling tracing hasn't logged any exceptions to log file.
arasx
0 Points
2 Posts
the problem with endpoints
Apr 15, 2012 05:57 AM|LINK
hi,i'm developing an app for wp7 which uses a service on my web app.the problem is ,it was working well till this morning i keep receiving the following error (from both actual host and local host) in my wp7 app:
There was no endpoint listening at http://localhost:3840/locafile_ws_v1.0/Service.svc/Service.svc?wsdl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.i
i refreshed the web reference in my app ,it didnt help.the thing that makes me wondering is that i didn't change anything in web app at all..
i searched and found couple of things,showing that mostly it's related to the "webconfig" file..
could anybody please help me out with correcting this webconfig :
<?xml version="1.0"?>
<configuration>
<!--<system.web>
<compilation debug="true" targetFramework="3.0">
<assemblies>
<add assembly="System.Device, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>-->
<system.serviceModel>
<services>
<service name="Service" behaviorConfiguration="ServiceBehaviors">
<endpoint name="Endpoint"
address=""
binding="basicHttpBinding"
contract="IService" />
<endpoint kind="udpDiscoveryEndpoint" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviors">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceDiscovery />
</behavior>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
sukumarraju
All-Star
16971 Points
2999 Posts
Re: the problem with endpoints
Apr 15, 2012 11:43 PM|LINK
Make sure that the web service is running on the server.
Enable includeExceptionDetailInFaults="true" as explained at http://msdn.microsoft.com/en-us/library/ff649234.aspx
Application Architecture Guide 2.0
My Blog
Twitter
Steven Cheng...
Contributor
4199 Points
548 Posts
Microsoft
Moderator
Re: the problem with endpoints
Apr 17, 2012 03:19 AM|LINK
Hi arasx,
As sukumarraju suggested, you can turn on the "includeExceptionDetailsInFaults" option so that WCF service side will return full error information. And for testing, you can build a console client to call your WCF services so as to ensure the service itself is working(isolate the issue to wp7 client).
Also, if you're running the WP7 app through emulator on local machine, you can also try using fiddler to capture the HTTP traffice between client and the service to see if there is any error information in the HTTP messages:
http://www.fiddler2.com/fiddler2/
BTW, it seems you're using SOAP XML based WCF service(via basicHttpBinding) for the windows phone client. If there is no particular requirments on SOAP/XML, you can consider change your WCF service to RESTful style which is more convenient for windows phone or other mobile clients to invoke. Here are some information on building REST style WCF service and consume it in WP7 client:
#An Introduction To RESTful Services With WCF
http://msdn.microsoft.com/en-us/magazine/dd315413.aspx
#WCF Web HTTP Programming Model Overview
http://msdn.microsoft.com/en-us/library/bb412172.aspx
#Consuming WCF 4.0 REST Service in Windows Phone 7
http://www.dotnetcurry.com/ShowArticle.aspx?ID=501
#WCF Rest Services for Windows Phone
http://ganshani.com/2011/08/14/wcf-rest-services-for-windows-phone-2/
Feedback to us
Microsoft One Code Framework
arasx
0 Points
2 Posts
Re: the problem with endpoints
Apr 18, 2012 01:17 AM|LINK
changing "includeExceptionDetailsInFaults" ended to an empty error..but after next try,it was working!i suspect there might be sth wrong with the web service..though it's workinjg now,i'm thinking how to handle this error?i mean where should i catch it?
Steven Cheng...
Contributor
4199 Points
548 Posts
Microsoft
Moderator
Re: the problem with endpoints
Apr 18, 2012 02:14 AM|LINK
Thanks for reply arasx,
So if the problem occurs randomly without fixed pattern. Then, you can consider enablinng the WCF tracing to log potential error/exceptions during WCF processing time:
#Service Trace Viewer Tool (SvcTraceViewer.exe)
http://msdn.microsoft.com/en-us/library/ms732023.aspx
BTw, such kind of settings like "includeExceptionDetailsInFaults" and the tracing & logging is for debug time usage. for production deployment, you should always turn off them for performance purpose.
Feedback to us
Microsoft One Code Framework
sukumarraju
All-Star
16971 Points
2999 Posts
Re: the problem with endpoints
Apr 19, 2012 08:42 AM|LINK
Hi Steven,
Can you confirm whether tracing logs exceptiosn to log file? During recent WCF RESTFul service debugging processing enabling tracing hasn't logged any exceptions to log file.
Thanks
EDIT: It is required to set 'switchValue' setting as explained at http://msdn.microsoft.com/en-us/library/ms732023.aspx
Application Architecture Guide 2.0
My Blog
Twitter