on 10-20-2016 5:52 PM
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="<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><Login xmlns=\"http://roadnet.com/apex/\"><emailAddress>roadnet.webservice@ororagroup.com</emailAddress><password>Welc0me1</password><cultureOptions xmlns:a=\"http://schemas.datacontract.org/2004/07/Roadnet.Apex.Server.Services.Login\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><a:Name i:nil=\"true\"/><a:Version i:nil=\"true\"/></cultureOptions><appInfo xmlns:a=\"http://schemas.datacontract.org/2004/07/Roadnet.Apex.Server.Services.Login\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><a:BuildType i:nil=\"true\"/><a:ClientApplicationIdentifier>94e962d3-370a-439d-adc3-d461d48bb05f</a:ClientApplicationIdentifier><a:Version i:nil=\"true\"/></appInfo></Login></s:Body></s:Envelope>"; 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 :
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.