On Sat, Mar 13, 2010 at 11:16 AM, Zoran Jeremic <[email protected]> wrote:
> Hi,
>
> I thought that my problems are over, but unfortunately I still have a
> problem to connect client web page with tuscany web server. I did everything
> as you suggested but I firebug gives an error 404 method not found message.
>
> This is code integrated in web page:
> $(document).ready(function(){
>
> $.getJSON("http://ZoranPC:8080/CreateLearningGoalsService/getServiceTest");
> });
>
If you are trying to overcome the javscript domain limitation, you
need to use JSONP more like the following :
function getGreeting() {
var name = document.getElementById("name").value;
$.getJSON('http://localhost:8081/HelloWorldService/sayHello?name='
+ name + '&callback=?', handleResponse);
}
function handleResponse(data) {
document.getElementById('greeting').innerHTML=data;
}
> This is the content of the composite file:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
> name="lpc"
> targetNamespace="http://eclipse.org/intelleo-LPC/src/org/intelleo/ws/lpc">
> <component name="CreateLearningGoalsServiceComponent">
> <implementation.java
> class="org.intelleo.ws.lpc.impl.CreateLearningGoalsImpl"/>
> <reference name="availableCompetencesService"
> target="AvailableCompetencesComponent/AvailableCompetencesService"/>
> <service name="CreateLearningGoalsService">
> <interface.java
> interface="org.intelleo.ws.lpc.interfaces.CreateLearningGoalsService">
> <tuscany:binding.jsonrpc/>
> </interface.java>
> </service>
> </component>
> <component name="AvailableCompetencesComponent">
> <implementation.java
> class="org.intelleo.ws.lpc.impl.AvailableCompetencesImpl"/>
> <service name="AvailableCompetencesService">
> <interface.java
> interface="org.intelleo.ws.lpc.interfaces.AvailableCompetencesService"/>
> </service>
> </component>
> <service name="CreateLearningGoalsService"
> promote="CreateLearningGoalsServiceComponent/CreateLearningGoalsService">
> <interface.java
> interface="org.intelleo.ws.lpc.interfaces.CreateLearningGoalsService"/>
> <tuscany:binding.jsonrpc/>
> </service>
> </composite>
>
Please take a look at the example I ported to 2.x as it seems you are
till trying to configure your service trough promotion, this is what
is causing your service endpoint not to be available... and you are
STILL using JSON-RPC instead of JSONP binding
> CreateLearningGoalsService class defines two methods:
>
> @Callback
> String getAvailableCompetences(String sortingCriteria);
> void getServiceTest();
>
What are you trying here with the CallBack ?
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/