Click here to Skip to main content
16,015,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
After deployment, I can see the Silverlight control on ASP.Net page being loaded. But, my WCF service which is in my .Web application is not been found it seems. Here is my ServiceReference. ClientConfig file data…
XML
/**************************************

<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IServiceIncident" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="../ServiceIncident.svc"
          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServiceIncident"
          contract="ServiceReference1.IServiceIncident" name="BasicHttpBinding_IServiceIncident" />
    </client>
  </system.serviceModel>
</configuration>

/**************************************


And I am calling the Service client object in this way:
C#
ServiceReference1.ServiceIncidentClient Prp_WCFService
        {
            get
            {
                if (lObjWCFService == null)
                {
                    Uri lUri = new Uri(Application.Current.Host.Source, "../ServiceIncident.svc");
                    lObjWCFService = new ServiceReference1.ServiceIncidentClient("BasicHttpBinding_IServiceIncident", lUri.AbsoluteUri);

                }
                return lObjWCFService;
            }
        }



And my web.config is as follows…
XML
<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

/**************************************


Also, I have all the required MIME configured in my IIS.
Do I need to do anything here. Please help
Posted
Updated 7-Apr-11 20:30pm
v2
Comments
Wendelius 8-Apr-11 2:30am    
Readability edit
Sandeep Mewara 8-Apr-11 3:20am    
You getting any error? If so, what?
Sreenath Gv 8-Apr-11 3:22am    
It is not showing any data and ending up with some java script error as follows...
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Timestamp: Fri, 8 Apr 2011 07:21:04 UTC


Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at IncidentsPortal.ServiceReference1.mFnGetAllSharedServicesCompletedEventArgs.get_Result()
at IncidentsPortal.AddIncident.lWCFService_mFnGetAllSharedServicesCompleted(Object sender, mFnGetAllSharedServicesCompletedEventArgs e)
at IncidentsPortal.ServiceReference1.ServiceIncidentClient.OnmFnGetAllSharedServicesCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://10.97.132.69/IncPort/Incidents_Maintain.aspx?IncidentType=AddIncident


Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at IncidentsPortal.ServiceReference1.mFnGetApplicationsListCompletedEventArgs.get_Result()
at IncidentsPortal.AddIncident.lWCFService_mFnGetApplicationsListCompleted(Object sender, mFnGetApplicationsListCompletedEventArgs e)
at IncidentsPortal.ServiceReference1.ServiceIncidentClient.OnmFnGetApplicationsListCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://10.97.132.69/IncPort/Incidents_Maintain.aspx?IncidentType=AddIncident


Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at IncidentsPortal.ServiceReference1.mFnGetProgramsListCompletedEventArgs.get_Result()
at IncidentsPortal.AddIncident.lWCFService_mFnGetProgramsListCompleted(Object sender, mFnGetProgramsListCompletedEventArgs e)
at IncidentsPortal.ServiceReference1.ServiceIncidentClient.OnmFnGetProgramsListCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://10.97.132.69/IncPort/Incidents_Maintain.aspx?IncidentType=AddIncident

Hi,

I have never seen an endpoint being specified like "../blahblah.svc"
Try specifying the url on which your svc is being hosted, like:
http://localhost:8080/blahblah.svc

where 8080 can be replaced by your endpoint portnumber and blahblah.svc by your svc file.
 
Share this answer
 
Comments
Sreenath Gv 9-Apr-11 14:47pm    
oK...AND IF I have deployed my wcfservice on remote machine....then should I give that address.
Perry Bruins 9-Apr-11 17:05pm    
Checkout this url http://msdn.microsoft.com/en-us/library/ms733749.aspx
XML
Solved...

I have copied XMLs quoted below in wwwroot folder ...

clientAccessPolicy.xml

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>


and crossDomain.xml

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900