简体   繁体   English

在Java中将域对象映射到Web服务代理对象

[英]Mapping domain objects to web service proxy objects in Java

I am trying to find a way for mapping domain objects to web service proxy objects, generated by various Java web service stacks. 我正在尝试找到一种将域对象映射到由各种Java Web服务堆栈生成的Web服务代理对象的方法。 Both the web service (.NET) and the Java code use implementations of a particular specification. Web服务(.NET)和Java代码都使用特定规范的实现。 The specification is meant to provide very detailed description of domain classes, which should be implemented in different platforms. 该规范旨在提供有关域类的非常详细的描述,应在不同的平台中实现。 However, when a .NET implementation is exposed via a web service, the Java web service stacks end up generating WSDL based domain classes which need to be mapped to Java implementation of the domain classses, based on specification. 但是,当通过Web服务公开.NET实现时,Java Web Service堆栈最终会生成基于WSDL的域类,这些域类需要根据规范映射到域类的Java实现。 For example there are two ENTRY classes, one from the Java implementation, the other being a parameter to a web service call, and the consumers of the web service are forced to deal with creation of a WSDL ENTRY, using a Java domain class (ENTRY). 例如,有两个ENTRY类,一个来自Java实现,另一个是Web服务调用的参数,并且使用Java域类(ENTRY)迫使Web服务的使用者处理WSDL ENTRY的创建。 )。

Any recommended practices? 有什么推荐的做法吗?

Best Regards, and have a great new year! 最好的问候,祝您新年快乐!

Seref Arikan 塞里夫·阿里坎(Seref Arikan)

You can use Java mapping frameworks. 您可以使用Java映射框架。

  1. Nomin: http://nomin.sourceforge.net . 诺明(Nomin): http : //nomin.sourceforge.net It uses declarative mapping rules written in Groovy. 它使用用Groovy编写的声明性映射规则。

  2. Dozer: http://dozer.sourceforge.net . 推土机: http : //dozer.sourceforge.net Its mapping rules are supplied as XML files. 其映射规则以XML文件形式提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM