Skip to Content
0

SOAP lookup

Oct 20, 2016 at 04:52 PM

98

avatar image

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=" roadnet.webservice@ororagroup.com 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)accessor.call(payload1); SOAPOutPayload1 = accessor.call(payload1); 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

error.png (29.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Raghuraman S Oct 21, 2016 at 03:41 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Oct 21, 2016 at 06:41 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded