I’ve created a test WP7 app, which consumes a WCF to get some sample data
I added the service as a service reference, and the classes where generated. In the app, I call the service :
var service = new TestService.TestServiceClient();
service.GetDataCompleted += new EventHandler<TestService.GetDataCompletedEventArgs>(service_GetDataCompleted);
service.GetDataAsync(new TestService.GetDataRequest());
in the callback from the service call, i get the following exception :
There was no endpoint listening at
http://localhost:8219/TestService.svc
that could accept the message. This is
often caused by an incorrect address
or SOAP action. See InnerException, if
present, for more details.
The inner exception says :
The remote server returned an error:
NotFound.
When debugging, the cassini dev server starts up. I can access the svc from internet explorer with no problem, see the wsdl, etc
Generated config file by Visual Studio :
<?xml version="1.0" encoding="utf-8"?>
<configurationSnapshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:xml-wcfconfigurationsnapshot">
<behaviors />
<bindings>
<binding digest="System.ServiceModel.Configuration.BasicHttpBindingElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089:<?xml version="1.0" encoding="utf-16"?><Data maxBufferSize="2147483647" name="BasicHttpBinding_ITestService"><security mode="None" /></Data>" bindingType="basicHttpBinding" name="BasicHttpBinding_ITestService" />
</bindings>
<endpoints>
<endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost:8219/TestService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestService" contract="TestService.ITestService" name="BasicHttpBinding_ITestService" />" digest="<?xml version="1.0" encoding="utf-16"?><Data address="http://localhost:8219/TestService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITestService" contract="TestService.ITestService" name="BasicHttpBinding_ITestService" />" contractName="TestService.ITestService" name="BasicHttpBinding_ITestService" />
</endpoints>
</configurationSnapshot>
Any ideas??
Well, this is one of the times when you lose a lot of time, because the error message points you to nowhere near the solution.
To fix this problem, it was a combination of this and regenerating the service reference. I know it’s not a good answer, but that’s what was actually happening