summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java2
-rw-r--r--ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java9
2 files changed, 6 insertions, 5 deletions
diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java
index 823ee23a..b92af251 100644
--- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java
+++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/OperationAdd.java
@@ -32,7 +32,7 @@ public class OperationAdd extends GenericOperation {
attr = attr.getNextSibling();
String attrName = nl.item(i).getAttributes().getNamedItem("name").getNodeValue();
- String attrValue;
+ byte[] attrValue;
if (nl.item(i).getFirstChild().getNodeType() == Node.ELEMENT_NODE)
attrValue = ParseValue.parseValueFromNode( nl.item(i).getFirstChild() );
diff --git a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java
index b1173b6b..2c8359fd 100644
--- a/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java
+++ b/ldap/clients/dsmlgw/src/com/netscape/dsml/gateway/ParseValue.java
@@ -14,8 +14,8 @@ public class ParseValue {
public ParseValue() {
}
- public static String parseValueFromNode(org.w3c.dom.Node n) {
- String ret = null;
+ public static byte[] parseValueFromNode(org.w3c.dom.Node n) {
+ byte[] ret = null;
// <xsd:union memberTypes="xsd:string xsd:base64Binary xsd:anyURI"/>
org.w3c.dom.Node type = n.getAttributes().getNamedItem("xsi:type");
@@ -23,9 +23,10 @@ public class ParseValue {
// This value is encoded in base64. decode it.
sun.misc.BASE64Decoder bd = new sun.misc.BASE64Decoder();
try {
- ret = new String( bd.decodeBuffer( n.getFirstChild().getNodeValue() ) ) ;
+ ret = bd.decodeBuffer( n.getFirstChild().getNodeValue() ) ;
}
catch (org.w3c.dom.DOMException de) {
+ ret = "".getBytes();
}
catch (Exception e) {
// couldn't decode auth info
@@ -33,7 +34,7 @@ public class ParseValue {
} else {
// anyURI is unsupported.
- ret = new String(n.getFirstChild().getNodeValue());
+ ret = new String(n.getFirstChild().getNodeValue()).getBytes();
}
return ret;