Hi Experts,
I have a UDF where I make a SOAP LookUp where the URL should be dynamic,but does not work!.
My UDF:
//put Dynamic URL String path; DynamicConfiguration conf = ( DynamicConfiguration ) container.getTransformationParameters().get( StreamTransformationConstants.DYNAMIC_CONFIGURATION ); DynamicConfigurationKey myPostPath = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/SOAP","TServerLocation" ); path = URL + ID+ EXTENSION; conf.put( myPostPath , path ); AbstractTrace trace = container.getTrace(); String result = ""; try { Channel channel = LookupService.getChannel(BS,CC); SystemAccessor accessor = LookupService.getSystemAccessor(channel); String HTTPxml = "dummy";//obligatory InputStream inputStream = new ByteArrayInputStream(HTTPxml.getBytes()); XmlPayload payload = LookupService.getXmlPayload(inputStream); Payload SOAPOutPayload = null; SOAPOutPayload = accessor.call(payload); InputStream inp = SOAPOutPayload.getContent(); //Map jpg binary to base64 int len; byte[] buffer = new byte[1024*5000]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); while ((len = inp.read( buffer)) > 0) baos.write(buffer, 0, len); result = Base64.encode(baos.toByteArray()); } catch (Exception e) { //trace.addWarning("Error" + e); result = e.getMessage(); } return result;
CC:
Always uses the "DUMMY" URL, any ideas?.
Regards.