JBoss Web 服务与 ASP.NET 的互操作性

发布于 2024-09-06 12:54:16 字数 470 浏览 5 评论 0原文

我在 JBoss 4.2.3 上部署了一个 Web 服务。 Web 服务是使用 EJB3 @WebService 注释创建的。其中一种方法需要一个具有 java.util.Date 属性的对象

public void createUser(UserDTO dto) throws FancyException{
    //-- do some work here
}

class UserDTO {
    .....
    private Date joined;

    //-- appropriate setters
}

我有 2 个客户端,Axis 生成的客户端和 ASP.NET 生成的客户端。

来自 Axis 客户端的调用正常,即日期对象具有客户端设置的值。

来自 ASP.NET 客户端的调用不会发送客户端设置的日期,即 joined 为 null。

I have a Web Service deployed on JBoss 4.2.3. The Web Service is created using the EJB3 @WebService annotation. One of the method requires an object which has a java.util.Date property

public void createUser(UserDTO dto) throws FancyException{
    //-- do some work here
}

class UserDTO {
    .....
    private Date joined;

    //-- appropriate setters
}

I have 2 clients, Axis generated client and ASP.NET generated client.

Calls from the Axis client are Ok, i.e. the date object has the value set by the client.

Calls from the ASP.NET client do not send the date set by the client, i.e. joined is null.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽手叙旧 2024-09-13 12:54:16

非原始数据类型可以选择为空,可能是出于性能原因。添加了一个额外的布尔属性 propertySpecified,它将指示 ASP.NET 在在线序列化属性时包含该属性。通过将其设置为 true,相应的变量也会被序列化。

包含一些 您可能会找到对于同一主题很有用

另一种方法是确保属性是必需的。

Non primitive datatypes have the option of being nullable, maybe for performance reasons. An extra boolean property propertySpecified is added that will instruct ASP.NET to include the attribute when serializing it down the wire. By setting this to true the corresponding variable is serialized as well.

Included are some links you might find useful on the same subject.

Another way would be to make sure the attributes are required.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文