开发者

Silverlight and webservice, unable to call method, getting "NotFound" result

This is driving me crazy for the last couple of hours. Need help, big time. I developed a solution on my local machine and posted it to a web site, its a basic file upload webservice and a silverlight application that posts files to it. I have a list of folders which i try to load, when i call the GetFolders() method the asynch return excepts and trows a communication error: "NotFound".

The webservice is available on: (file reference no longer available)(no security) and my code for the webservice can be downloaded from: (file reference no longer available)

The silverlight application consists of two projects, one with the silverlight object and a host page, they are both contained within this download: (file refe开发者_如何学编程rence no longer available)

Basically the silverlight fills a dropdown with the folders from the "GetFolders()" method, and in the eventhandler for end end command it crashes... I spend the last 5 hours trying back and forth, and im an inch from re-writing the whole damn thing - hoping that would help me...any help is appreciated

The service is working locally, no problems...which makes it even worse :-)

Update: Enabled the simple test button, and tried to run the "GetFolders()" method, it returned a error http error 500, which is as generic as the "NotFound" error.

Update 2: A website running on the same domain is working without problems. Accessing the web service from a different domain is causing big problems now. When i run the silverlight application and the web service from the same domain it works fine. When they are on different domains (e.g. the silverlight application on localhost) then the error occur. I dont own the web hotel where the web service is so i cant implement more logging, i dont suspect this being the problem though. Im leaning more towards a cross domain problem, but i dont know how to solve it (i have a clientaccesspolicy.xml file on the same level as my .asmx file looking like this:

<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

/Brian


"NotFound" is a generic error that Silverlight uses and it could mean anything.

I would encourage you to use a tool called Microsoft Service Trace Viewer to diagnose your issue, i have found this absolutely invaluable in the past. You can find details on how to use it in the post by Yi-Lun Luo here.


Solution found:

It appears that the clientaccesspolicy.xml file should not only be present in the subdomain but also in the main domain, that is: it should be located in green-web.dk and not only in dsr.green-web.dk.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜