Thanks!.Luciano Resende
Yesterday evening, I got an successful configuration of ict.composite.
It seems almost work well .All pages I want was sucessfully integerated into
index, and show right output, but there is still a little problem,that is
the there is always a script error which tell me :
Exception throw and not caught .
This happend on loading callwidget.html in a frame in index.html.
I guset there will be some un property involk of :
function a(){
var CallService = new Reference("callService");
CallService.call("","",CallService_getResponse);
}
---------------------------------------------
ict.composite---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" name="ICTComposite"
targetNamespace="http://ICTComposite">
<component name="ContactServiceComponent">
<implementation.java class="
com.asb.services.contact.ContactServiceImpl" />
<service name="ContactService">
<interface.java interface="
com.asb.services.contact.ContactService"></interface.java>
<t:binding.jsonrpc></t:binding.jsonrpc>
</service>
</component>
<component name="CallServiceComponent">
<implementation.java class="com.asb.services.call.CallServiceImpl"
/>
<service name="CallService">
<interface.java interface="com.asb.services.call.CallService
"></interface.java>
<t:binding.jsonrpc></t:binding.jsonrpc>
</service>
</component>
<component name="callwidget">
<t:implementation.widget location="webtop/callwidget.html"></t:
implementation.widget>
<service name="Widget">
<t:binding.http />
</service>
<reference name="callService" target="CallServiceComponent">
<t:binding.jsonrpc></t:binding.jsonrpc>
</reference>
</component>
<component name="contactwidget">
<t:implementation.widget location="webtop/contactwidget.html"></t:
implementation.widget>
<service name="Widget">
<t:binding.http />
</service>
<reference name="contactService" target="ContactServiceComponent">
<t:binding.jsonrpc></t:binding.jsonrpc>
</reference>
</component>
<component name="icthome">
<t:implementation.widget location="webtop/index.html"></t:
implementation.widget>
<service name="Widget">
<t:binding.http />
</service>
</component>
</composite>
-----------------------------------------
callwidget.html--------------------------------------------------------------------
<html>
<head>
<title>call</TITLE>
<script type="text/javascript" src="/SCADomain/scaDomain.js"></script>
<script type="text/javascript" src="callwidget.js"></script>
<script language="JavaScript">
//@Reference
var ContactService = new Reference("callService ");
function CallService_getResponse(items) {
document.getElementById('callComponent').innerHTML=items;
}
function a(){
var CallService = new Reference("callService");
CallService.call("","",CallService_getResponse);
}
</script>
</head>
<body onload="a()">
<h1>callwidget</h1>
<form name="callComponentForm">
<div id="callComponent"></div>
<br>
</form>
<br>
</body>
</html>
----------------------------------------CallServiceImpl---------------------------------------------------
/**
*
*/
package com.asb.services.call;
import org.osoa.sca.annotations.Service;
/**
* @author meflyup
*
*/
@Service(CallService.class)
public class CallServiceImpl implements CallService {
public String call(String caller,String callee){
return "call successful";
}
}
BTW,I can receive the msg of " call successful " in my index.html page.
------------------------------------------------------------------------------------------------------------
Another question :
According the ict.composite file , the index file should be visit with
http://localhost:8080/icthome/index.html.
and callwidget.html shoulde be visit with
http://localhost:8080/callwidget/callwidget.html.
and contactwidget.html should be visit with with
http://localhost:8080/contactwidget/contactwidget.html..
Any other link will cause HTTP ERROR: 404.
Is that right, but now I can visit the index.html with
http://fengxiang:8080/contactwidget/index.html and
http://fengxiang:8080/callwidget/index.html.
but i can't visit the http://fengxiang:8080/icthome/contactwidget.html,and
http://fengxiang:8080/icthome/callwidget.html.
How could these happen, It seems disorder. isn't it?
BR.
Thanks.
2008/3/18, Luciano Resende <[EMAIL PROTECTED]>:
>
> Hey Fengxiang
>
> Implementation.widget won't mashup multiple widgets just yet, but
> looks like your approach using iFrames should work.
> From reading your code, you should probably add the code below to
> contactwidget and callwidget, and any proper reference.
>
>
> <service name="Widget">
>
> <t:binding.http />
>
> </service>
>
>
> You also don't need to have the following code if you are using
> implementation.widget
>
>
> <script type="text/javascript"
> src="SCADomain/scaDomain.js"></script>
>
>
> If you could create a jira with a patch with your test case, that
> would probably help me investigate the issue further and give you a
> more concrete answer. I'll continue to look into this issue.
>
>
>
> On Mon, Mar 17, 2008 at 3:10 AM, Fengxiang <[EMAIL PROTECTED]> wrote:
> > Dear All.
> > Can anyone help me for a further understand of binding:
> implemetation.widget
> > .
> > I got the following code:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> > xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
> name="ICTComposite"
> > targetNamespace="http://ICTComposite">
> > <component name="ContactServiceComponent">
> > <implementation.java class="
> > com.asb.services.contact.ContactServiceImpl" />
> > <service name="ContactService">
> > <interface.java interface="
> > com.asb.services.contact.ContactService"></interface.java>
> > <t:binding.jsonrpc />
> > </service>
> > </component>
> > <component name="CallServiceComponent">
> > <implementation.java class="
> com.asb.services.call.CallServiceImpl"
> > />
> > <service name="CallService">
> > <interface.java interface="com.asb.services.call.CallService
> > "></interface.java>
> > <t:binding.jsonrpc />
> > </service>
> > </component>
> > <component name="icthome">
> >
> > <t:implementation.widget location="webtop/contactwidget.html" />
> > <t:implementation.widget location="webtop/callwidget.html" />
> > <t:implementation.widget location="webtop/index.html" />
> > <service name="Widget">
> > <t:binding.http />
> > </service>
> > <reference name="contactService"
> target="ContactServiceComponent">
> > <t:binding.jsonrpc />
> > </reference>
> > <reference name="callService" target="CallServiceComponent">
> > <t:binding.jsonrpc />
> > </reference>
> > </component>
> >
> >
> > </composite>
> >
> >
> > I want to make a webapp.there are 3 pages :index.html,callwidget.htmland
> > contactwidget.html.
> > I wish to mashup the last two in index.html:
> >
> > ----------------------------------------
> > index.html:------------------------------------------------------------
> > <html>
> > <head>
> > <title>ict-index-page</TITLE>
> >
> > <script type="text/javascript" src="contactwidget.js"></script>
> > <script type="text/javascript" src="callwidget.js"></script>
> > <script type="text/javascript" src="SCADomain/scaDomain.js"></script>
> >
> > </head>
> >
> > <body>
> > <h1>ict</h1>
> >
> > <iframe src="contactwidget.html" height="500"></iframe>
> > <iframe src="callwidget.html" height="500"></iframe>
> >
> >
> > </body>
> > </html>
> >
> > ------------------------------
> >
> callwidget.html-------------------------------------------------------------------
> > <html>
> > <head>
> > <title>call</TITLE>
> >
> > <script type="text/javascript" src="/SCADomain/scaDomain.js"></script>
> > <script type="text/javascript" src="callwidget.js"></script>
> > <script language="JavaScript">
> >
> > //@Reference
> > var ContactService = new Reference("callService ");
> > function CallService_getResponse(items) {
> >
> > document.getElementById('callComponent').innerHTML=items+"fd";
> > }
> >
> > function a(){
> > var CallService = new Reference("CallService");
> > CallService.call("",CallService_getResponse);
> > //document.getElementById('contactComponent').innerHTML="ffdafdfd";
> > }
> > </script>
> >
> > </head>
> >
> > <body onload="a()">
> > <h1>callwidget</h1>
> >
> >
> > <form name="callComponentForm">
> > <div id="callComponent"></div>
> > ffff<br>
> >
> > </form>
> >
> > <br>
> >
> >
> >
> > </body>
> > </html>
> >
> > ------------------------------
> >
> contactwidget.html-------------------------------------------------------------------
> > <html>
> > <head>
> > <title>Store</TITLE>
> >
> > <script type="text/javascript" src="SCADomain/scaDomain.js"></script>
> > <script type="text/javascript" src="contactwidget.js"></script>
> > <script language="JavaScript">
> >
> > //@Reference
> > var ContactService = new Reference("contactService");
> > function ContactService_getResponse(items) {
> > var contactList = "";
> > for (var i=0; i<items.length; i++)
> > contactList +=items[i]+ ' <br>';
> > document.getElementById
> ('contactComponent').innerHTML=contactList;
> > }
> >
> > function a(){
> > var ContactService = new Reference("ContactService");
> > ContactService.getContactList(ContactService_getResponse);
> >
> > }
> > </script>
> >
> > </head>
> >
> > <body onload="a()">
> > <h1>contactwidget</h1>
> >
> >
> > <form name="contactComponentForm">
> > <div id="contactComponent"></div>
> > ffff<br>
> >
> > </form>
> >
> > <br>
> >
> >
> >
> > </body>
> > </html>
> >
> > ------------------------------------------------------
> > when i run the programe,the tunscany alwasy show warning of :
> > WARNING: Reference not found for component reference:
> icthome/contactService
> > WARNING: Reference not found for component reference:
> icthome/callService
> >
> >
> > Thanks a lot!
> > BR.
> >
>
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>