Results 1 to 2 of 2

Thread: wcf error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2007
    Posts
    694

    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>

  2. #2
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: wcf error

    The not-found error implies the your URL is not correct. I can see that you have no adress in the web.config, that is, I think, part of the probem:
    vb Code:
    1. <endpoint address="" [B]<--- MISSING[/B]
    2. binding="basicHttpBinding"
    3. contract="Samples.Services.IProductService">
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width