WCF/WF - WCF access problem from silverlight - Asked By Vipul Patel on 15-Jan-11 01:17 AM


please urgent help required,

below is my WCF Servicemodel. If i put blank address in endpoint, i am able to fetch data with wcf from silverlight application locally, not from remote pc.

and in below configuration i am not able to connect locally as well as remotely. i got "The remote server returned an error: NotFound."

i used ServiceModelReg.exe also to register with my IIS

please help....

<system.serviceModel>

<services>

<service name="DBUtilitiesService.DBUtilities" behaviorConfiguration="DBUtilitiesService.DBUtilitiesBehavior">

<!-- Service Endpoints -->

<endpoint address="http://192.168.102.34/DBUtilitiesService" binding="basicHttpBinding" contract="DBUtilitiesService.IDBUtilities">

<!--

Upon deployment, the following identity element should be removed or replaced to reflect the

identity under which the deployed service runs. If removed, WCF will infer an appropriate identity

automatically.

-->

</endpoint>

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

</service>

</services>

<behaviors>

<serviceBehaviors>

<behavior name="DBUtilitiesService.DBUtilitiesBehavior">

<!-- 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>


servicereference.clientconfig file

<configuration>

<system.serviceModel>

<bindings>

<basicHttpBinding>

<binding name="BasicHttpBinding_IDBUtilities" maxBufferSize="2147483647"

maxReceivedMessageSize="2147483647">

<security mode="None" />

</binding>

</basicHttpBinding>

</bindings>

<client>

<endpoint address=http://192.168.102.34/DBUtilitiesService

binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDBUtilities"

contract="DBUtilitiesReference.IDBUtilities" name="BasicHttpBinding_IDBUtilities" />

</client>

</system.serviceModel>

</configuration>



waiting for reply.............................

ClientAccessPolicy.xml - Robbe Morris replied to Vipul Patel on 15-Jan-11 11:48 AM

Leave the address in the endpoint blank.  I believe your real issue is that you probably don't have a ClientAccessPolicy.xml file or you are missing entries in it.
Vipul Patel replied to Vipul Patel on 17-Jan-11 12:05 AM

Thanks for your reply.

but if i leave address blank i am not able to access through remote pc,

and i have clientaccesspolicy.xml file as below.

<?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 path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>

again thanks for reply.....

Venkatesh Vijayaraghyavan replied to Vipul Patel on 18-Jan-11 04:50 AM
Hi,
this file should be placed in the root.
Can you verify that

thanks,
Venki
Vipul Patel replied to Venkatesh Vijayaraghyavan on 20-Jan-11 12:36 AM

thanks for reply........

after lots of frustration i put this file (client access and cross domain) everywhere............means in root.......... in wcf service directory..........in silverlight app.......

but nothing happened..........