Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2806

Re: SOAP HTTPS Soap Envelope

$
0
0

I was able to perform a SOAP Lookup using SOAP Axis.

As pointed by SAP in response to Jaime, SOAP Axis requires that we set the OperationName and OperationNamespace. This is also mentioned in the Java Doc that says some adapter's might require this.

2 Lines of code added was

 

accessor.setOperationName("Dummy");
accessor. setOperationNamespace("http://Dummy");

Code Snippet with the additional 2 lines for code in comparison to Jaime's original code,

 

AbstractTrace trace = container.getTrace(); 
String sResponse = ""; 
try {     Channel channel = LookupService.getChannel("BC_B2B_HEB","CC_SOAP_RCV_HEB_CFDI");     SystemAccessor accessor = LookupService.getSystemAccessor(channel);     accessor.setOperationName("Dummy");    accessor. setOperationNamespace("http://Dummy");    String SOAPxml =Sxml;     InputStream inputStream = new ByteArrayInputStream(SOAPxml.getBytes());     XmlPayload payload = LookupService.getXmlPayload(inputStream);     Payload SOAPOutPayload = null;     SOAPOutPayload = accessor.call(payload);     InputStream inp = SOAPOutPayload.getContent();     DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();     DocumentBuilder builder = factory.newDocumentBuilder();      Document document = builder.parse(inp);     NodeList list = document.getElementsByTagName("CODE");     Node node = list.item(0);     if (node != null) {         node = node.getFirstChild();             if (node != null) {                 sResponse = node.getNodeValue();             }         }     }  
catch (Exception e){     trace.addWarning("Error" + e); 
} 
return sResponse; 

Regards,

Bhavesh


Viewing all articles
Browse latest Browse all 2806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>