Skip to main content

Microsoft Silverlight

Answered Question How to deploy silverlight with WCF in iisRSS Feed

(0)

chszu
chszu

Member

Member

12 points

16 Posts

How to deploy silverlight with WCF in iis

It work fine in vs debug,but deploy it to iis.It don't work, It show errors:

Additional information: [UnexpectedHttpResponseCode]
Arguments:Not Found
Debugging 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.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode

my code:

BasicHttpBinding bind = new BasicHttpBinding();
      try
      {
          EndpointAddress endpoint = new EndpointAddress("http://localhost/videostation/VideoService.svc");
          webSvc = new VideoService.VideoServiceClient(bind, endpoint);
      }
      catch(Exception ex)
      {
          this.vtext._description.Text = ex.Message;
      }

     webSvc.GetAllVideosCompleted += new EventHandler<Mix08.VideoService.GetAllMessCompletedEventArgs>(webSvc_GetAllMesssCompleted);
      webSvc.GetAllMesssAsync();

thierry.bouquain
thierry....

Contributor

Contributor

2054 points

280 Posts

Silverlight MVP

Re: How to deploy silverlight with WCF in iis

Have you registered WCF in IIS ? "c:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe"

Thierry Bouquain
Ucaya
http://www.ucaya.com

chszu
chszu

Member

Member

12 points

16 Posts

Re: Re: How to deploy silverlight with WCF in iis

The error is

Microsoft JScript 运行时错误: Sys.InvalidOperationException: ManagedRuntimeError error #4002 in control 'Xaml1': System.Exception: [AsyncCallbackException]
Arguments:
Debugging 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.30226.2&File=System.ServiceModel.dll&Key=AsyncCallbackException ---> System.Exception: [AsyncCallbackException]
Arguments:
Debugging 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.30226.2&File=System.ServiceModel.dll&Key=AsyncCallbackException ---> System.Reflection.TargetInvocationException: [Async_ExceptionOccurred]
Arguments:
Debugging 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.30226.2&File=System.dll&Key=Async_ExceptionOccurred ---> System.ServiceModel.ProtocolException: [UnexpectedHttpResponseCode]
Arguments:Not Found
Debugging 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.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode
   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.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
   at Mix08.VideoService.VideoServiceClient.VideoServiceClientChannel.EndGetAllVideos(IAsyncResult result)
   at Mix08.VideoService.VideoServiceClient.Mix08.VideoService.IVideoService.EndGetAllVideos(IAsyncResult result)
   at Mix08.VideoService.VideoServiceClient.OnEndGetAllVideos(IAsyncResult result)
   at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
   --- End of inner exception stack trace ---
   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   at Mix08.VideoService.GetAllVideosCompletedEventArgs.get_Result()
   at Mix08.Page.webSvc_GetAllVideosCompleted(Object sender, GetAllVideosCompletedEventArgs e)
   at Mix08.VideoService.VideoServiceClient.OnGetAllVideosCompleted(Object state)
   at System.ServiceModel.ClientBase`1.AsyncOperation.Post(SendOrPostCallback d, Object arg)
   at System.ServiceModel.ClientBase`1.AsyncOperation.PostOperationCompleted(SendOrPostCallback d, Object arg)
   at System.ServiceModel.ClientBase`1.CompleteAsyncCall(AsyncOperationContext context, Object[] results, Exception error)
   at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   --- End of inner exception stack trace ---
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.CallComplete(Boolean completedSynchronously, Exception exception)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishSend(IAsyncResult result, Boolean completedSynchronously)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.SendCallback(IAsyncResult result)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   --- End of inner exception stack trace ---
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
   at System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously, Exception exception)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
   at System.Net.BrowserHttpWebRequest.Failed(Object sender, EventArgs e)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

I have waste too much time on it,but it .....

Psychlist1972
Psychlis...

Contributor

Contributor

6045 points

973 Posts

MicrosoftModerator
Answered Question

Re: Re: How to deploy silverlight with WCF in iis

Can you navigate directly to the .svc file in your browser? If so, does it work from there?

Pete

Silverlight.net Moderator
MVP: Silverlight, Silverlight Insider
Author: Silverlight in Action, 2nd Edition
POKE 53280,0 - My Blog

Opinions are my own. Oh, and I don't work for Microsoft.

chszu
chszu

Member

Member

12 points

16 Posts

Re: Re: Re: How to deploy silverlight with WCF in iis

Thank you very much

I have sove this problem

Fotenyuk Nikolay
Fotenyuk...

Member

Member

18 points

9 Posts

Re: Re: How to deploy silverlight with WCF in iis

I can navigate directly to the .svc file in my browser: 

I saw following:  

You have created a service.

To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:

svcutil.exe http://is1.upclicksolutions.com/MyPeopleSearchSL/Service1.svc?wsdl

 

This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:

C#

class Test
{
    static void Main()
    {
        Service1Client client = new Service1Client();

        // Use the 'client' variable to call operations on the service.

        // Always close the client.
        client.Close();
    }
}

Visual Basic

Class Test
    Shared Sub Main()
        Dim client As Service1Client = New Service1Client()
        ' Use the 'client' variable to call operations on the service.

        ' Always close the client.
        client.Close()
    End Sub
End Class
 
I don't understand how solve this problem with silverlight.
I have IIS5.1 and SilverLight 2
Help me !!!

thierry.bouquain
thierry....

Contributor

Contributor

2054 points

280 Posts

Silverlight MVP

Re: Re: How to deploy silverlight with WCF in iis

I think the next step is to write a WCF client to test your webservice on IIS. You can use the sample provided in the .svc helper page.

Thierry Bouquain
Ucaya
http://www.ucaya.com

Fotenyuk Nikolay
Fotenyuk...

Member

Member

18 points

9 Posts

Re: Re: How to deploy silverlight with WCF in iis

It is Cross Domain Bug with Silverlight 2 Beta 1 

I found one link with this problem:

http://www.interact-sw.co.uk/iangblog/2008/03/16/silverlight-xdomain-semi

balukr54
balukr54

Member

Member

124 points

143 Posts

Re: Re: How to deploy silverlight with WCF in iis

HI All,

I am using a silverlight 2.0 application. Application shows the following error in certain machines, when try to access a web service.

 This is the error I am getting

. ========================================================

Additional information: [UnexpectedHttpResponseCode] Arguments:Not Found Debugging 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.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode ==============================================================================================

 This problem occurred after we deployed our application to the server provided by our client. This issue is not in our localhost and in our servers. This error is coming only in one or two systems and only in IE. FireFox it is working fine. I tried with NikhilK’s Web Development Helper tool and the status of web service call shown is 200 and the response content contains the output XML also. we deployed the service in same application directory (www.mywebsite.com/service.asmx) and it is accessible from the machine which is giving problem. Also we can access clientaccesspolicy.xml & crossdomain.xml from the machine which is giving problem. Anyone Got any idea??

 Thanks in advance for any help...

Balu

Fotenyuk Nikolay
Fotenyuk...

Member

Member

18 points

9 Posts

Re: Re: How to deploy silverlight with WCF in iis

Look at this post http://silverlight.net/forums/t/13189.aspx

 

It's generic methods or properties throw exception !

talldaniel
talldaniel

Member

Member

590 points

329 Posts

Re: Re: How to deploy silverlight with WCF in iis

The messages with Silverlight can be rather strange, if your webservice has an unhandled exception.  For example, I was getting a "not found" error today when I was trying to access a webservice from Silverlight, and so I stepped into the webservice from an asp.net application.  I found an error reading data from the database, as I had not allowed for those cases where the value was null.  When I fixed this, I no longer got a not found error.

There are some differences between calling a webservice from within an asp.net website and calling it from inside of silverlight too, so having a test from asp.net wont' always find the problem.  For example, for some reason it seems garbage collection is handled differently when using Silveright, and things that are properly closed when called from an asp.net website, are not closed when called from silverlight.

There are some other exceptions too, so you cannot just use the test fixture to debug everything, but it definitely helps.  Anyway, I bet it is not really a "not found" error, but some other sort of error.

Max78
Max78

Member

Member

4 points

2 Posts

Re: Re: How to deploy silverlight with WCF in iis

I have a similar problem on my silverlight + WCF application.

It works on my developer machine (in ServiceReference I have localhost:50834/DbService.svc)
It works on my internal server (in ServiceReference I have 192.168.1.8/AppName/DbService.svc)

But I cannot find a way to make it work on internet.
In ServiceReference.ClientConfig I've tried localhost, 192.168.1.8 and hostname/AppName/DbService.svc.

if I browse the last link directly on the browser the service answers correctly. But everytime I try to connect to the silverlight app from internet it shows me an error when accessin WCF.

WCF Service is on the same machine as the Silverlight app.

 

talldaniel
talldaniel

Member

Member

590 points

329 Posts

Re: Re: How to deploy silverlight with WCF in iis

the problem may be with clientaccesspolicy.xml & crossdomain.xml  even though it shows 200 when you use a tool to watch what is going on.

remove clientaccesspolicy.xml and only use crossdoman.xml and see if that fixes it.

 I know it shouldnt matter, but I had a similar problem to what you are having and that was the solution.

Thanagarajan
Thanagar...

Member

Member

2 points

1 Posts

Re: Re: Re: How to deploy silverlight with WCF in iis

How you solved this problem. Please let us know as we are also facing the same issue.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities