Skip to Content

SOAP lookup

Hello Expert

I am writing a SOAP Lookup . Lookup code is working fine and i am receiving the response also .but it showing some Waring error . For more details i am atahing the code and error .

AbstractTrace trace = container.getTrace(); try { String QueryServiceUrl=""; String SOAPxml=""; String SOAPxml1=""; StringBuffer sb = new StringBuffer(); StringBuffer sb1 = new StringBuffer(); StringBuffer sb2 = new StringBuffer(); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Channel channel = LookupService.getChannel("Roadnet","SOAP_RCV_Roadnet1"); SystemAccessor accessor = LookupService.getSystemAccessor(channel); //Getting the Session ID result.addValue("1"); SOAPxml1=" Welc0me1 94e962d3-370a-439d-adc3-d461d48bb05f "; InputStream inputStream1 = (InputStream) new ByteArrayInputStream(SOAPxml1.getBytes()); result.addValue("2"); XmlPayload payload1 = LookupService.getXmlPayload(inputStream1); result.addValue("3"); Payload SOAPOutPayload1 = null; //XmlPayload resPayload1 = (XmlPayload); SOAPOutPayload1 =; result.addValue("4"); InputStream inp1 = SOAPOutPayload1.getContent(); result.addValue("5"); byte[] b1 = new byte[4096]; for (int n; (n = SOAPOutPayload1.getContent().read(b1)) != -1;) { sb1.append(new String(b1, 0, n)); } String webServiceResponse1=sb1.toString(); result.addValue(webServiceResponse1); trace.addInfo(webServiceResponse1); result.addValue("22221"); Document doc = dBuilder.parse(inp1); result.addValue("22222"); //doc.getDocumentElement().normalize(); NodeList nList = doc.getElementsByTagName("LoginResult"); result.addValue("fgdfgfD"); result.addValue(nList.getLength()); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; QueryServiceUrl=eElement.getElementsByTagName("QueryServiceUrl").item(0).getTextContent(); } } }

catch(Exception e) { result.addValue("bbbb"); trace.addWarning("Error" + e.getMessage()); }

Excuation error :


error.png (29.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 21, 2016 at 03:41 AM

    Hello Pankaj,

    You response might not be complete or same values are missed.

    Can you test using SOAP UI and check if your getting proper response.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 21, 2016 at 06:41 AM

    Hi Pankaj!

    Copy your response payload from trace, save it as XML file and try to open it with IE, for example. If you don't see correct XML representation - it means that your response isn't valid XML.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded