Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2741

Duplicate wrapper element beneath soapenv:Body

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows XP, java 6 running in Eclipse 3.3

      Description

      Used axis wsdl2java to generate client code. Am attempting to send a simple message but it is being rejected as invalid for the xsd. Looked at the log and it seems there is a duplicate wrapper around the payload.

      Log message:

      =======================================================
      = Elapsed: 62 milliseconds
      = In message: <?xml version="1.0" encoding="UTF-8"?><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"><soapenv:Body><getAvailability xmlns="http://www.mycompany.com.au/schema/2005/01/basic.xsd"><getAvailability><passengerCount xmlns="">1</passengerCount><flights xmlns=""><query><departureAirport>SYD</departureAirport><arrivalAirport>MEL</arrivalAirport><departsAfterTime>2007-01-28T14:00:00.316Z</departsAfterTime></query></flights></getAvailability></getAvailability></soapenv:Body></soapenv:Envelope>
      = Out message: <?xml version="1.0" encoding="utf-8"?><soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body><soap-env:Fault>
      <faultcode>soap-env:Client.doesNotValidate</faultcode>
      <faultstring>Attempt to access element '

      {http://www.virginblue.com.au/schema/2005/02/booking.xsd}

      getAvailability' failed: No such element. Child content is [passengerCount, flights] for getAvailability at Envelope.Body.getAvailability</faultstring>
      <faultactor>http://wwwmgmt:8080/api/service</faultactor>
      </soap-env:Fault></soap-env:Body></soap-env:Envelope>
      =======================================================

      Clean this up to see the actual xml being sent is:

      <?xml version="1.0" encoding="UTF-8"?>
      <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">
      <soapenv:Body>
      <getAvailability xmlns="http://www.mycompany.com.au/schema/2005/01/basic.xsd">
      <getAvailability>
      <passengerCount xmlns="">1</passengerCount>
      <flights xmlns="">
      <query>
      <departureAirport>SYD</departureAirport>
      <arrivalAirport>MEL</arrivalAirport>
      <departsAfterTime>2007-01-28T14:00:00.316Z</departsAfterTime>
      </query>
      </flights>
      </getAvailability>
      </getAvailability>
      </soapenv:Body>
      </soapenv:Envelope>

      This shows that getAvailability is being included twice, without a namespace. However comparing this against what our old manual code would send:

      <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">
      <soapenv:Body>
      <my:getAvailability xmlns:my="http://www.mycompany.com.au/schema/2005/01/basic.xsd">
      <passengerCount>1</passengerCount>
      <flights>
      <query>
      <departureAirport>SYD</departureAirport>
      <arrivalAirport>MEL</arrivalAirport>
      <departsAfterTime>2007-01-28T14:00:00.316Z</departsAfterTime>
      </query>
      </flights>
      </my:getAvailability>
      </soapenv:Body>
      </soapenv:Envelope>

      The xsd reguarding this element (from basic.xsd) is:

      <xsd:element name="getAvailability">
      <xsd:complexType>
      <xsd:all>
      <xsd:element name="passengerCount" type="xsd:positiveInteger" minOccurs="0"/>
      <xsd:element name="flights">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="query" type="com:AvailabilityQuery" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:all>
      </xsd:complexType>
      </xsd:element>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nathanvb Nathan McDonald
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: