on 01-16-2014 6:54 PM
All I am using the following code to invoke soap receiver adapter from UDF:
SystemAccessor accessor = null;
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey varFileName = DynamicConfigurationKey.create("http://sap.com/Custom","FileName");
DynamicConfigurationKey varShipmentNumber = DynamicConfigurationKey.create("http://sap.com/Custom","ShipmentNumber");
DynamicConfigurationKey varCustomerCode = DynamicConfigurationKey.create("http://sap.com/Custom","CustomerCode");
DynamicConfigurationKey varItemNumber = DynamicConfigurationKey.create("http://sap.com/Custom","ItemNumber");
DynamicConfigurationKey varField03 = DynamicConfigurationKey.create("http://sap.com/Custom","Field03");
String FileName = conf.get(varFileName);
String ShipmentNumber = conf.get(varShipmentNumber);
String CustomerCode = conf.get(varCustomerCode);
String ItemNumber = conf.get(varItemNumber);
String Field03 = conf.get(varField03);
try
{
String sysName = (String) System.getProperty("SAPSYSTEMNAME");
if ("DHX".equals(sysName))
{
Channel channel = LookupService.getChannel("","FUSION_DEVBTSERVER_USA","Receive_SOAP_TrackingServiceWS_LogToCentralMonitoring_ISIS");
accessor = LookupService.getSystemAccessor(channel);
}
String SOAPxml ="<?xml version=\"1.0\" encoding=\"utf-8\" ?><ns2:LogToCentralMonitoring xmlns:ns2=\"http://EI.CentralMonitoring\"><ns2:loggingData><MON_EISLDCTLID>03</MON_EISLDCTLID><MON_ProgramID>WM2...+": "+msgDesc+"</MON_MsgStatusDescription><MessageAttribute><Name>MON_FileName</Name><Value>"+FileName+"</Value></MessageAttribute><MessageAttribute><Name>MON_FunctionalID</Name><Value>"+ItemNumber+"</Value></MessageAttribute><MessageAttribute><Name>MON_ShipNum</Name><Value>"+ShipmentNumber+"</Value></MessageAttribute><MessageAttribute><Name>MON_SearchField1</Name><Value>"+Field03+"</Value></MessageAttribute><MessageAttribute><Name>MON_SearchField2</Name><Value>"+CustomerCode+"</Value></MessageAttribute></ns2:loggingData></ns2:LogToCentralMonitoring>";
InputStream is = new ByteArrayInputStream(SOAPxml.getBytes());
XmlPayload payload = LookupService.getXmlPayload(is);
Payload result = accessor.call(payload);
}
finally
{
if(accessor!=null)accessor.close();
}
return (msgDesc);
But intermittently I am getting the following error: SOAP: call failed: java.net.SocketException: Connection reset
But surprisingly other interface using the same channel normally without udf never throws error. The error seems to be happening only for the messages being sent to this CC using UDF.
Any advice.
HI Vicky,
As far as i know lookup class only support synchronous calls. Check this documentation LookupService (XI Mapping Lookup (SPS 15)):
The Lookup API supports access via the JDBC, RFC, and SOAP adapter. If you want to execute a mapping lookup with a third party adapter, then the adapter must fulfil the following conditions:
- The adapter must support synchronous calls.
- The adapter must not use a Receiver Agreement.
You could try to make the SOAP call without to use the integration directory configuration. Check a example in this blog Making Asynchronous Web Service Calls | Glen Mazza's Weblog
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Vicky,
Can you also check if your RFC XML is formed correctly. I agree it states a connection error but since you said the channel works for the connection otherwise, i am assuming we may also have a case in which the SOAP call is wrong due to a wrong structure of call
Regards,
ninu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vicky,
It seems the connection is been closed by server, this can be issue with the request message. If the SOAP request message size is big then check the SAP note 1405895.
check the below discussion -
http://scn.sap.com/thread/3344952
regards,
Harish
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 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.