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

CLONE -Unnecessary empty-valued attribute "xmlns" in Envelope parameter values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • None
    • None
    • Windows 2000 Pro SP4 JDK 1.4.2-05

    Description

      There is a problem of interaction Axis WebService Client (as console application) with Microsoft WebService Server (as .Net application)

      Here WEBService method description is from MS side:

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <SetParameterValues xmlns="http://tempuri.org/">
      <strUser>string</strUser>
      <strBusinessSystem>string</strBusinessSystem>
      <strParameter>string</strParameter>
      <strValues>
      <string>string</string>
      <string>string</string>
      </strValues>
      </SetParameterValues>
      </soap:Body>
      </soap:Envelope>

      Here real Axis SOAP envelope is from Java applicaton:

      <?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>
      <SetParameterValues xmlns="http://tempuri.org/">
      <strUser>test</strUser>
      <strBusinessSystem>SYS</strBusinessSystem>
      <strParameter>100</strParameter>
      <strValues>
      <string xmlns="">123</string>
      <string xmlns="">234</string>
      </strValues>
      </SetParameterValues>
      </soapenv:Body>
      </soapenv:Envelope>

      As you can see in section <strValues> all of inner elements contain attribute xmlns="".
      This notation does not work in MS (It is very strange, but I don't know why).
      MS ignores all such lines and returns empty collection.
      If I'm removing empty "xmlns" attributes all works fine.

      I've already found the point where you can place fix code.

      CLASS: org.apache.axis.encoding.SerializationContext
      CODE:
      if (!(map.getNamespaceURI().equals(Constants.NS_URI_XMLNS) && map.getPrefix().equals("xmlns")) &&
      !(map.getNamespaceURI().equals(Constants.NS_URI_XML) && map.getPrefix().equals("xml")))

      It need to be added one more check in the condition. Here modified condition

      if (!(map.getNamespaceURI().equals(Constants.NS_URI_XMLNS) && map.getPrefix().equals("xmlns")) &&
      !(map.getNamespaceURI().equals(Constants.NS_URI_XML) && map.getPrefix().equals("xml")) &&
      !map.getNamespaceURI().equals(""))

      Maybe I didn't take into account something, but after this change all have worked fine.

      Attachments

        1. AuthService.wsdl
          14 kB
          Konstantin Kasatkin

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kwk_kwk Konstantin Kasatkin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: