爪哇 - 本地主机的根文件夹?爪哇、文件夹、主机

2023-09-04 23:33:43 作者:执笔绘江山

大量的调查调用从Silverlight的Web服务后: Calling从Silverlight的Java Web服务将引发异常

after lots of investigations for calling a web service from silverlight: Calling a Java Web service from silverlight throws an exception

我发现了我,我应该要创建一个clientaccesspolicy.xml的文件,并把它放在应用程序的根文件夹中。我在我的ASPX(网页)的根文件夹复制它,但它并没有帮助。我猜的根文件夹应该是在服务器上为我的Java服务的根文件夹中。我有Apache服务器在我的Win7 64位系统,但停药后在Java仍然工作,所以我猜测,在服务器上为Eclipse IDE的是Apache不同。

I found out that I should I have to create a clientaccesspolicy.xml file and put it in the root folder of the application. I copied it in the root folder of my ASPX (web page) but it didn't help. I'm guessing the root folder should be the root folder of the server for my Java service. I have apache server on my Win7 x64 system but after stopping it the Java still worked so I'm guessing that the server for Eclipse IDE is different from Apache.

所以,主要的问题在这里是:哪里是Eclipse的Java的服务器的根文件夹?我应该在哪里把该XML文件?

So the main question here is: Where is the root folder of Java Eclipse server? Where should I put that xml file?

感谢。

推荐答案

如果您使用的是自托管的Java Web服务与Endpoint.publish(字符串),那么我认为这是不可能添加更多的文件递送,如:一个crossdomain.xml的

If you are using a self-hosted Java webservice with Endpoint.publish(String) then I think it is not possible to add further files for delivery, e.g. a crossdomain.xml

相反,你需要从自托管Web服务切换到服务器托管的Web服务描述的这里(该教程是使用NetBeans,但类似的做法应该可以使用Eclipse,也一样,即使它可能会稍微容易使用NetBeans在这个例子中)。由于使用Tomcat作为服务器,还可以提供相应的Silverlight项目文件以及,在这种情况下你不需要的crossdomain.xml

Instead you need to switch from a self-hosted webservice to a server-hosted webservice as described here (the tutorial is using Netbeans, but a similar approach should be possible with Eclipse, too, even if it might be slightly easier to use Netbeans for this example). As Tomcat is used as a server, it is also possible to deliver the corresponding Silverlight project files as well, in which case you do not need a crossdomain.xml