Commit fc653dd3 authored by Sunil Kumar's avatar Sunil Kumar
Browse files

Fix for DSML defect: Not getting proper dsml response document for bogus requests.

parent c64c31a1
......@@ -172,7 +172,7 @@ class DSMLHandler extends DefaultHandler implements
Integer elementTag = (Integer)requestTags.get(strSName);
if (elementTag == null){
if (state != START){ //Ignore tags outside of DSML tags
throw new SAXException("Element name, \"" + strQName
throw new SAXNotRecognizedException("Element name, \"" + strQName
+ "\" not recognized");
} else {
return;
......@@ -575,7 +575,7 @@ class DSMLHandler extends DefaultHandler implements
Integer elementTag = (Integer)requestTags.get(strSName);
if (elementTag == null){
if (state != START){ //Ignore tags outside of DSML tags
throw new SAXException("Element name, \"" + strQName
throw new SAXNotRecognizedException("Element name, \"" + strQName
+ "\" not recognized");
} else {
return;
......
......@@ -23,6 +23,7 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.*;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import com.novell.ldap.*;
......@@ -119,6 +120,11 @@ public class DSMLReader implements LDAPReader {
"The SAX parser is configured incorrectly:" + e,
LDAPException.LOCAL_ERROR,
e);
} catch (SAXNotRecognizedException e){
throw new LDAPLocalException(
null,
LDAPException.PROTOCOL_ERROR,
e);
} catch (SAXException e) {
throw new LDAPLocalException(
"The following error occured while parsing DSML: " + e,
......
......@@ -104,6 +104,7 @@ public class DSMLWriter implements LDAPWriter {
if (e instanceof LDAPException){
switch (((LDAPException)e).getResultCode()){
case LDAPException.DECODING_ERROR:
case LDAPException.PROTOCOL_ERROR:
out.write("malformedRequest\">");
break;
case LDAPException.LOCAL_ERROR:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment