I'm deploying my web service via Axis in Tomcat 5.x, and am accessing its WSDL like so::
http://localhost:8081/List/services/List?wsdl
However, even with my custom serializers, my WSDL's types section isn't coming out right:
<wsdl:types>
<schema targetNamespace="http://www.trinition.org:8081/List/services/List" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://www.trinition.org/List" />
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
</schema>
<schema targetNamespace="http://www.trinition.org/List" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="ListKey">
<all>
<element name="value" type="xsd:string" />
</all>
</complexType>
<complexType name="ListOfThings">
<all>
<element name="key" type="impl:ListKey" />
</all>
</complexType>
</schema>
</wsdl:types>
See how I have two schemas? I don't know why. Here's some of my code which is generating this:
public class ListManagerAxisDelegate {
public static final String NAMESPACE = "http://www.trinition.org:8081/List/services/List";
...
}
public class ListKeySerializer implements Serializer {
public static final QName QNAME = new QName(ListManagerAxisDelegate.NAMESPACE, "ListKey");
...
public Element writeSchema(Class javaType, Types types) throws Exception {
Element complexTypeElement = types.createElement("complexType");
complexTypeElement.setAttribute("name", "ListKey"/*types.getQNameString(QNAME)*/);
Element allElement = types.createElement("all");
complexTypeElement.appendChild(allElement);
Element elementElement = types.createElement("element");
elementElement.setAttribute("name", "value");
elementElement.setAttribute("type", "xsd:string"); // WHy can't we use the types.getXXX for some QName of xsd:string?
allElement.appendChild(elementElement);
types.writeSchemaElement(ListManagerAxisDelegate.NAMESPACE, complexTypeElement);
return complexTypeElement; } }
public class ListOfThingsSerializer implements Serializer {
public static final QName QNAME = new QName(ListManagerAxisDelegate.NAMESPACE, "ListOfThings");
...
public Element writeSchema(Class javaType, Types types) throws Exception {
Element complexTypeElement = types.createElement("complexType");
complexTypeElement.setAttribute("name", "ListOfThings"/*types.getQNameString(QNAME)*/);
Element allElement = types.createElement("all");
complexTypeElement.appendChild(allElement);
Element elementElement = types.createElement("element");
elementElement.setAttribute("name", "key");
elementElement.setAttribute("type", types.getQNameString(ListKeySerializer.QNAME));
allElement.appendChild(elementElement);
types.writeSchemaElement(ListManagerAxisDelegate.NAMESPACE, complexTypeElement);
return complexTypeElement; } }
Any ideas?
Regards, Brian.