江湖救急:关于axis2发布的Fault Service问题!!!

钟奎 2007-02-08 07:15:13
发布arr文件报:Fault Service
java源代码:
-----------------------
package org.guoxin;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;

public class AnimalServiceClass {
public String queryOwner(String Aname)
{
System.out.println("Animal name:" + Aname);
return "Animal " + Aname + "of Owner: rocket";
}

public void setAttribute(OMElement info)
{
System.out.println(info.getText());
}

public OMElement getAttribute(OMElement info)
{
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://animals.guoxin.net","Animal");
OMElement resp = fac.createOMElement("getAttribute",omNs);
resp.setText("animal 1");
return resp;
}
}


services.xml
----------------------------
<service name="AnimalsService">
<parameter name="ServiceClass" locked="false">org.guoxin.AnimalServiceClass</parameter>
<operation name="queryOwner">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>

<operation name="setAttribute">
<messageReceiver class="org.apache.axis2.rpc.receivers.RawXMLINOnlyMessageReceiver"/>
<actionMapping>urn:setAttribute</actionMapping>
</operation>
<operation name="getAttribute">
<messageReceiver class="org.apache.axis2.rpc.receivers.RawXMLINOutMessageReceiver"/>
<actionMapping>urn:getAttribute</actionMapping>
</operation>
</service>
...全文
983 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
钟奎 2007-02-09
  • 打赏
  • 举报
回复
问题解决了!!!
高兴中...
钟奎 2007-02-09
  • 打赏
  • 举报
回复
出现新问题,在访问wsdl时:
<error>
<description>Unable to generate WSDL for this service</description>
<reason>
Either user has not dropped the wsdl into META-INF or operations use message receivers other than RPC.
</reason>
</error>

高手指点。。。。
钟奎 2007-02-08
  • 打赏
  • 举报
回复
如果单申明queryOwner没有错误!不知道是不是RawXMLINOnlyMessageReceiver的问题?
高手请旨点....

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧