maria diciocia
2014-07-24 10:30:03 UTC
I want to build behavior with call web services.
I download add-ons wsdc and compile.
I put wdsc.jar in my project.
code----------
public class BookSellerAgent extends Agent {
// The catalogue of books for sale (maps the title of a book to its price)
private Hashtable catalogue;
// The GUI by means of which the user can add books in the catalogue
private BookSellerGui myGui;
// Put agent initializations here
protected void setup() {
// Create the catalogue
catalogue = new Hashtable();
// Create and show the GUI
myGui = new BookSellerGui(this);
myGui.showGui();
// Register the book-selling service in the yellow pages
DFAgentDescription dfd = new DFAgentDescription();
dfd.setName(getAID());
ServiceDescription sd = new ServiceDescription();
sd.setType("book-selling");
sd.setName("JADE-book-trading");
dfd.addServices(sd);
try {
DFService.register(this, dfd);
}
catch (FIPAException fe) {
fe.printStackTrace();
}
// Get an instance of DynamicClient
DynamicClient dc = new DynamicClient();
// Initialize DynamicClient for MathFunctions webservice by file
try {
dc.initClient(new URI("http://localhost:2000/axis/test/MathFunctions.wsdl
"));
} catch (DynamicClientException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Get the DynamicClient for MathFunctions webservice by url
// dc.initClient(new URI("
http://localhost:2000/axis/test/MathFunctionsPort?wsdl"));
}
error----
*** Uncaught Exception for agent ciccio ***
java.lang.NoSuchMethodError:
org.apache.axis.wsdl.toJava.Emitter.setBobMode(Z)V
at
jade.webservice.dynamicClient.DynamicClient.internalInitClient(DynamicClient.java:616)
at
jade.webservice.dynamicClient.DynamicClient.initClient(DynamicClient.java:557)
at
jade.webservice.dynamicClient.DynamicClient.initClient(DynamicClient.java:539)
at examples.bookTrading.BookSellerAgent.setup(BookSellerAgent.java:65)
at jade.core.Agent$ActiveLifeCycle.init(Agent.java:1522)
at jade.core.Agent.run(Agent.java:1468)
at java.lang.Thread.run(Unknown Source)
what'is the problem?
thankyou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jade.tilab.com/pipermail/jade-develop/attachments/20140724/6af70595/attachment.html>
I download add-ons wsdc and compile.
I put wdsc.jar in my project.
code----------
public class BookSellerAgent extends Agent {
// The catalogue of books for sale (maps the title of a book to its price)
private Hashtable catalogue;
// The GUI by means of which the user can add books in the catalogue
private BookSellerGui myGui;
// Put agent initializations here
protected void setup() {
// Create the catalogue
catalogue = new Hashtable();
// Create and show the GUI
myGui = new BookSellerGui(this);
myGui.showGui();
// Register the book-selling service in the yellow pages
DFAgentDescription dfd = new DFAgentDescription();
dfd.setName(getAID());
ServiceDescription sd = new ServiceDescription();
sd.setType("book-selling");
sd.setName("JADE-book-trading");
dfd.addServices(sd);
try {
DFService.register(this, dfd);
}
catch (FIPAException fe) {
fe.printStackTrace();
}
// Get an instance of DynamicClient
DynamicClient dc = new DynamicClient();
// Initialize DynamicClient for MathFunctions webservice by file
try {
dc.initClient(new URI("http://localhost:2000/axis/test/MathFunctions.wsdl
"));
} catch (DynamicClientException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Get the DynamicClient for MathFunctions webservice by url
// dc.initClient(new URI("
http://localhost:2000/axis/test/MathFunctionsPort?wsdl"));
}
error----
*** Uncaught Exception for agent ciccio ***
java.lang.NoSuchMethodError:
org.apache.axis.wsdl.toJava.Emitter.setBobMode(Z)V
at
jade.webservice.dynamicClient.DynamicClient.internalInitClient(DynamicClient.java:616)
at
jade.webservice.dynamicClient.DynamicClient.initClient(DynamicClient.java:557)
at
jade.webservice.dynamicClient.DynamicClient.initClient(DynamicClient.java:539)
at examples.bookTrading.BookSellerAgent.setup(BookSellerAgent.java:65)
at jade.core.Agent$ActiveLifeCycle.init(Agent.java:1522)
at jade.core.Agent.run(Agent.java:1468)
at java.lang.Thread.run(Unknown Source)
what'is the problem?
thankyou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jade.tilab.com/pipermail/jade-develop/attachments/20140724/6af70595/attachment.html>