Hello there, I've figured it out how to test my Visa DCAS sandbox api via SOAP UI. I set up my keystore .p12 file along with its corresponding keystore password.
Now I'm trying to test the visa API sandbox via the provided java sample code. But I'm getting some troubles understanding some steps.
First here is how I set up the ApiClient variables:
apiClient.setUsername("************************pCbv4j-du1F20rotKa1YbKs");
apiClient.setPassword("**********ui0qCA3nOWn896");
apiClient.setKeystorePath("myProject_keyAndCertBundle.jks");
apiClient.setKeystorePassword("**********");
With that configuration I got this error when doing a request to the API:
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://sandbox.api.visa.com/dcas/cardservices/v1/cards/4105837613490022/cardstatus": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target;
For the jks file I followed this steps from the VDC:
Step 1> keytool -importkeystore -srckeystore myProject_keyAndCertBundle.p12 -srcstoretype PKCS12 -destkeystore myProject_keyAndCertBundle.jks
Step 2> keytool -list -v -keystore myProject_keyAndCertBundle.jks
Step 3> keytool -import -alias ejbca -keystore myProject_keyAndCertBundle.jks -file VDPCA-SBX.pem -storepass <password>
Step 4> keytool -import -alias digicert -keystore myProject_keyAndCertBundle.jks -file DigiCertGlobalRootCA.crt -storepass <password>
Hope I've been clear,
Thanks in advantage
Hey @zeta,
I'd be happy to help you resolve the issue your experiencing. For me to do so, please provide the following information:
1. End Point
2. Request Header
3. Request Body
4. Response Header (include the x-correlation-id)
5. Response Body
Using SoapUI, you can find the x-correlation-id in the Raw Tab of the response header.
Hey Diana,
As I mentioned I don't have any problem using SoapUI.
The problem is building the ApiClient.java object in
CardServicesApiTest
give in the Sample Code
Hey @zeta,
I have opened up ticket INC8784134 for the engineering team to take a look at your issue. I'll reach out to you when I have an update.
Hey @zeta,
For INC8784134, the sample code is provided and attached. However, we observed that you have experienced connectivity issues related to improper use of certs.
So, this is the format for the key generation that we personally use:
These commands to generate a keystore and create a csr from it to submit a csr for an app/project
These commands to bind the 3 certs from the credentials page to your keystore
If you have more information about credentials, keep us in the loop.
But, as far as information about the sample code, you'll need to find the CardServicesApiTest file to update your credentials and run:
.dps_card_and_account_services/card_services_api/src/test/java/com/visa/developer/sample/card_services_api/api/CardServicesApiTest.java
Updating credentials on line 87:
// Configure HTTP basic authorization: basicAuth
apiClient.setUsername("YOUR USERNAME");
apiClient.setPassword("YOUR PASSWORD");
apiClient.setKeystorePath("YOUR KEYSTORE PATH");
apiClient.setKeystorePassword("YOUR KEYSTORE PASSWORD");
apiClient.setPrivateKeyPassword("YOUR PRIVATEKEY PASSWORD");
// To set proxy uncomment the below lines
// apiClient.setProxyHostName("proxy.address@example.com");
// apiClient.setProxyPortNumber(0000);
The proxy information may not be required and should only be edited only if connection issues result from the apiClient tests.
Aside from that, the test is ad-libbed to work for an example card that would not effect any backend operations using “cardId_example”.
As such, the schema to all end points are not properly mapped to live data, but updating or creating new java objects in the /models folder would allow for mapping new objects.
If this sort of edit is required, you could force the apiClient call to return string format to see the json structure and reverse engineer the schema from there, or file an incident to example the sample code to fit a wider breadth of query results.
If there are any other questions, keep us in the loop! Please let us know if this resolved your issue so we can close your ticket, thanks!
Hey @zeta,
Can you please provide an update and let us know if you're issue is resolved? Once you confirm that it's resolved, I'll close out your case. Thanks!
Hey @baru18,
Great to hear that this forum post has helped to resolve your issue! We are happy to help!
Hey @zeta,
This is our third attempt to reach out to you. Can you please confirm that your issue is resolved and that we can close your ticket? If we don't hear back from you in a couple of days, we will close your ticket. Thanks!