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

Wrong SOAP message element returned when multiple elements have the same "id" value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Window XP, JDK1.5

      Description

      Below is a response SOAP message returned from a third party web service. This message was caught by using TCPMon, and it looks pretty good based on WSDL. The Java code was generated using WSDL2Java Ant task against Axis 1.4. The request was sent to web service using the generated stub code.

      The expected result is Axis should return an object of type ResponseRecord, but what I got is ClassCastException. It complains the casting from StreetData to ResponseRecord.

      After doing some debugging against the Axis 1.4 source code, I found that the reason for this problem is there are three elements with "id" attributes:

      1. ResponseRecord: id = 1
      2. StreetData: id = 1
      3. StreetData: id = 2

      Somehow, Axis uses this id" as the key to Map. After finishing processing, the StreetData record with id = 1 overwrite the ResponseRecord data, which also has id = 1. Therefore, the actual returned object is StreetData, not the expected ResponseRecord.

      There is no any problem with the seconde SOAP message below.

      Thanks,
      Mike

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <doSingleRecordResponse xmlns="urn:mdWebService">
      <doSingleRecordResult xsi:type="ResponseRecord" id="1" version="2.10" action="Response" timeout="10" timestamp="09-12-2007" transmissionReference="9df70e57-208b-4324-88e1-34bd7a979f5c" TimeToProcess="62.4948">
      <CustomerCredentials>
      <CustomerID>114004255</CustomerID>
      </CustomerCredentials>
      <ServiceResult>
      <ErrorCode> </ErrorCode>
      <ErrorDesc>OK;</ErrorDesc>
      </ServiceResult>
      <Address version="2.10">
      <Faults count="0" />
      <Result>
      <ErrorCode> </ErrorCode>
      <ErrorDesc>OK</ErrorDesc>
      <StatusCode>9</StatusCode>
      <StatusDesc>(U.S.) The address was fully coded.</StatusDesc>
      </Result>
      <Company />
      <Urbanization>
      <Name />
      </Urbanization>
      <Type>
      <String>Street</String>
      <Code>S</Code>
      </Type>
      <Street>1675 Ursula St</Street>
      <Street2 />
      <Suite />
      <PrivateMailBox />
      <CarrierRoute>C001</CarrierRoute>
      <Lacs> </Lacs>
      <DeliveryPointCode>75</DeliveryPointCode>
      <DeliveryPointCheckDigit>8</DeliveryPointCheckDigit>
      <City>
      <Name>Aurora</Name>
      <Abbreviation>Aurora</Abbreviation>
      </City>
      <County>
      <Name>Adams</Name>
      <Fips>08001</Fips>
      </County>
      <State>
      <Name>Colorado</Name>
      <Abbreviation>CO</Abbreviation>
      </State>
      <Zip>
      <Type> </Type>
      <Zip5>80045</Zip5>
      <Plus4>7402</Plus4>
      </Zip>
      <Parsed>
      <StreetName>Ursula</StreetName>
      <AddressRange>1675</AddressRange>
      <Suffix>St</Suffix>
      <Direction>
      <Post />
      <Pre />
      </Direction>
      <Suite>
      <Name />
      <Range />
      </Suite>
      <PrivateMailBox>
      <Name />
      <Range />
      </PrivateMailBox>
      <Garbage />
      </Parsed>
      <Country>
      <Abbreviation>US</Abbreviation>
      <Name>United States of America</Name>
      </Country>
      </Address>
      <StreetData count="2" version="2.10">
      <Faults />
      <Result>
      <ErrorCode> </ErrorCode>
      <ErrorDesc>OK</ErrorDesc>
      </Result>
      <Record id="1">
      <Company />
      <Urbanization>
      <Code />
      </Urbanization>
      <AddressType>S</AddressType>
      <BaseAlternateIndicator>B</BaseAlternateIndicator>
      <Street>
      <Name>URSULA</Name>
      <Suffix>CT</Suffix>
      <Suite>
      <Name />
      <High />
      <Low />
      <OddEven> </OddEven>
      </Suite>
      </Street>
      <CarrierRoute>C034</CarrierRoute>
      <CongressionalDistrict>
      <Code>07</Code>
      </CongressionalDistrict>
      <County>
      <Fips>08005</Fips>
      </County>
      <Lacs> </Lacs>
      <LastLineNumber>Z11053</LastLineNumber>
      <Direction>
      <Post />
      <Pre>S</Pre>
      </Direction>
      <PrimaryRange>
      <High>0000001699</High>
      <Low>0000001600</Low>
      <OddEven>B</OddEven>
      </PrimaryRange>
      <Zip>
      <Zip5>80012</Zip5>
      <Plus4>
      <High>5347</High>
      <Low>5347</Low>
      </Plus4>
      </Zip>
      </Record>
      <Record id="2">
      <Company />
      <Urbanization>
      <Code />
      </Urbanization>
      <AddressType>S</AddressType>
      <BaseAlternateIndicator>B</BaseAlternateIndicator>
      <Street>
      <Name>URSULA</Name>
      <Suffix>ST</Suffix>
      <Suite>
      <Name />
      <High />
      <Low />
      <OddEven> </OddEven>
      </Suite>
      </Street>
      <CarrierRoute>C001</CarrierRoute>
      <CongressionalDistrict>
      <Code>07</Code>
      </CongressionalDistrict>
      <County>
      <Fips>08001</Fips>
      </County>
      <Lacs> </Lacs>
      <LastLineNumber>Z11053</LastLineNumber>
      <Direction>
      <Post />
      <Pre />
      </Direction>
      <PrimaryRange>
      <High>0000001699</High>
      <Low>0000001601</Low>
      <OddEven>O</OddEven>
      </PrimaryRange>
      <Zip>
      <Zip5>80045</Zip5>
      <Plus4>
      <High>7402</High>
      <Low>7402</Low>
      </Plus4>
      </Zip>
      </Record>
      </StreetData>
      <Telephone>
      <Result />
      </Telephone>
      <Name>
      <Result />
      </Name>
      </doSingleRecordResult>
      </doSingleRecordResponse>
      </soap:Body>
      </soap:Envelope>

      Axis working fine with this response SOAP message:

      ?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <doSingleRecordResponse xmlns="urn:mdWebService">
      <doSingleRecordResult xsi:type="ResponseRecord" id="1" version="2.10" action="Response" timeout="10" timestamp="09-12-2007" transmissionReference="c1bf430e-614f-4404-851e-fa01902a0a65" TimeToProcess="15.6248">
      <CustomerCredentials>
      <CustomerID>114004255</CustomerID>
      </CustomerCredentials>
      <ServiceResult>
      <ErrorCode>900</ErrorCode>
      <ErrorDesc>OK;GENERAL_ERROR::Address was not coded. #1;</ErrorDesc>
      </ServiceResult>
      <Address version="2.10">
      <Faults count="0" />
      <Result>
      <ErrorCode>R</ErrorCode>
      <ErrorDesc>Range Error</ErrorDesc>
      <StatusCode>X</StatusCode>
      <StatusDesc>Address was not coded.</StatusDesc>
      </Result>
      <Company />
      <Urbanization>
      <Name />
      </Urbanization>
      <Type>
      <String />
      <Code> </Code>
      </Type>
      <Street>RIVER ROAD</Street>
      <Street2 />
      <Suite />
      <PrivateMailBox />
      <CarrierRoute />
      <Lacs> </Lacs>
      <DeliveryPointCode />
      <DeliveryPointCheckDigit> </DeliveryPointCheckDigit>
      <City>
      <Name>North Bergen</Name>
      <Abbreviation>North Bergen</Abbreviation>
      </City>
      <County>
      <Name>Hudson</Name>
      <Fips>34017</Fips>
      </County>
      <State>
      <Name>New Jersey</Name>
      <Abbreviation>NJ</Abbreviation>
      </State>
      <Zip>
      <Type> </Type>
      <Zip5>07047</Zip5>
      <Plus4 />
      </Zip>
      <Parsed>
      <StreetName>River</StreetName>
      <AddressRange />
      <Suffix>Rd</Suffix>
      <Direction>
      <Post />
      <Pre />
      </Direction>
      <Suite>
      <Name />
      <Range />
      </Suite>
      <PrivateMailBox>
      <Name />
      <Range />
      </PrivateMailBox>
      <Garbage />
      </Parsed>
      <Country>
      <Abbreviation>US</Abbreviation>
      <Name>United States of America</Name>
      </Country>
      </Address>
      <Telephone>
      <Result />
      </Telephone>
      <Name>
      <Result />
      </Name>
      </doSingleRecordResult>
      </doSingleRecordResponse>
      </soap:Body>
      </soap:Envelope>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mike hao Mike Hao
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: