Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WPF
  4. Silverlight and WCF issue

Silverlight and WCF issue

Scheduled Pinned Locked Moved WPF
helpwcfworkspacecsharpdatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CrazyCoder26
    wrote on last edited by
    #1

    Hi, I am new to Silverlight.I have created a simple silverlight application which uses a WCF dataservice to fetch some data from database.The WCF service is inside the application itself.The application runs fine in my development environment.But when I host the application in IIS,whenever the application tries to communicate with the WCF dataservice, it throws some error saying,"Unhandled error in silverlight application,An Exception occured during the operation,making the result invalid.Check inner exception details at System.ComponentModel.AsyncCompletedEventArgs.RaiseExecptionIfNecessary at SQLData.ServiceReference1.GetCustomerByTerrytoryEventArgs.get_Result() at ................................... The System.ServiceModel configuration is web.config is given below :

    <system.serviceModel>
    <behaviors>
    <serviceBehaviors>
    <behavior name="SQLData.Web.Service1Behavior">
    <serviceMetadata httpGetEnabled="true"/>
    <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    <services>
    <service behaviorConfiguration="SQLData.Web.Service1Behavior" name="SQLData.Web.Service1">
    <endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1">
    <identity>
    <dns value="localhost"/>
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    </service>
    </services>
    </system.serviceModel>

    I am totally confused....I searched the web...and applied everything they said....but still getting this error......Please help me solve this issue. CC26

    C 1 Reply Last reply
    0
    • C CrazyCoder26

      Hi, I am new to Silverlight.I have created a simple silverlight application which uses a WCF dataservice to fetch some data from database.The WCF service is inside the application itself.The application runs fine in my development environment.But when I host the application in IIS,whenever the application tries to communicate with the WCF dataservice, it throws some error saying,"Unhandled error in silverlight application,An Exception occured during the operation,making the result invalid.Check inner exception details at System.ComponentModel.AsyncCompletedEventArgs.RaiseExecptionIfNecessary at SQLData.ServiceReference1.GetCustomerByTerrytoryEventArgs.get_Result() at ................................... The System.ServiceModel configuration is web.config is given below :

      <system.serviceModel>
      <behaviors>
      <serviceBehaviors>
      <behavior name="SQLData.Web.Service1Behavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
      </behavior>
      </serviceBehaviors>
      </behaviors>
      <services>
      <service behaviorConfiguration="SQLData.Web.Service1Behavior" name="SQLData.Web.Service1">
      <endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1">
      <identity>
      <dns value="localhost"/>
      </identity>
      </endpoint>
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
      </services>
      </system.serviceModel>

      I am totally confused....I searched the web...and applied everything they said....but still getting this error......Please help me solve this issue. CC26

      C Offline
      C Offline
      CrazyCoder26
      wrote on last edited by
      #2

      Hi, I solved the issue myself..I solved it like this.. Since the wcf is hosted inside the application,so in ServiceReferences.ClientConfig file in Silverlight application I modified : <endpoint address="http://localhost:portno/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /> to <endpoint address="http://localhost/applicationName(Virtual directory name)/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /> and in web.config of my application I modified : <endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> to <endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1"> <identity> <dns value="localhost/appName(Virtual directory Name)"/> </identity> </endpoint> CC26

      A 1 Reply Last reply
      0
      • C CrazyCoder26

        Hi, I solved the issue myself..I solved it like this.. Since the wcf is hosted inside the application,so in ServiceReferences.ClientConfig file in Silverlight application I modified : <endpoint address="http://localhost:portno/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /> to <endpoint address="http://localhost/applicationName(Virtual directory name)/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /> and in web.config of my application I modified : <endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> to <endpoint address="" binding="basicHttpBinding" contract="SQLData.Web.IService1"> <identity> <dns value="localhost/appName(Virtual directory Name)"/> </identity> </endpoint> CC26

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        Thanks for posting the solution. You could however format it using PRE tags to make it more readable.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups