我正在用m子3(Anypoint Studio 6.5)创建一个Soap Web服务。
界面如下,
@WebService
public interface TestService {
@WebMethod
public Response AddUser(String input);
}
服务类别是
@WebService(endpointInterface = "com.soap.testservice.TestService",serviceName = "TestService")
public class TestServiceImpl implements TestService{
@Override
public Response AddUser(String input) {
Response response = new Response();
try {
System.out.println(input);
response.setStatus("success");
response.setMessage("Successfully added");
} catch (Exception e) {
e.printStackTrace();
}
return response;
}
}
此代码可以正常工作。但是我必须用bean类(Input.java)替换String
方法的AddUser()
参数,以便可以轻松地向我的soap服务添加/删除参数。
这是我的bean类
public class Input {
@XmlElement(required = true, nillable = true)
private String name;
@XmlElement(required = true, nillable = true)
private String email;
@XmlElement(required = true, nillable = true)
private String phone;
//getters & setters
}
我尝试用Input
类替换String,但是它给出了一个例外
org.mule.api.lifecycle.LifecycleException: Failed to invoke lifecycle phase "dispose" on object: org.mule.util.lock.MuleLockFactory@3820cfe
使用bean对象作为网络参数时,我有什么想念的吗?