Axis2+Myeclipse开发webservice问题
我写了一个类SelectByEditor,类里一个方法Boolean select(String editorName),该方法是根据editorName值访问mysql数据库。
我用Axis2 code generator wizard生成wsdl代码,再发布到服务器上。
然后我用Axis2 code generator wizard根据wsdl文件生成客户端的SelectByEditorStub类。
然后我在测试代码里这样写:
SelectByEditorStub stub=new SelectByEditorStub("http://127.0.0.1:8080/axis2/services/SelectByEditor_Service");
Select select=new Select();
select.setEditorName("Mike");
SelectResponse res=stub.select(select);
System.out.print(res.get_return());
但运行报错:
org.apache.axis2.AxisFault: Exception occurred while trying to invoke service method select
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:446)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.client.SelectByEditorStub.select(SelectByEditorStub.java:740)
at test.TestSelectByEditor.main(TestSelectByEditor.java:28)
不知道是哪一步错了。一个service可以去访问数据库的吗?求高手解释,谢谢!
------解决方案--------------------解决了吗?我也遇到这个问题