当我的POJO axis2方法返回空数组时,我在客户端收到空数组的null实例。我知道问题出在WSDL上。
有没有办法配置axis2来生成有效的WSDL?我以编程方式创建axis2服务:
ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
Map<String, MessageReceiver> mrMap = new HashMap<String, MessageReceiver>();
mrMap.put("http://www.w3.org/ns/wsdl/in-only", RPCInOnlyMessageReceiver.class.newInstance());
mrMap.put("http://www.w3.org/ns/wsdl/in-out", RPCMessageReceiver.class.newInstance());
AxisService service = AxisService.createService(...);
context.getAxisConfiguration().addService(service);
SimpleHTTPServer server = new SimpleHTTPServer(context, port);
server.start();有谁能给出Axis2服务的自定义SchemaGenerator的例子吗?
谢谢。
发布于 2018-02-08 14:07:37
太晚了,但让我来回答这个问题。我认为你没有在你的POJO中创建对象。您可能只是声明了它的引用。为它创建一个对象。然后,它将在响应中显示为空,而不是null。
https://stackoverflow.com/questions/2674135
复制相似问题