public static Document readDocument(ServletRequest request) { try { return readDocument(request.getInputStream()); } catch (IOException e) { // ignore return null; } }
public static Document readDocument(ServletRequest request) { try { return readDocument(request.getInputStream()); } catch (IOException e) { // ignore return null; } }
@Nullable public static String extractMethod(HttpServletRequest rq) { Document doc = readDocument(rq); if (doc == null) { return null; } Element root = doc.getRootElement(); if (root == null) { return null; } Element methodName = root.element("methodName"); if (null == methodName) { return null; } return methodName.getTextTrim(); }
@Nullable public static String extractMethod(HttpServletRequest rq) { Document doc = readDocument(rq); if (doc == null) { return null; } Element root = doc.getRootElement(); if (root == null) { return null; } Element methodName = root.element("methodName"); if (null == methodName) { return null; } return methodName.getTextTrim(); }
public static Optional<Pair<String, String>> getMethod(HttpServletRequest rq) { Document doc = readDocument(rq); if (null == doc) { return Optional.empty(); } Element root = doc.getRootElement(); if (null == root) { return Optional.empty(); } Element body = root.element("Body"); if (null == body) { return Optional.empty(); } Element methodElement = (Element) body.elements().get(0); if (null == methodElement) { return Optional.empty(); } String name = methodElement.getName(); String namespace = methodElement.getNamespaceURI(); return Optional.of(Pair.pair(namespace, name)); }
public static Optional<Pair<String, String>> getMethod(HttpServletRequest rq) { Document doc = readDocument(rq); if (null == doc) { return Optional.empty(); } Element root = doc.getRootElement(); if (null == root) { return Optional.empty(); } Element body = root.element("Body"); if (null == body) { return Optional.empty(); } Element methodElement = (Element) body.elements().get(0); if (null == methodElement) { return Optional.empty(); } String name = methodElement.getName(); String namespace = methodElement.getNamespaceURI(); return Optional.of(Pair.pair(namespace, name)); }