I'm trying to use the ?WSDL generating capabilities of Axis to generate a WSDL Consumable by a non-Axis client, Laszlo.  However is limited in that it expects the targetNamespace of the schema to be the same as the targetNamespace of the wsdl:definitions.

The wsdl:definitions targetNamespace appears to be the full path to my service:

   <wsdl:definitions targetNamespace="http://localhost:8081/List/services/List" ...

However, my schema namespace isn't so simple.  In fact, I have two schemas for some reason.  They are:

   <wsdl:types>
       <schema targetNamespace="http://localhost:8081/List/services/List" xmlns="http://www.w3.org/2001/XMLSchema">
           <import namespace="http://localhost/List" />
           <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
       </schema>
       <schema targetNamespace="http://localhost/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>

In the interest of full disclosure, I had to create custom Serializers because Laszlo also can't handle an xsd:sequence, so I'm using an xsd:all for my complexTypes.  Here's the writeSchema method for one of my types:

   public Element writeSchema(Class javaType, Types types) throws Exception {
       Element complexTypeElement = types.createElement("complexType");
       complexTypeElement.setAttribute("name", "ListKey");
             Element allElement = types.createElement("all");
       complexTypeElement.appendChild(allElement);
             Element elementElement = types.createElement("element");
       elementElement.setAttribute("name", "value");
       elementElement.setAttribute("type", "xsd:string");
       allElement.appendChild(elementElement);

       types.writeSchemaElement(ListManagerAxisDelegate.NAMESPACE, complexTypeElement);

       return complexTypeElement;
   }

And elsewhere, I have ListManagerAxisDelegate.NAMESPACE set to be:

       http://localhost:8081/List/services/List

So, I need to figure out who to get the targetNamespace of the schema with my types to match the targetNamespace of my wsdl:definitions.  The thing is, I thought I took care of that by using the writeSchemaElemnt... but that just ended up creatign an additional schema!

Any ideas?

Regards,
Brian.



Reply via email to