简体   繁体   English

在.NET中处理JAXB @XMLIDRef

[英]Handle JAXB @XMLIDRef in .NET

I'm writing a web service using jax-ws. 我正在使用jax-ws编写Web服务。 One of web service's methods returns bean, which contains reference to its parent. Web服务的一个方法返回bean,它包含对其父级的引用。 To prevent cyclic references I'm using JAXB @XMLID and @XMLIDRef annotations in my bean. 为了防止循环引用,我在bean中使用了JAXB @XMLID和@XMLIDRef注释。

Then i'm generating proxy class for java client everything works OK and id resolves to Object properties. 然后我为java客户端生成代理类一切正常,id解析为Object属性。 But then I'm generating web-service client proxy in Visual Studio for .NET, it interprets idrefs as string properties, not an Object. 但后来我在Visual Studio for .NET中生成Web服务客户端代理,它将idrefs解释为字符串属性,而不是Object。

Is it possible to generate proxy classes from wsdl for .NET with resolving of idrefs? 是否可以通过解析idrefs从wsdl for .NET生成代理类?

Out of the box Microsoft's tools won't do the job for you. 开箱即用的微软工具将无法为您完成任务。 You'll have to ask Microsoft to change the 你必须要求微软改变

wsdl generation tools. wsdl生成工具。 Eg: 例如:

In a recent project I had to work around the short comings of these tools and modified the generated code using a Basic Script fixing what was not generated the way needed (in our case incompatibilities with the Java side wsdl generation) 在最近的一个项目中,我不得不解决这些工具的缺点,并使用基本脚本修改生成的代码,修复未生成的所需方法(在我们的例子中与Java端wsdl生成不兼容)

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

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