以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 Web Services & Semantic Web Services 』  (http://bbs.xml.org.cn/list.asp?boardid=10)
----  [求助]owl-s1.0 里的example中RunService的问题  (http://bbs.xml.org.cn/dispbbs.asp?boardid=10&rootid=&id=45876)


--  作者:kimpost
--  发布时间:4/23/2007 10:46:00 PM

--  [求助]owl-s1.0 里的example中RunService的问题
我是在mindswap里下载的 owl-s 1.0API  但当我运行 它的example中的 runSservice 出错...不知道 那位大大..能帮帮小弟看看哪里出问题了

我把RunService.java也上传了...各位大大帮帮忙,我才刚刚开始研究owl-s 1.0API  

其中的 runDictionary() 出错..看了很久都不知道什么问题..
runDictionary()的code 如下

public void runDictionary() throws Exception {
    URI uri = new URI("http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl");
    service = reader.read(uri);
    process = service.getProcess();

// initialize the input values to be empty
  values = OWLSFactory.createValueMap();
  
  inValue = "computer";
  values1.setValue(process.getInputs().getParameter("InputString"), inValue);  
  values = exec.execute(process, values1); 
  
  // get the output using local name
  outValue = values.getValue(process.getOutputs().getParameter("OutputString")).toString();
  
  // display the results
  System.out.println("Executed service '" + service + "'");
  System.out.println("Input  = " + inValue);  
  System.out.println("Output = " + outValue);
  System.out.println();
}


出错如下

Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (404)/soap/servlet/rpcrouter
faultActor:
faultNode:
faultDetail:
 {}string: return code:  404
<html><head><title>Apache Tomcat/5.5.9 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /soap/servlet/rpcrouter</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/soap/servlet/rpcrouter</u></p><p><b>description</b> <u>The requested resource (/soap/servlet/rpcrouter) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.9</h3></body></html>

(404)/soap/servlet/rpcrouter
 at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:630)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128)
 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
 at org.apache.axis.client.Call.invoke(Call.java:2553)
 at org.apache.axis.client.Call.invoke(Call.java:1753)
 at org.mindswap.wsdl.WSDLOperation.invoke(WSDLOperation.java:120)
 at org.mindswap.owls.grounding.impl.WSDLAtomicGroundingImpl.invoke(WSDLAtomicGroundingImpl.java:139)
 at org.mindswap.owls.process.execution.impl.ProcessExecutionEngineImpl.executeAtomic(ProcessExecutionEngineImpl.java:117)
 at org.mindswap.owls.process.execution.impl.ProcessExecutionEngineImpl.execute(ProcessExecutionEngineImpl.java:104)
 at RunService.runDictionary(RunService.java:354)
 at RunService.main(RunService.java:427)


--  作者:kimpost
--  发布时间:4/23/2007 10:49:00 PM

--  
文件:

--  作者:timothy
--  发布时间:4/24/2007 9:44:00 AM

--  
当然会出问题拉!!!
你的这个owl 文件根本现在已经不存在了!!!
http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl
你代码的第三行:
URI uri = new URI("http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl");

--  作者:kimpost
--  发布时间:4/24/2007 3:02:00 PM

--  
http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl
这个文件存在阿

--  作者:timothy
--  发布时间:4/24/2007 10:20:00 PM

--  
你把整个安装过程和使用过程说一下,我装上试用一下!!!

--  作者:kimpost
--  发布时间:4/25/2007 12:39:00 AM

--  
我是用eclipse运行的
在eclipse中新建一个project --->java application
然后导入 RunService.java所需要jar

如果你已经下载了owl-s-1.0.1
RunService.java所需要jar在\owl-s-1.0.1\lib 内

如果没有下载,下面是link
http://www.mindswap.org/2004/owl-s/api/download/owl-s-1.0.1.zip


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms