dynamically defined webmethod arguments

Short introduction. There is a production system where some independent clients "invent" some objects with some properties and behavior - one can assign some values to these objects, launch them into action and read their state upon/while execution. Everything's via web interface: client logs in, assigns values, injects objects, launches container and sees his objects mutating. Everything is based on client's JAXB-compliant schema. Schema is compiled into Java classes and packaged as client's jar. (Many thanks to stackoverflow members who helped me to do it on the fly). And here is the problem: they want webservice (SOAP) doing all they currently do via web-interface. And, of course, with wsdl types according to JAXB schema they dynamically change and deploy on the daily basis :( Actually, all the operations they do via web are: 1. Start/stop application container (common task, not a problem) 2. Inject client-defined object into container 3. Retrieve objects of specific type from container "3" is not an issue once "2" is ok. But "2" is driving me mad and I need your advice BEFORE I start doing something. In terms of WebService my question is: **How do I publish WS endpoint with following method, assuming that argument type is defined by client's JAXB schema**: @WebMethod public void inject(UserDefinedObject obj) { getAppContainer().inject(obj); // that's all I have to implement } Here are approaches I'm thinking of: 1. Use Object as argument: `public void inject(Object obj);` and code `ServletFilter` to modify xml request/response according to client's schema. But I'm not sure WS servlet will not check method signature and throw exceptions in that case. Another question is whether I will have access to request's xml from within that method to perform JAXB unmarshalling. 2. As I'm already compiling client jars, I could also compile webservice endpoints and deploy them dynamically as OSGI bundles. I'm absolutely new to OSGI, too many questions here: is it possible at all, what about my ear, do I need to make all as OSGI, how to communicate with EJB, etc, etc. 3. More googling, but I'm afraid Brin & Page will start charging me. Any other ideas?

以上就是dynamically defined webmethod arguments的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准