Previous Topic: "JVM - JNI code: -1(JNI_ERR)" Errors in Policy Server Log (68569)

Next Topic: Operation-Level Policy Changes Not Committed In Certain Situation When Configuring Application Policy From WSDL (69006)

SOA Agents Reject Messages Where Namespace is Defined Outside of Parent Element (72912)

SOA Agents reject XML messages in which XML namespace (xmlns) attributes are not defined within the immediate parent of the element or elements in which they are referenced. For example, though well formed, the following XML message in which the xmlns attribute is defined in the SOAP envelope will fail authentication:

<soapenv:Envelope
 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:axis="http://axishello">
    <soapenv:Header/>
    <soapenv:Body>
       <axis:securedAdd>
          <axis:name>superuser</axis:name>
          <axis:password>pwd</axis:password>
          <axis:x>3</axis:x>
          <axis:y>5</axis:y>
       </axis:securedAdd>
    </soapenv:Body>
 </soapenv:Envelope>

In this case, the following error will be written in the SOA Agent log:

XPath exception during achedXPathAPI.eval 
of: /axis:securedAdd/axis:password javax.xml.transform.TransformerException javax.xml.transform.TransformerException: Prefix must resolve to a namespace: axis

Workaround

To ensure successful authentication, a namespace attribute must be defined no further away than the immediate parent of the element or elements in which it is used, even when that namespace is defined earlier in an XML message (for example, in the SOAP envelope definition).

For example, the following reformed version of the previous XML message will be accepted by the SOA Agent:

<soapenv:Envelope
 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:axis="http://axishello">
    <soapenv:Header/>
    <soapenv:Body>
       <axis:securedAdd xmlns:axis="http://axishello">
          <axis:name>superuser</axis:name>
          <axis:password>pwd</axis:password>
          <axis:x>3</axis:x>
          <axis:y>5</axis:y>
       </axis:securedAdd>
    </soapenv:Body>
</soapenv:Envelope>


Copyright © 2009 CA. All rights reserved. Email CA about this topic