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.
精彩评论