Silverlight and WCF issue
-
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
-
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
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
-
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