cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP lookups from withing message mapping

Former Member
0 Kudos

Hi

We are doing a call to a webservice from within a udf in a message mapping using the SOAP API described in one of the blogs in SDN. We are using a soap receiver communication channel to make this webservice call -

We see activity on the communication channel monitoring - indicating that there is a call going out and a response coming back from the webservice. But there are no details shown on the payload in communication channel monitoring. We do not see this webservice lookup as a message on the adapter engine either ?

Is there any place from within XI runtime environment we can get a hold of the message going out to webservice call and the return from webservice ? We are facing problems in the webservice not doing the required action desired and hence this question on visibility of the call to the webservice.

Thanks in advance for your time.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Try to track your webservice call using SXMB_MONI. If you still cannot see your message in SXMB_MONI.

Use TCPGateway to trouble shooting your webservice call. Please refer to below log for more information on trouble shooting SOAP calls using TCPGateway.

/people/stefan.grube/blog/2007/03/29/troubleshooting-soap-http-and-mail-adapter-scenarios-with-tcpgateway

Satish

Former Member
0 Kudos

Satish

Thanks for the tip to trace webservices. This is a working webservice - which we are otherwise able to call successfully by using a normal message mapping and communication channel . Here in my specific scenario that I have asked a question, we have a need to call the webservice - from within a udf and hence we have used the SOAP API available from within XI mapping runtime . That call does not seem to be working - and hence we need to see the payload - of the request to the webservice and the response - I am suprised as to why this communication is not showing in the Adapter message monitoring in RWB

Former Member
0 Kudos

Can you paste your UDF code here. May be we can find something there.

Satish

Former Member
0 Kudos

My udf is basically makes a call to the webserservice lookup method ( line - CallCentralMonitoring.LogToCentralMonitoring( "IN130.10", "COMPLETED"); ) - the definition of CallCentralMonitoring class is given below after the udf

UDF

******************************************************************************************

String adapter = "RECEIVE_FusionDBLookUpRequest";

Channel channel = null;

boolean retry = false;

int noOfRetries = 0;

String sqlQuery = new String("");

DataBaseAccessor accessor = null;

DataBaseResult resultSet = null;

String parameterValue = new String("");

MappingTrace trace = container.getTrace();

// Build the Query String

//sqlQuery = "select * from CTL_BusinessRules with (nolock) where parameter_key = '" + parameterKey + "'";

sqlQuery = "exec uspCTL_GetBusinessRule '" + parameterKey + "'";

do

{

try

{

//trace.addInfo( "SQL query is: " + sqlQuery);

// Determine a channel, as created in the Configuration

channel = LookupService.getChannel(businessService,adapter);

// Get a system accessor for the channel. As the call is being made to a DB, a DatabaseAccessor is obtained.

accessor = LookupService.getDataBaseAccessor(channel);

//trace.addInfo( "Successfully obtained the system accessor..." );

// Execute Query and get the values in resultset

resultSet = accessor.execute(sqlQuery);

Iterator rows = resultSet.getRows();

//trace.addInfo( "Executed query successfully..." );

while( rows.hasNext() )

{

Map rowMap = (Map)rows.next();

parameterValue = rowMap.get("CHARACTER_VALUE").toString();

//trace.addInfo( "Parameter Value is: " + parameterValue );

}

retry = false;

CallCentralMonitoring.LogToCentralMonitoring( "IN130.10", "COMPLETED");

return parameterValue;

}

catch( Exception ex )

{

//trace.addInfo( ex.toString() );

if ( noOfRetries < 3 )

{

retry = true;

noOfRetries++;

}

else

{

retry = false;

CallCentralMonitoring.LogToCentralMonitoring( "SD152.01", "Error");

ExceptionThrower.fire( "Database connectivity error: " + ex.toString() );

}

}

finally

{

try

{

if ( accessor != null ) accessor.close();

}

catch( Exception e )

{

ExceptionThrower.fire("Error closing accesor: " + e.getMessage() );

//return e.getMessage();

}

}

} while( retry );

return null;

*********************************************************************************************

Class CallCentralMonitoring

package com.xxxxx.xi.mapping.udf;

import java.io.ByteArrayInputStream;

import java.io.InputStream;

import com.sap.aii.mapping.lookup.Channel;

import com.sap.aii.mapping.lookup.LookupException;

import com.sap.aii.mapping.lookup.LookupService;

import com.sap.aii.mapping.lookup.Payload;

import com.sap.aii.mapping.lookup.SystemAccessor;

import com.sap.aii.mapping.lookup.XmlPayload;

public class CallCentralMonitoring {

public static void LogToCentralMonitoring (String MON_EISLDCTLID, String MON_MsgStatus) {

String soapXML = new String("");

/* Pass the Business System and Communication Channel as input to the getChannel().

/* BS_SOAPLOOKUP – Business System*CC_Webservice_SOAP_CURRENCY_CONVERTOR – Receiver SOAP Adapter */

Channel channel = null;

try {

channel = LookupService.getChannel( "EI_CentralMonitoringServives", "Receive_SOAP_TrackingServiceWS" );

} catch (LookupException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

SystemAccessor accessor = null;

try {

accessor = LookupService.getSystemAccessor(channel);

} catch (LookupException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

/* Construct the SOAP Request Message using the InputParameters */

soapXML = "<LogToCentralMonitoring xmlns=\"http://xxxxx.EI.CentralMonitoring\"> <loggingData> <MON_EISLDCTLID>"

+ MON_EISLDCTLID

+ "</MON_EISLDCTLID><MON_ProgramID>"

+ MON_EISLDCTLID

+ "</MON_ProgramID><MON_ProcessID>"

+ MON_EISLDCTLID

+ "</MON_ProcessID><MON_ClientAlert>"

+ "N"

+ "</MON_ClientAlert><MON_MsgStartTimeStamp>"

+ "03/30/2007 10:00:00"

+ "</MON_MsgStartTimeStamp><MON_MsgEndTimeStamp>"

+ "03/30/2007 10:00:01"

+ "</MON_MsgEndTimeStamp><MON_MsgStatus>"

+ MON_MsgStatus

+ "</MON_MsgStatus><MON_MsgStatusDescription>"

+ MON_MsgStatus

+ "</MON_MsgStatusDescription> </loggingData> </LogToCentralMonitoring>";

InputStream inputStream = new ByteArrayInputStream(soapXML.getBytes());

XmlPayload payload = LookupService.getXmlPayload(inputStream);

Payload soapOutPayload = null;

/The SOAP call is made here and the response obtained is in the soapOutPayload./

try {

soapOutPayload = accessor.call(payload);

} catch (LookupException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}//end LogToCentralMonitoring

}//end class