简体   繁体   English

带有Java和C#的SOAP-客户端对象处理

[英]SOAP with Java and C# - Clientside Object Handling

When I use SOAP, can I have complex datatypes as returnvalues or parameters 当我使用SOAP时,能否将复杂的数据类型用作返回值或参数

example: 例:

@WebMethod(operationName = "getMyDataType")
public MyDataType getMyDataType(@WebParam(name = "username") String username, @WebParam(name = "password") String password) {  return new MyDatatype(bla)}

and if yes, how can the client work with the "unknown" types? 如果是,客户端如何使用“未知”类型?

my server is in Java and the Client in c# 我的服务器使用Java,客户端使用c#

尽管我还没有尝试过,但这应该是可能的:您可以尝试从带注释的Java类生成WSDL,然后再从WSDL文件生成客户端C#代码。

It should work both ways. 它应该同时起作用。 What will happen is that the IDE (or you) will create a custom type in each language that can be serialized/deserialized into SOAP XML. 将会发生的事情是,IDE(或您)将使用每种语言创建一个自定义类型,该类型可以序列化/反序列化为SOAP XML。 I know VS will auto-generate classes from a WSDL; 我知道VS将通过WSDL自动生成类; Java doesn't have one specific dev environment, but I would suspect some of the more popular ones like Eclipse might. Java没有特定的开发环境,但是我怀疑像Eclipse这样的一些更流行的环境可能会出现。

Like HTML, SOAP is an open standard specifically designed to allow differing implementations of the standard to work with each other. 像HTML一样,SOAP是一个开放标准,专门设计用于允许该标准的不同实现相互配合。 I have no doubt you can get this to work; 我毫不怀疑,您可以使它起作用。 I'm just a bit light on the Java specifics. 我只是稍微了解一下Java的细节。

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

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