Answer the question
In order to leave comments, you need to log in
Silverlight + WCF: hosting settings?
Hello colleagues!
I'm looking for advice on configuring IIS for a Silverlight application using WCF.
If you run the project in Visual Studio for debugging, then everything works. As you know, VS runs IIS Express for this purpose. And, if you look, the Silverlight application uses the address locahost:39408, and WCF - locahost:39429:
Now you need to publish the site on the local network. I create a new site on the server in IIS, specify the path to the folder with the Silverlight application, bind it to a free port. The site is working, but Silverlight can't find where the web service is now located. Error message (from chrome console):
POST localhost :39429/Service2.svc
Uncaught Error: 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 SilverlightApplication1.ServiceReference1.NumberRowAtLinesCompletedEventArgs.get_Result
(
)
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_Service2">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</ bindings>
<client>
<endpoint address=" localhost :39429/Service2.svc" binding="customBinding"
bindingConfiguration="CustomBinding_Service2" contract="ServiceReference1.Service2"
name="CustomBinding_Service2" />
</client>
</system.serviceModel>
</configuration>
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_Service2">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</ bindings>
<client>
<endpoint address=" myserver :8088/Service2.svc" binding="customBinding"
bindingConfiguration="CustomBinding_Service2" contract="ServiceReference1.Service2"
name="CustomBinding_Service2" />
</client>
</system.serviceModel>
</configuration>
Answer the question
In order to leave comments, you need to log in
All found!
On the WCF side, web.config has this entry:
< service name = "WcfService1.Service2" >
< endpoint address = " myserver :8088/Service2.svc" binding = "customBinding" bindingConfiguration = "WcfService1.Service2.customBinding0" contract = "WcfService1.Service2" / >
< endpoint address = "mex" binding = "mexHttpBinding" contract = "IMetadataExchange" / >
< / service >
< service name = "WcfService1.Service2" >
< endpoint address = "" binding = "customBinding" bindingConfiguration = "WcfService1.Service2.customBinding0" contract = "WcfService1.Service2" / >
< endpoint address = "mex" binding = "mexHttpBinding " contract = "IMetadataExchange" / >
< / service >
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question