cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to invoke soap receiver adapter in asyn mode

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (3)

Answers (3)

iaki_vila
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

SOAP Receiver channel supports synchronous calls.

The channel that I have configured in UDF does not have a receiver agreement.

Former Member
0 Kudos

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

Former Member
0 Kudos

Some of the calls using this UDF are going through fine, only intermittently we get errors.

Harish
Active Contributor
0 Kudos

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

Former Member
0 Kudos

We are on PI 7.11 SP10

This issue occurs only for the calls being made from UDF. if the same channel is called using standard receiver agreement in other interfaces works fine.

Is there a way we can make the processing of these messages sequential using the UDF.

Former Member
0 Kudos

Any thoughts on this issue?

0 Kudos

Hi,

have you tried the maximum concurency in the chnnel ?

Former Member
0 Kudos

Concurrency for SOAP Receiver channel???