title: SOAP - response XML unique tag
body: <p>I am creating the web-service with the use of SOAP &amp; WSDL. After creating WSDL I am generating the "Java bean skeleton" using eclipse. From the generated stubs I can able to call the web-service from IOS app.
  In the web-service response I am returning the complex data type to the user. The problem is, 
  <strong>I am getting the unique response tag for the complex type as given below.</strong></p>
  
  <p><strong>My WSDL is,</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://service.cmp.app.com" xmlns:intf="http://service.cmp.app.com" xmlns:tns1="http://request.cmp.app.com" xmlns:tns2="http://response.cmp.app.com" xmlns:tns3="http://bean.cmp.app.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.cmp.app.com"&gt;
      &lt;!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 
          PDT) --&gt;
      &lt;wsdl:types&gt;
          &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://service.cmp.app.com"&gt;
              &lt;import namespace="http://response.cmp.app.com"/&gt;
              &lt;import namespace="http://request.cmp.app.com"/&gt;
              &lt;import namespace="http://bean.cmp.app.com"/&gt;
              &lt;element name="ViewAppTrack"&gt;
                  &lt;complexType&gt;
                      &lt;sequence&gt;
                          &lt;element name="ViewAppTrackRequest" type="tns1:ViewAppTrackRequest"/&gt;
                      &lt;/sequence&gt;
                  &lt;/complexType&gt;
              &lt;/element&gt;
              &lt;element name="ViewAppTrackResponse"&gt;
                  &lt;complexType&gt;
                      &lt;sequence&gt;
                          &lt;element name="ViewAppTrackResponseReturn" type="tns2:ViewAppTrackResponse"/&gt;
                      &lt;/sequence&gt;
                  &lt;/complexType&gt;
              &lt;/element&gt;
              &lt;complexType name="ArrayOf_tns3_MonthListBO"&gt;
                  &lt;sequence&gt;
                      &lt;element maxOccurs="unbounded" minOccurs="0" name="monthListItem" type="tns3:MonthListBO"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
              &lt;complexType name="ArrayOf_tns3_TaskListBO"&gt;
                  &lt;sequence&gt;
                      &lt;element maxOccurs="unbounded" minOccurs="0" name="taskListItem" type="tns3:TaskListBO"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
          &lt;/schema&gt;
          &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://request.cmp.app.com"&gt;
              &lt;import namespace="http://response.cmp.app.com"/&gt;
              &lt;import namespace="http://service.cmp.app.com"/&gt;
              &lt;import namespace="http://bean.cmp.app.com"/&gt;
              &lt;complexType name="ViewAppTrackRequest"&gt;
                  &lt;sequence&gt;
                      &lt;element name="userId" nillable="true" type="xsd:string"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
          &lt;/schema&gt;
          &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://bean.cmp.app.com"&gt;
              &lt;import namespace="http://response.cmp.app.com"/&gt;
              &lt;import namespace="http://service.cmp.app.com"/&gt;
              &lt;import namespace="http://request.cmp.app.com"/&gt;
              &lt;complexType name="MonthListBO"&gt;
                  &lt;sequence&gt;
                      &lt;element name="date" nillable="true" type="xsd:string"/&gt;
                      &lt;element name="lockStatus" nillable="true" type="xsd:string"/&gt;
                      &lt;element name="dailyTime" nillable="true" type="xsd:string"/&gt;
                      &lt;element name="taskListNew" nillable="true" type="impl:ArrayOf_tns3_TaskListBO"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
              &lt;complexType name="TaskListBO"&gt;
                  &lt;sequence&gt;
                      &lt;element name="trackId" type="xsd:int"/&gt;
                      &lt;element name="taskId" type="xsd:int"/&gt;
                      &lt;element name="trackDate" nillable="true" type="xsd:string"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
          &lt;/schema&gt;
          &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://response.cmp.app.com"&gt;
              &lt;import namespace="http://service.cmp.app.com"/&gt;
              &lt;import namespace="http://request.cmp.app.com"/&gt;
              &lt;import namespace="http://bean.cmp.app.com"/&gt;
              &lt;complexType name="ViewAppTrackResponse"&gt;
                  &lt;sequence&gt;
                      &lt;element name="monthBO" nillable="true" type="impl:ArrayOf_tns3_MonthListBO"/&gt;
                      &lt;element name="userId" nillable="true" type="xsd:string"/&gt;
                      &lt;element name="projectId" nillable="true" type="xsd:string"/&gt;
                      &lt;element name="customerId" nillable="true" type="xsd:string"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
          &lt;/schema&gt;
      &lt;/wsdl:types&gt;
  
      &lt;wsdl:message name="ViewAppTrackRequest"&gt;
  
          &lt;wsdl:part element="impl:ViewAppTrack" name="parameters"&gt;
  
          &lt;/wsdl:part&gt;
  
      &lt;/wsdl:message&gt;
  
      &lt;wsdl:message name="ViewAppTrackResponse"&gt;
  
          &lt;wsdl:part element="impl:ViewAppTrackResponse" name="parameters"&gt;
  
          &lt;/wsdl:part&gt;
  
      &lt;/wsdl:message&gt;
  
      &lt;wsdl:portType name="AppWeb"&gt;
  
          &lt;wsdl:operation name="ViewAppTrack"&gt;
  
              &lt;wsdl:input message="impl:ViewAppTrackRequest" name="ViewAppTrackRequest"&gt;
  
              &lt;/wsdl:input&gt;
  
              &lt;wsdl:output message="impl:ViewAppTrackResponse" name="ViewAppTrackResponse"&gt;
  
              &lt;/wsdl:output&gt;
  
          &lt;/wsdl:operation&gt;
  
      &lt;/wsdl:portType&gt;
  
      &lt;wsdl:binding name="AppWebSoapBinding" type="impl:AppWeb"&gt;
  
          &lt;wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  
          &lt;wsdl:operation name="ViewAppTrack"&gt;
  
              &lt;wsdlsoap:operation soapAction=""/&gt;
  
              &lt;wsdl:input name="ViewAppTrackRequest"&gt;
  
                  &lt;wsdlsoap:body use="literal"/&gt;
  
              &lt;/wsdl:input&gt;
  
              &lt;wsdl:output name="ViewAppTrackResponse"&gt;
  
                  &lt;wsdlsoap:body use="literal"/&gt;
  
              &lt;/wsdl:output&gt;
  
          &lt;/wsdl:operation&gt;
  
      &lt;/wsdl:binding&gt;
  
      &lt;wsdl:service name="AppWebService"&gt;
  
          &lt;wsdl:port binding="impl:AppWebSoapBinding" name="AppWeb"&gt;
  
              &lt;wsdlsoap:address location="http://localhost:8080/test/services/AppWeb"/&gt;
  
          &lt;/wsdl:port&gt;
  
      &lt;/wsdl:service&gt;
  
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p><strong>And my request XML is,</strong></p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.cmp.app.com" xmlns:req="http://request.cpm.app.com"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;ser:ViewAppTrack&gt;
           &lt;ser:ViewAppTrackRequest&gt;
              &lt;req:userId&gt;5&lt;/req:userId&gt;
           &lt;/ser:ViewAppTrackRequest&gt;
        &lt;/ser:ViewAppTrack&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p><strong>The following response I am getting,</strong></p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
     &lt;soapenv:Body&gt;
        &lt;ViewAppTrackResponse xmlns="http://service.cmp.app.com"&gt;
           &lt;ViewAppTrackResponseReturn&gt;
              &lt;ns1:monthBO xmlns:ns1="http://response.cmp.app.com"&gt;
                 &lt;monthListItem&gt;
                    &lt;ns2:date xmlns:ns2="http://bean.cmp.app.com"&gt;1-2-2014, Saturday (nonworking day)&lt;/ns2:date&gt;
                    &lt;ns3:lockStatus xmlns:ns3="http://bean.cmp.app.com"&gt;N&lt;/ns3:lockStatus&gt;
                    &lt;ns4:dailyTime xsi:nil="true" xmlns:ns4="http://bean.cmp.app.com"/&gt;
                    &lt;ns5:taskListNew xsi:nil="true" xmlns:ns5="http://bean.cmp.app.com"/&gt;
                 &lt;/monthListItem&gt;
                 &lt;monthListItem&gt;
                    &lt;ns6:date xmlns:ns6="http://bean.cmp.app.com"&gt;2-2-2014, Sunday (nonworking day)&lt;/ns6:date&gt;
                    &lt;ns7:lockStatus xmlns:ns7="http://bean.cmp.app.com"&gt;N&lt;/ns7:lockStatus&gt;
                    &lt;ns8:dailyTime xmlns:ns8="http://bean.cmp.app.com"&gt;04:00&lt;/ns8:dailyTime&gt;
                    &lt;ns9:taskListNew xmlns:ns9="http://bean.cmp.app.com"&gt;
                       &lt;taskListItem&gt;
                          &lt;ns9:trackId&gt;1070&lt;/ns9:trackId&gt;
                          &lt;ns9:taskId&gt;14&lt;/ns9:taskId&gt;
                       &lt;/taskListItem&gt;
                       &lt;taskListItem&gt;
                          &lt;ns9:trackId&gt;1094&lt;/ns9:trackId&gt;
                          &lt;ns9:taskId&gt;44&lt;/ns9:taskId&gt;
                       &lt;/taskListItem&gt;
                    &lt;/ns9:taskListNew&gt;
                 &lt;/monthListItem&gt;
                 &lt;monthListItem&gt;
                    &lt;ns10:date xmlns:ns10="http://bean.cmp.app.com"&gt;3-2-2014, Monday&lt;/ns10:date&gt;
                    &lt;ns11:lockStatus xmlns:ns11="http://bean.cmp.app.com"&gt;N&lt;/ns11:lockStatus&gt;
                    &lt;ns12:dailyTime xmlns:ns12="http://bean.cmp.app.com"&gt;08:00&lt;/ns12:dailyTime&gt;
                    &lt;ns13:taskListNew xmlns:ns13="http://bean.cmp.app.com"&gt;
                       &lt;taskListItem&gt;
                          &lt;ns13:trackId&gt;1071&lt;/ns13:trackId&gt;
                          &lt;ns13:taskId&gt;14&lt;/ns13:taskId&gt;
                       &lt;/taskListItem&gt;
                       &lt;taskListItem&gt;
                          &lt;ns13:trackId&gt;1073&lt;/ns13:trackId&gt;
                          &lt;ns13:taskId&gt;44&lt;/ns13:taskId&gt;
                         &lt;/taskListItem&gt;
                    &lt;/ns13:taskListNew&gt;
                 &lt;/monthListItem&gt;
              &lt;/ns1:monthBO&gt;
              &lt;ns14:userId xsi:nil="true" xmlns:ns114="http://response.cmp.app.com"/&gt;5&lt;/ns14:userId&gt;
           &lt;/ViewAppTrackResponseReturn&gt;
        &lt;/ViewAppTrackResponse&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>The problem:
      I am getting the above XML response as same tag like monthListItem, taskListItem.   </p>
  
  <blockquote>
  <pre><code>(i.e,) monthBO -&gt; 
          monthListItem -&gt; taskListItem, taskListItem, etc..., 
          monthListItem -&gt; taskListItem, taskListItem, etc...,
          monthListItem -&gt; taskListItem, taskListItem, etc...,
          etc...
  </code></pre>
  </blockquote>
  
  <p><strong>Can I change the response like below. So that I can parse this response from IOS.</strong></p>
  
  <blockquote>
  <pre><code>(i.e,) monthBO -&gt; 
          monthListItem1 -&gt; taskListItem1, taskListItem2 
          monthListItem2 -&gt; taskListItem3, taskListItem4
          monthListItem3 -&gt; taskListItem5, taskListItem6
          etc...
  </code></pre>
  </blockquote>
  
  <p><strong>Or is it possible to parse the complex type response data in IOS?</strong></p>