0

我需要使用 apache tuscany SCA 来实现 webservice 客户端。因此我开始学习它。我参考本教程:http ://tuscany.apache.org/build-your-first-web-services-with-tuscany.html

我按照教程中提到的所有内容进行了操作。是的,成功显示在浏览器上。但是,目录列表没有显示出来。

在浏览器中,我看到了 js 的错误日志:

Message: 'tuscany' is undefined Line: 8 Char: 2 Code: 0
Message: 'catalog' is null or not an object Line: 96 Char: 3 Code: 0

以及函数 catalog_getResponse(items) 下第 8 行的 html 文件:

//@Reference
var catalog = new tuscany.sca.Reference("catalog");

这是 html 第 96 行

catalog.get(catalog_getResponse);

这是我的 .composite

<component name="Catalog">
    <implementation.java class="services.CatalogImpl" />
    <property name="currencyCode">USD</property>
    <service name="Catalog">
        <t:binding.jsonrpc uri="http://localhost:8080/Catalog"/>
    </service>
    <reference name="currencyConverter" target="CurrencyConverter" />
</component>

任何人都可以帮忙吗?

4

2 回答 2

1

也许你正在使用这个 URL:

http://localhost:8080/store

此 URL 应转到页面“store.html”,但您的浏览器无法访问“store.js”文件。

因此,您必须使用下面的 URL 来显示目录列表:

http://localhost:8080/store/store.html
于 2014-12-19T03:13:48.193 回答
0

从类参考中删除包名称:

//@Reference

var catalog = new Reference("catalog"); 
...

更多信息。

于 2013-12-02T16:55:52.690 回答