[Users] dynamic web services(endpoints) call?
wabom
petals-components at ebmwebsourcing.com
Wed Mar 16 10:32:32 CET 2011
good morning,
Thank you first of all for your help.
I am using petals-standalone-1.5.0 et petals-se-eip-1.4-SNAPSHOT.zip because I think the equivalent of <get-calls-by-service> isn't supported in the new eip version.
I exposed into PEtALS a sample example using eip which, then I exposed it outside PEtALS using bc-soap. I tried to invoke this service using web service client from eclipse but I got this exception in eclipse
Code:
org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
and this in petals terminal
Code:
[Petals.Container.Components.petals-engine-eip]-SEVERE 2009-06-26 10:24:08,323 Error during message exchange processing
org.objectweb.petals.component.common.HandlingException: Unknown operation: "getCalls".
at org.objectweb.petals.engine.eip.EipEngine.onExchange(EipEngine.java:337)
at org.objectweb.petals.component.common.AbstractComponent.processInOut(AbstractComponent.java:520)
at org.objectweb.petals.component.common.AbstractComponent.process(AbstractComponent.java:457)
at org.objectweb.petals.component.common.listener.MessageExchangeWorker.run(MessageExchangeWorker.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
[Petals.Container.Components.petals-bc-soap]-WARNING 2009-06-26 10:24:08,624 Got a fault on JBI response
For exposing my sample SA(service assembly) into petals I used this jbi.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<jbi version="1.0" xmlns="http://java.sun.com/xml/ns/jbi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:petals="http://petals.objectweb.org/"
xmlns:extensions="http://petals.objectweb.org/extensions/"
xmlns:eip="http://petals.objectweb.org/extensions/eip/"
xmlns:plan="http://plan.myorg"
xmlns:keyvalue="http://petals.objectweb.org/extensions/key-value/">
<services binding-component="true">
<provides interface-name="plan:Planificateur"
service-name="plan:PlanificateurService"
endpoint-name="SampleEipChainEndpoint">
<extensions:extensions>
<extension xmlns="http://petals.objectweb.org/extensions/eip/">
<chain>
<get-calls-by-service service="{http://petals.objectweb.org/}PlanificateurService" operation="getCalls"/>
</chain>
</extension>
<keyvalue:extension>
<wsdl>Planificateur.wsdl</wsdl>
</keyvalue:extension>
</extensions:extensions>
</provides>
</services>
</jbi>
and for exposing my service out side petals I used this jbi.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<jbi version="1.0" xmlns="http://java.sun.com/xml/ns/jbi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-4.0"
xmlns:example="http://service.example.com/1.0"
xmlns:petals="http://petals.objectweb.org/"
xmlns:soap="http://petals.ow2.org/components/soap/version-3.1"
xmlns:extensions="http://petals.objectweb.org/extensions/"
xmlns:plan="http://plan.myorg"
xmlns:keyvalue="http://petals.objectweb.org/extensions/key-value/">
<services binding-component="true">
<consumes interface-name="plan:Planificateur"
service-name="plan:PlanificateurService"
endpoint-name="SampleEipChainEndpoint">
<!--<petalsCDK:mep> WC[""]</petalsCDK:mep>-->
<petalsCDK:mep>InOut</petalsCDK:mep>
<!-- SOAP specific fields -->
<soap:address>SampleEipChainEndpoint</soap:address>
<soap:synchronous-timeout>0</soap:synchronous-timeout>
<soap:mode>SOAP</soap:mode>
<keyvalue:extension>
<wsdl>Planificateur.wsdl</wsdl>
</keyvalue:extension>
</consumes>
</services>
</jbi>
The getCalls operation is like that:
Code:
Element calls=new Element("calls");
Document doc2 = new Document(calls);
Element call=new Element("call");
Attribute service =new Attribute("service","{http://transmode.myorg}TransmodeService");
Attribute operation=new Attribute("operation","doTransmode");
call.setAttribute(service);
call.setAttribute(operation);
calls.addContent(call);
call=new Element("call");
service =new Attribute("service","{http://transcode.myorg}TranscodeService");
operation=new Attribute("operation","doTranscode");
call.setAttribute(service);
call.setAttribute(operation);
calls.addContent(call);
try
{
//On utilise ici un affichage classique avec getPrettyFormat()
XMLOutputter sortie = new XMLOutputter(Format.getPrettyFormat());
FileOutputStream file=new FileOutputStream("calls.xml");
sortie.output(doc2, file);
}
catch (java.io.IOException e){}
int l;
String contenu=new String("");
try{
InputStreamReader ipsr=new InputStreamReader(new FileInputStream("calls.xml"));
BufferedReader br=new BufferedReader(ipsr);
String ligne=br.readLine();
while ((ligne=br.readLine())!=null){
//System.out.println(ligne);
contenu+=ligne;
}
br.close();
}
catch (Exception e){
System.out.println(e.toString());
}
seqCalls=contenu;
return seqCalls;
Is there someone who can help me!!!
Tahnks...
-------------------- m2f --------------------
Read this forum topic online here:
http://petals.ebmwebsourcing.com/forum/viewtopic.php?p=785#785
-------------------- m2f --------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://forum-list.petalslink.org/pipermail/users/attachments/20110316/82f3bd74/attachment.htm>
More information about the Users
mailing list