No i znowu się zaciąłem. Próbuję zrobić stronę w Sliverlight, która wykorzystywała by
webservice. Najpierw tworzę projekt w silverlight a potem dodaję website a do niej WCF service. Tworzę funkcję, dodaję Service reference do głównego projektu, i generalnie wszystko się kompiluje, jednak.
1). Zanim się skompiluje kompilator wyświetla: „This silverlight project you are about to debug is consuming web services. Calls to the web services will fail unless the project is excecuted in the context of the web wich contains the web service”
2). Kiedy odwołam się do funkcji w swoim web service program wywala się z następującym komunikatem:
„An error occurred while trying to make a request to URI 'http://localhost:3272/WebSite6/Service.svc'. This could be due to a cross domain configuration error. Please see the inner exception for more details. „
Tutaj zamieściłem spakowany projekt, gdyby ktoś chciał zajżeć do kodu:
http://neogaia.pl/asp/Testy_03.rar
Tu są detale błędu:
System.ServiceModel.CommunicationException was unhandled by user code
Message="An error occurred while trying to make a request to URI 'http://localhost:3272/WebSite6/Service.svc'. This could be due to a cross domain configuration error. Please see the inner exception for more details."
StackTrace:
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.ClientBase1.ChannelBase
1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
at Testy_03.ServiceReference1.ServiceClient.ServiceClientChannel.EndSaveString(IAsyncResult result)
at Testy_03.ServiceReference1.ServiceClient.Testy_03.ServiceReference1.IService.EndSaveString(IAsyncResult result)
at Testy_03.ServiceReference1.ServiceClient.OnEndSaveString(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
InnerException: System.Security.SecurityException
Message=""
StackTrace:
at System.Net.AsyncHelper.BeginOnUI(BeginMethod beginMethod, AsyncCallback callback, Object state)
at System.Net.BrowserHttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteSend(IAsyncResult result)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnSend(IAsyncResult result)
InnerException: System.Security.SecurityException
Message="[Arg_SecurityException]\r\nArguments:\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30523.8&File=mscorlib.dll&Key=Arg_SecurityException"
StackTrace:
at MS.Internal.InternalWebRequest.Send()
at System.Net.BrowserHttpWebRequest.BeginGetResponseImplementation()
at System.Net.BrowserHttpWebRequest.InternalBeginGetResponse(AsyncCallback callback, Object state)
at System.Net.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__3(Object sendState)
InnerException:
Projekt robiłem w oparciu o tutorial ze strony: http://www.miketaulty.com/SLVideos.html
Wideo o nazwie: „Making calls to webservices”