Author Message
VishweshwarG
Joined: Dec 21, 2013
Messages: 107
Offline
Hi,


When we are calling a web service we will get credit card or debit card number in web service reply. we want to mask credit card or debit card number while printing in log file.

or

I would like to know how to disable printing log of web service request and response into a file for web service call.

can any one please let me know.
JuanMorales2
Joined: Dec 16, 2013
Messages: 44
Offline
Have you tried setting the variable, in project.variables, as private?
VishweshwarG
Joined: Dec 21, 2013
Messages: 107
Offline
Hi Juan,

I tried setting variable in project.variables, private as true. But the web service request and responses are printing in the system logs. It is not being disabled I think.

Is any other way to do this. I am using DD 5.1 version

And also we need to mask credit or debit card number.

Thanks in advance.
JuanMorales2
Joined: Dec 16, 2013
Messages: 44
Offline
On your ddrt.properties make sure localsoaptrace is disabled. If the trace keeps appearing. successively disable localddtrace, localapptrace. Also, make sure showvxmlroot is set to never.
VishweshwarG
Joined: Dec 21, 2013
Messages: 107
Offline
Thanks... I am able to disable web service request and response.

But Customer wants the web service request and response in the log file but credit and debit cards have to be masked.

Is there any way to do so....

Can any one tell me which component/library is writing SOAP requests and responses in the log file in DD application?
JuanMorales2
Joined: Dec 16, 2013
Messages: 44
Offline
As far as I know, if you want to mask a piece of the XML output, but still write it, that is not doable out of the box. However, you can override the Log4J class with one of your own that parses the text and removes the numbers when it is needed.
VishweshwarG
Joined: Dec 21, 2013
Messages: 107
Offline
Can we store web service reply in a DD variable then we can play around with that variable like masking or removing numbers from the XML content.

VishweshwarG
Joined: Dec 21, 2013
Messages: 107
Offline
Can any one please help me on this ....
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
If I'm understanding this correctly, there are a couple different ways you can achieve the result you want. The first way would be to invoke the web service using Java code, rather than DD's WSOPs. Doing that would make it so DD's web service connector is not involved with the call, and so any of the normal web service log output wouldn't get written. You could then output whatever specific data you wanted yourself.

The other way you could do it is to, as mentioned previously, first disable the logging that DD does in ddrt.properties. Then, recreate the WSOP so that the result is stored in a Java object. You can do this by unchecking the "Unwrap output" check box in the WSOP wizard and then selecting the DD variable where the output should be stored. Finally, after the Data node that houses the web service call, insert a Servlet node where you can write some simple Java to manipulate the values in the response object. After that point, you could choose to write out the output you want.

In either scenario, you wouldn't need to deal with raw XML. DD deals with web service responses by creating a Java object structure that represents the data, making it much easier to work with.

If you need some code examples, I can provide some. If you attach your WSDL, I can give examples that are related as well.
VishweshwarG
Joined: Dec 21, 2013
Messages: 107
Offline
Thank you very much Samaresh....

I understood what you explained but I can not provide the WSDL as it in client's place and is confidential.

I have web services implemented in the applicaion which has been working for the past 2 years. Now customer wants the credit card number to be masked in the response.

Can you please provide the sample code which we can manipulate with it.


SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
There are two examples below, one each for the two situations I mentioned.

First, this is an example of invoking a web service using Java. In order to get all the objects into the project, you'll have to first go ahead and create the WSOP using the WSDL. Once that's done, you can delete the WSOP, since you won't be using it, but the beans directory will still remain. To print out, I used OD's log() method, which prints out only if tracing is enabled and uses Apache servlet logging. You could write out using other means if you wish, such as to a file.


public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {

log("Start of WS call...");

QueryResourcesRequest request = new QueryResourcesRequest();
request.setQueryResourcesRequestUnused(1234);

try {
AppIntfWSStub stub = new AppIntfWSStub();
QueryResourcesResponse response = stub.queryResources(request);

mySession.getVariableField(IProjectVariables.TOTAL_RES__RETURNED).setValue(response.getTotalRes_returned());
mySession.getVariableField(IProjectVariables.UNUSED_H_3_2_3__RETURNED).setValue(response.getUnusedH323_returned());
mySession.getVariableField(IProjectVariables.UNUSED_SIP__RETURNED).setValue(response.getUnusedSIP_returned());

log("Unused SIP Return value: " + response.getUnusedSIP_returned());

} catch (RemoteException e) {
e.printStackTrace();
} catch (QueryResourcesFaultException e) {
e.printStackTrace();
}
}


This is a portion of the log that gets generated for that app. The app itself doesn't do much, so there isn't much, but you can see the log entries for the above code. I only printed out one value, so you can modify it to fit your needs.


...
04/03/2014 16:47:56:306 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :session___sharedmode to complex: session:sharedmode as [shared]
04/03/2014 16:47:56:306 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :shareduui___value to complex: shareduui:value as [unknown]
04/03/2014 16:47:56:306 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :session___vpcoveragetype to complex: session:vpcoveragetype as [unknown]
04/03/2014 16:47:56:307 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Storing :shareduui___id to complex: shareduui:id as [unknown]
04/03/2014 16:47:56:364 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Using SCESession 60C70BBC8C63A11290BEECDEFF4FDEA6:/err servlet : untitledServlet1
Mar 04, 2014 4:47:56 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet1: Start of WS call...
Mar 04, 2014 4:47:57 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet1: Unused SIP Return value: 56
04/03/2014 16:47:57:092 INFO - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : Using SCESession 60C70BBC8C63A11290BEECDEFF4FDEA6:/err servlet : untitledReturn1
04/03/2014 16:47:57:144 DEBUG - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : *** Reply for [/err/untitledReturn1] ***
04/03/2014 16:47:57:145 DEBUG - 60C70BBC8C63A11290BEECDEFF4FDEA6:/err : 0:<?xml version="1.0" encoding="UTF-8"?>
...


Second, this is the option to use a Java object with the WSOP. Like mentioned before, to create the WSOP, you need to uncheck the Unwrap input/output parameter check boxes. Also make sure that on the last two pages of the wizard, you check Use Java Object for input and output. I used 2 servlets, one before the Data node, one after.

Request servlet

public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {

log("Setting request object for WS call.");

DebitCardRequest request = new DebitCardRequest();
DebitCardRequestDataType param = new DebitCardRequestDataType();
request.setDebitCardRequest(param);

mySession.getVariableField(IProjectVariables.QUERY_RESOURCES_REQUEST).setValue(request);
}


Response servlet

public void servletImplementation(com.avaya.sce.runtimecommon.SCESession mySession) {

Object obj = mySession.getVariableField(IProjectVariables.QUERY_RESOURCES_RESPONSE).getObjectValue();
FinancialTransResponse response = (FinancialTransResponse) obj;

log("Response from WS:\n" +
"Code - " + response.getFinancialTransResponse().getResponseCode().getRespCodeType() +
"\nProcessing - " + response.getFinancialTransResponse().getProcessingCode().getProcessingCodeType() +
"\nRmType - " + response.getFinancialTransResponse().getRrn().getRrnType());
}


For this second method, make sure that SOAP tracing isn't set to be on in ddrt.properties. The console output snippet for this looks something like this:


...
04/03/2014 17:20:35:850 INFO - 0102BF377427B612C3A5524046A22446:/err : Storing :shareduui___value to complex: shareduui:value as [unknown]
04/03/2014 17:20:35:850 INFO - 0102BF377427B612C3A5524046A22446:/err : Storing :session___vpcoveragetype to complex: session:vpcoveragetype as [unknown]
04/03/2014 17:20:35:850 INFO - 0102BF377427B612C3A5524046A22446:/err : Storing :shareduui___id to complex: shareduui:id as [unknown]
Mar 04, 2014 5:20:35 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet2: Setting request object for WS call.
04/03/2014 17:20:35:935 INFO - 0102BF377427B612C3A5524046A22446:/err : Using SCESession 0102BF377427B612C3A5524046A22446:/err servlet : untitledData1
04/03/2014 17:20:36:777 DEBUG - 0102BF377427B612C3A5524046A22446:/err : Collecting [connectivity.ws.beans.DebitCardRequest@54a3ae71] from:QueryResourcesRequest
04/03/2014 17:20:36:061 INFO - 0102BF377427B612C3A5524046A22446:/err : Calling Web Service [SvGate] at [http://likewow777-surf:8088/mockSvGateSOAP] operation [debitCard]
04/03/2014 17:20:36:777 DEBUG - 0102BF377427B612C3A5524046A22446:/err : Storing [connectivity.ws.beans.FinancialTransResponse@f2168386] to:QueryResourcesResponse
Mar 04, 2014 5:20:36 PM org.apache.catalina.core.ApplicationContext log
INFO: untitledServlet1: Response from WS:
Code - 888
Processing - 1
RmType - Debit
04/03/2014 17:20:36:850 DEBUG - 0102BF377427B612C3A5524046A22446:/err : *** Reply for [/err/untitledData1] ***
04/03/2014 17:20:36:850 DEBUG - 0102BF377427B612C3A5524046A22446:/err : 0:<?xml version="1.0" encoding="UTF-8"?>
1:<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-us">
2:<meta name="author" content="Avaya Aura Orchestration Designer"/>
...
Go to:   
Mobile view