JBoss Web 服务与 ASP.NET 的互操作性
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非原始数据类型可以选择为空,可能是出于性能原因。添加了一个额外的布尔属性
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.