You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Maciejewski, Vincent (GMI - NY SWAPS)" <vi...@exchange.ml.com> on 2002/11/21 16:07:25 UTC

wsdl versioning problem

Hello everyone,

I trying to solve the following problem I have a class that looks something like this:

public class Security {
	
	private int securityType;
	private Object userData;
	private String label;

	[get/set methods deleted]

}

I want user data to be typeless so I can pass in some data from clients that have special knowledge of server capabilities. But I only want special clients to pass in this data. In other words I don't
want the type of userData to be known to clients in general.

As you can see this gives me a rudimentary mechanism for server API versioning. This is what I'm really after but haven't looked into it enough to provide a robust solution so I'm going with this
kludge for now.

Now the issue is that in the wsdl file axis generates

- <complexType abstract="true" name="Security">
- <sequence>
  <element name="label" nillable="true" type="xsd:string" /> 
  <element name="securityType" type="xsd:int" /> 
  <element name="userData" nillable="true" type="tns1:Object" /> 
  </sequence>

and then further down

- <complexType name="Object">
  <sequence /> 
  </complexType>

So then WSDLJava generates a class called Object. Which is somewhat undesirable but still workable. What I wanted was to see userData element declared as xsd:anyType and then have WSDL2Java use
java.lang.Object as opposed to somepackage.Object. (It takes the name of somepackage from the wsdd file).

So my questions are these:

1. How do I declare a member variable that maps to type xsd:anyType.
2. What would WSDL2Java generate when it sees xsd:anyType.
3. What techniques should I use to provide server api versioning.

Best Regards and thanks in advance for any comments.

Vincent