Pergunta

I need to implement webservice clien using apache tuscany SCA. Hence I start to learn it. I refer to this tutorial : http://tuscany.apache.org/build-your-first-web-services-with-tuscany.html

I followed all as mentioned in tutorial. And yes, successfully displayed on the browser. But, the catalog list is not showed up.

In browser i see this error log for 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

And also the html file for Line 8 under function catalog_getResponse(items):

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

and this is html line 96

catalog.get(catalog_getResponse);

this is my .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>

Anyone can help?

Foi útil?

Solução

Maybe you were using this URL:

http://localhost:8080/store

This URL should turn to page "store.html", but your browser cannot reach the "store.js" file.

Thus you must use the URL below to get the catalog list showed up:

http://localhost:8080/store/store.html

Outras dicas

Remove the package name from the class Reference:

//@Reference

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

More info.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top