title: Apache Axis: no containing element
body: <p>I received the following WSDL from a vendor.  The sample service behind it runs on Microsoft .NET.  I need to create a web service in Java based on this WSDL.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
  xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
  xmlns:tns="http://www.somecompany.com/" 
  xmlns:s="http://www.w3.org/2001/XMLSchema" 
  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
  targetNamespace="http://www.somecompany.com/" 
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
    &lt;wsdl:types&gt;
      &lt;s:schema elementFormDefault="qualified" targetNamespace="http://www.somecompany.com/"&gt;
      &lt;s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" /&gt;
        &lt;s:element name="getInventoryStatus"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="DealerCode" type="s:string" /&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="SupplierCode" type="s:string" /&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="PartNumber" type="s:string" /&gt;
              &lt;s:element minOccurs="1" maxOccurs="1" name="Quantity" type="s:int" /&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="DeliveryLocation" type="s:string" /&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
        &lt;s:element name="getInventoryStatusResponse"&gt;
          &lt;s:complexType&gt;
            &lt;s:sequence&gt;
              &lt;s:element minOccurs="0" maxOccurs="1" name="getInventoryStatusResult"&gt;
                &lt;s:complexType&gt;
                  &lt;s:sequence&gt;
                    &lt;s:element ref="s:schema" /&gt;
                    &lt;s:any /&gt;
                  &lt;/s:sequence&gt;
                &lt;/s:complexType&gt;
              &lt;/s:element&gt;
            &lt;/s:sequence&gt;
          &lt;/s:complexType&gt;
        &lt;/s:element&gt;
      &lt;/s:schema&gt;
    &lt;/wsdl:types&gt;
    &lt;wsdl:message name="getInventoryStatusSoapIn"&gt;
      &lt;wsdl:part name="parameters" element="tns:getInventoryStatus" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name="getInventoryStatusSoapOut"&gt;
      &lt;wsdl:part name="parameters" element="tns:getInventoryStatusResponse" /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:portType name="InventoryInquirySoap"&gt;
      &lt;wsdl:operation name="getInventoryStatus"&gt;
        &lt;wsdl:input message="tns:getInventoryStatusSoapIn" /&gt;
        &lt;wsdl:output message="tns:getInventoryStatusSoapOut" /&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
    &lt;wsdl:binding name="InventoryInquirySoap" type="tns:InventoryInquirySoap"&gt;
      &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
      &lt;wsdl:operation name="getInventoryStatus"&gt;
        &lt;soap:operation soapAction="http://www.somecompany.com/getInventoryStatus" style="document" /&gt;
        &lt;wsdl:input&gt;
          &lt;soap:body use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:service name="InventoryInquiry"&gt;
      &lt;wsdl:port name="InventoryInquirySoap" binding="tns:InventoryInquirySoap"&gt;
        &lt;soap:address location="http://www.somecompany.com/InventoryInquiry.asmx" /&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p>I modified the WSDL I received to include the following line so that Eclipse would recognize the WSDL as valid:</p>
  
  <pre><code>&lt;s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" /&gt;  &lt;!--  added for Eclipse--&gt;
  </code></pre>
  
  <p>I've included this WSDL file in a new Dynamic Web Project.  I used the New Web Service wizard to create a new top down web service based on the WSDL.</p>
  
  <p>When I deploy the project to Tomcat and call the web service, Apache Axis reports back the following:</p>
  
  <blockquote>
    <p>AXIS error</p>
    
    <p>Sorry, something seems to have gone wrong... here are the details:</p>
    
    <p>Fault - makeTypeElement() was told to create a type
    "{<a href="http://www.somecompany.com/" rel="noreferrer">http://www.somecompany.com/</a>}>>getInventoryStatusResponse>getInventoryStatusResult",
    with no containing element</p>
    
    <p>AxisFault  faultCode:
    {<a href="http://schemas.xmlsoap.org/soap/envelope/" rel="noreferrer">http://schemas.xmlsoap.org/soap/envelope/</a>}Server.generalException 
    faultSubcode:   faultString: makeTypeElement() was told to create a
    type
    "{<a href="http://www.somecompany.com/" rel="noreferrer">http://www.somecompany.com/</a>}>>getInventoryStatusResponse>getInventoryStatusResult",
    with no containing element  faultActor:   faultNode:   faultDetail: 
      {<a href="http://xml.apache.org/axis/" rel="noreferrer">http://xml.apache.org/axis/</a>}hostname:HOME-DELL</p>
  </blockquote>
  
  <p>The demo web service provided by the vendor returns the following:</p>
  
  <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
     &lt;soap:Body&gt;
        &lt;GetInventoryStatusResponse xmlns="http://ctire.aktion.com/"&gt;
           &lt;GetInventoryStatusResult&gt;
              &lt;xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
                 &lt;xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt;
                    &lt;xs:complexType&gt;
                       &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
                          &lt;xs:element name="InventoryStatus"&gt;
                             &lt;xs:complexType&gt;
                                &lt;xs:sequence&gt;
                                   &lt;xs:element name="InStock" type="xs:int" minOccurs="0"/&gt;
                                   &lt;xs:element name="EstDeliveryDate" type="xs:string" minOccurs="0"/&gt;
                                   &lt;xs:element name="EstDeliveryTime" type="xs:string" minOccurs="0"/&gt;
                                   &lt;xs:element name="DeliveryLocation" type="xs:string" minOccurs="0"/&gt;
                                &lt;/xs:sequence&gt;
                             &lt;/xs:complexType&gt;
                          &lt;/xs:element&gt;
                       &lt;/xs:choice&gt;
                    &lt;/xs:complexType&gt;
                 &lt;/xs:element&gt;
              &lt;/xs:schema&gt;
              &lt;diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"&gt;
                 &lt;NewDataSet xmlns=""&gt;
                    &lt;InventoryStatus diffgr:id="InventoryStatus1" msdata:rowOrder="0" diffgr:hasChanges="inserted"&gt;
                       &lt;InStock&gt;36&lt;/InStock&gt;
                       &lt;EstDeliveryDate&gt;09/27/2016&lt;/EstDeliveryDate&gt;
                       &lt;EstDeliveryTime&gt;12:00 PM&lt;/EstDeliveryTime&gt;
                       &lt;DeliveryLocation&gt;883620750&lt;/DeliveryLocation&gt;
                    &lt;/InventoryStatus&gt;
                 &lt;/NewDataSet&gt;
              &lt;/diffgr:diffgram&gt;
           &lt;/GetInventoryStatusResult&gt;
        &lt;/GetInventoryStatusResponse&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>I think I need to reference a schema for the NewDataSet in the WSDL, but I'm not sure how to do that.</p>