Commit 6e919f79 authored by Sunil Kumar's avatar Sunil Kumar
Browse files

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

parent fc653dd3
...@@ -17,6 +17,7 @@ package; ...@@ -17,6 +17,7 @@ package;
import com.novell.ldap.LDAPSocketFactory; import com.novell.ldap.LDAPSocketFactory;
import com.novell.ldap.LDAPJSSESecureSocketFactory; import com.novell.ldap.LDAPJSSESecureSocketFactory;
import com.novell.ldap.LDAPConnection; import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPLocalException;
import com.novell.ldap.connectionpool.PoolManager; import com.novell.ldap.connectionpool.PoolManager;
import com.novell.ldap.util.DSMLReader; import com.novell.ldap.util.DSMLReader;
import com.novell.ldap.util.DSMLWriter; import com.novell.ldap.util.DSMLWriter;
...@@ -186,8 +187,23 @@ public class DsmlService extends HttpServlet ...@@ -186,8 +187,23 @@ public class DsmlService extends HttpServlet
respPrtWtr.flush(); respPrtWtr.flush();
status = "Last doPost successful"; status = "Last doPost successful";
} }catch(LDAPLocalException e){
catch(Exception e) rsp.setContentType("text/xml; charset=utf-8");
// Get response PrintWriter object from HttpServletResponse so we
// can write response.
respPrtWtr = rsp.getWriter();
// Write XML version to response.
respPrtWtr.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
// Write start of soap envelope.
respPrtWtr.println("<soap-env:Envelope xmlns:soap-env=\"\">");
// Write start of soap body.
// Set response PrintWriter object into DSLMLWriter.
respDsmlWtr = new DSMLWriter(respPrtWtr);
}catch(Exception e)
{ {
rsp.setStatus(rsp.SC_INTERNAL_SERVER_ERROR); rsp.setStatus(rsp.SC_INTERNAL_SERVER_ERROR);
if(null != respPrtWtr)respPrtWtr.flush(); if(null != respPrtWtr)respPrtWtr.flush();
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