开发者

Axis2 empty array

开发者 https://www.devze.com 2022-12-27 06:34 出处:网络
I recive null insted of empty array on the client side when my POJO axis2 method returns empty array. I understand that the problem is in WSDL.

I recive null insted of empty array on the client side when my POJO axis2 method returns empty array. I understand that the problem is in WSDL.

Is there is any way to configure axis2 to generate valid WSDL? I create axis2 service programmatically:

ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);

Map<String, Mes开发者_运维技巧sageReceiver> 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();

And anybody can give example of custom SchemaGenerator for Axis2 Services?

Thanks.


It's too late but let me answer this question. I think you did not create object inside your POJO. You might have just declared its reference. Create an object for it. Then it will show empty instead of null in the response.

0

精彩评论

暂无评论...
验证码 换一张
取 消