|
-
Nov 24th, 2010, 06:31 PM
#1
Thread Starter
Fanatic Member
wcf error
Hi,
I have been battliing with an issue with wcf and wonder if anyone can solve my issue.
Many thanks
In a silverlight apllication, I created a wcf service under the host i.e. (projectname.web) project. Then from the silverlight application which holds all the .xaml pages, I reference the wcf and all works fine (The wcf is calle dfrom the .xaml and data is retrieved).
Problem is arised only when I try to separate the wcf service from the webhost i.e. (projectname.web). So I created a separate wcf service application project and then tried to call the service from the .xaml project.
The error I get is in references.cs
The error message is: The remote server returned an error: NotFound.
and the code which causes the error is:
public Samples.ProductServiceHost.Product EndGetProduct(System.IAsyncResult result) {
object[] _args = new object[0];
Samples.ProductServiceHost.Product _result = ((Samples.ProductServiceHost.Product)(base.EndInvoke("GetProduct", _args, result)));
return _result;
}
I have also added the crossdomain.xml to the wcf service application project.
I wonder if the error is to do with the web.config.
This is what the web.config looks like in the wcf service application:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="Samples.Services.ServiceBehavior"
name="Samples.Services.ProductService">
<endpoint address=""
binding="basicHttpBinding"
contract="Samples.Services.IProductService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Samples.Services.ServiceBehavior">
<!-- 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>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|