江湖救急:关于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>