开发者

SOAP with Java and C# - Clientside Object Handling

开发者 https://www.devze.com 2023-02-12 04:15 出处:网络
When I use SOAP, can I have complex datatypes as returnvalues or parameters example: @WebMethod(operationName = \"getMyDataType\")

When I use SOAP, can I have complex datatypes as returnvalues or parameters

example:

@WebMethod(operationName = "getMyDataType")
public MyDataType getMyDataType(@WebParam(name = "usernam开发者_JS百科e") 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#


This should be possible, although I haven't tried it: You can try to generate WSDL from annotated Java class and later from the WSDL file generate client C# code.


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. I know VS will auto-generate classes from a WSDL; Java doesn't have one specific dev environment, but I would suspect some of the more popular ones like Eclipse might.

Like HTML, SOAP is an open standard specifically designed to allow differing implementations of the standard to work with each other. I have no doubt you can get this to work; I'm just a bit light on the Java specifics.

0

精彩评论

暂无评论...
验证码 换一张
取 消