处理JAXB @XMLIDRef在.NET [英] Handle JAXB @XMLIDRef in .NET

查看:200
本文介绍了处理JAXB @XMLIDRef在.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写使用JAX-WS Web服务。一个Web服务的方法返回的bean,其中包含引用其父。为prevent循环引用我用我的豆JAXB @XMLID和@XMLIDRef注解。

I'm writing a web service using jax-ws. One of web service's methods returns bean, which contains reference to its parent. To prevent cyclic references I'm using JAXB @XMLID and @XMLIDRef annotations in my bean.

然后我生成代理类Java客户端一切正常确定,ID解析为对象的属性。但后来我生成Web服务客户端代理在Visual Studio对于.NET,它除$ P $点IDREFS作为字符串属性,而不是一个对象。

Then i'm generating proxy class for java client everything works OK and id resolves to Object properties. But then I'm generating web-service client proxy in Visual Studio for .NET, it interprets idrefs as string properties, not an Object.

是否有可能生成WSDL的.NET代理类与解决IDREFS的?

Is it possible to generate proxy classes from wsdl for .NET with resolving of idrefs?

推荐答案

开箱即用微软的工具不会为你做的工作。你得要求微软修改

Out of the box Microsoft's tools won't do the job for you. You'll have to ask Microsoft to change the

WSDL生成工具。例如:

wsdl generation tools. E.g.:

  • wsdl.exe: http://msdn.microsoft.com/library/7h3ystb6(VS.80).aspx
  • svcutil.exe: http://msdn.microsoft.com/en-us/library/aa347733.aspx

在最近的一个项目,我不得不解决这些工具的短期缺憾和修改使用Basic脚本生成的code固定什么没有产生所需要的方式(在我们的例子中不兼容的Java端WSDL生成)

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)

这篇关于处理JAXB @XMLIDRef在.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆