silverlight service cross domain error
I type my wcf (svc) service name in browser and the following is displayed: Meta开发者_Python百科data publishing for this service is currently disabled. .... ....
my service address: http://www.farasanjtelemetry.com/service1.svc
but when I run my test SL app (which calls this service) I get cross domain error, what's going wrong? binding? end point? cross domain files? I've copied two XML files in my server C:\inetpub\wwwroot and also beside my service1.svc, what should I check more? my test SL app address: http://www.farasanjtelemetry.com/SLServiceTestTestPage.html
what should I do now?
Check your ServiceReferences.ClientConfig, you didn´t update your endpoint address. The silverlight app is searching the service at
<endpoint address="http://localhost:80/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicEndpoint" contract="ServiceReference1.Service1"
name="CustomBinding_Service1" />
Correct it and you should be fine.
BTW: Check your acceptance rate, otherwise it might prevent other users from helping you in the future
Replace your ServiceReferences.ClientConfig with the following:
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_Service1">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://www.farasanjtelemetry.com/service1.svc" binding="basicHttpBinding"
contract="ServiceReference1.Service1" name="ServiceReference1.Service1" />
</client>
</system.serviceModel>
Than your app will work, given you can reach http://www.farasanjtelemetry.com/service1.svc from your machine.
精彩评论