Skip to main content

Microsoft Silverlight

Unanswered Question The remote server returned an unexpected response:(404)Not Found.RSS Feed

(0)

Shaji-mji
Shaji-mji

Participant

Participant

1129 points

260 Posts

The remote server returned an unexpected response:(404)Not Found.

Error   I often get this error when Iam working on a silverlight app in visual studio 2008. Once I restart Vistal studio, it works fine.. Is this a bug? What should I do to get rid of this bug?

 Iam using a wcf service that is in the same web so there is no issue of the service is running

 

 

 

 

 

 

 

 

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Re: The remote server returned an unexpected response:(404)Not Found.

Are you accessing some services.Because i was also facing same problem when i was working with wcf services.

It was due to the fact that some times those services were not running and some times it was taking wrong port for them.

Thanks,

Mark as answer if this post answered your question.

Harsh Bardhan

tranduybien
tranduybien

Member

Member

186 points

53 Posts

Re: The remote server returned an unexpected response:(404)Not Found.

 Normaly I'm create new project for webservice then call it like http://localhost/mywebservice/service1.svc .......... After that I'm trying to create references with this webservice. Hope can fix your problem !

Webservice References ! 

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Regards,
Bien Tran Duy
http://infoway.com.vn

sankarcse
sankarcse

Member

Member

8 points

25 Posts

Re: The remote server returned an unexpected response:(404)Not Found.

I am aslo getting this same problem. How can i solve this issue??? :-)

tranduybien
tranduybien

Member

Member

186 points

53 Posts

Re: Re: The remote server returned an unexpected response:(404)Not Found.

Try to check available of 2 files clientaccesspolicy.xml and crossdomain.xml and point detail binding method and accesspoint when you trying to call web-service:

 BasicHttpBinding httpBinding = new BasicHttpBinding(BasicHttpSecurityMode.None);
 EndpointAddress endpoint = new EndpointAddress(InfoMap2D.Common.SysConfig.GetInstance().ServiceMap);
 httpBinding.MaxReceivedMessageSize = 200000;
 myService1 = new Service1SoapClient(httpBinding, endpoint);

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Regards,
Bien Tran Duy
http://infoway.com.vn

CopyPasteGhost
CopyPast...

Member

Member

6 points

3 Posts

Re: Re: The remote server returned an unexpected response:(404)Not Found.

I am running into the same problem.

My app starts to run and then dies with this error:

 System.ServiceModel.CommunicationException was unhandled by user code
  Message="The remote server returned an error: NotFound"
  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.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
       at WiBotSilver.ProxyCode.RMAServiceClient.RMAServiceClientChannel.EndGetManufacturers(IAsyncResult result)
       at WiBotSilver.ProxyCode.RMAServiceClient.WiBotSilver.ProxyCode.IRMAService.EndGetManufacturers(IAsyncResult result)
       at WiBotSilver.ProxyCode.RMAServiceClient.OnEndGetManufacturers(IAsyncResult result)
       at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
  InnerException: System.Net.WebException
       Message="The remote server returned an error: NotFound"
       StackTrace:
            at System.Net.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
            at System.Net.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       InnerException: System.Net.WebException
            Message="The remote server returned an error: NotFound"
            StackTrace:
                 at System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                 at System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
                 at System.Net.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
            InnerException:

 

I have clientaccesspolicy.xml defined in the website root.
I DO NOT have crossdomain.xml defined at all.

Any idea what's going on?

Josh Couto
www.robotshop.com

tbrummel
tbrummel

Member

Member

4 points

2 Posts

Re: Re: The remote server returned an unexpected response:(404)Not Found.

Ditto.  I just busted out Silverlight 2 and VS 2008 to see if I could update my current ASP.NET site to use a silverlight control for login.

I got all the code working fine locally - referencing the System.Web.ApplicationServices.AuthenticationService. 

When I deployed it to the real web, the first thing I ran into was that the service reference in the Silverlight app has an invalid endpoint.  So I modified the XML file to be the actual URL on the web.

After I call AuthenticaionClient.LoginAsynch, my LoginCompleted handler gets a Error back in the result: The remote server returned an error: 404 NotFound.

I threw a clientaccesspolicy file on the server just in case but it sure looks to me like that would only come into play cross-domain -- and all this is running on the same web server.

 

drbarton
drbarton

Member

Member

10 points

14 Posts

Re: Re: The remote server returned an unexpected response:(404)Not Found.

CopyPasteGhost:

  Message="The remote server returned an error: NotFound"
  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.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
       at WiBotSilver.ProxyCode.RMAServiceClient.RMAServiceClientChannel.EndGetManufacturers(IAsyncResult result)
       at WiBotSilver.ProxyCode.RMAServiceClient.WiBotSilver.ProxyCode.IRMAService.EndGetManufacturers(IAsyncResult result)
       at WiBotSilver.ProxyCode.RMAServiceClient.OnEndGetManufacturers(IAsyncResult result)
       at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
  InnerException: System.Net.WebException
       Message="The remote server returned an error: NotFound"
       StackTrace:
            at System.Net.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
            at System.Net.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       InnerException: System.Net.WebException
            Message="The remote server returned an error: NotFound"
            StackTrace:
                 at System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                 at System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
                 at System.Net.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
            InnerException:

 

I have clientaccesspolicy.xml defined in the website root.
I DO NOT have crossdomain.xml defined at all.

 

 

I have exactly the same problem. Any idea ?

tranduybien
tranduybien

Member

Member

186 points

53 Posts

Re: Re: Re: The remote server returned an unexpected response:(404)Not Found.

Try to put crossdomain.xml into your project

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Regards,
Bien Tran Duy
http://infoway.com.vn

CopyPasteGhost
CopyPast...

Member

Member

6 points

3 Posts

Re: Re: Re: The remote server returned an unexpected response:(404)Not Found.

What goes in the crossdomain.xml?

Josh Couto
www.robotshop.com

drbarton
drbarton

Member

Member

10 points

14 Posts

Re: Re: Re: The remote server returned an unexpected response:(404)Not Found.

  

1    
2    <!DOCTYPE cross-domain-policy 
3      SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
4    <cross-domain-policy>
5            <allow-access-from domain="*" />
6    </cross-domain-policy>
 

CopyPasteGhost
CopyPast...

Member

Member

6 points

3 Posts

Re: Re: Re: The remote server returned an unexpected response:(404)Not Found.

And this goes in the web root at the same place as the "ClientAccessPolicy.xml"?

Josh Couto
www.robotshop.com

drbarton
drbarton

Member

Member

10 points

14 Posts

Re: Re: Re: The remote server returned an unexpected response:(404)Not Found.

 Exactly

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities