Join the discussion
connection reset

Jun 21, 2012

Juan Fu says:

getting private key

getting https connection ...

https url https://sandbox.api.mastercard.com/fraud/merchant/v1/termination-inquiry?Format=XML&PageOffset=0&PageLength=10

body <?xml version="1.0" encoding="utf-8"?><ns2:TerminationInquiryRequestxmlns:ns2="http://mastercard.com/termination"><AcquirerId>1996</AcquirerId><Merchant><Name>Terminated Merchant</Name><Address><Line1>1234 State Street</Line1><City>St. Louis</City><CountrySubdivision>MO</CountrySubdivision><PostalCode>55555</PostalCode><Country>USA</Country></Address><Principal><FirstName>John</FirstName><LastName>Smith</LastName><Address><Country>USA</Country></Address></Principal></Merchant></ns2:TerminationInquiryRequest>

here in getPrivateKey

here 2

baseString=POST&https%3A%2F%2Fsandbox.api.mastercard.com%2Ffraud%2Fmerchant%2Fv1%2Ftermination-inquiry&Format%3DXML%26PageLength%3D10%26PageOffset%3D0%26oauth_body_hash%3DtXFm5MUDmzQF5wnmBPQ%252FLaGN454%253D%26oauth_consumer_key%3DUyzfTzNjEnHOtb542n1cYCO-nbYJ0wSGxIEIwrNa0a3b1536%26oauth_nonce%3D8352975859231600%26oauth_signature_method%3DRSA-SHA1%26oauth_timestamp%3D1340286491%26oauth_version%3D1.0

openConnection ... method=POST

sandbox.jks .. null

here in buildAuthHeaderString

params ...

OAuth oauth_signature="M5arFgFcZef0oh00KuoKgVfyjmbvg53U9or9HucO4iAe%2FMZ%2FQdrhIqZEUszsbQ670Sxf20JXxa0GbNtp8toIjIqIGLBl6XzFhkY0fTVsGGpXLyx5oN%2BCqqWfsmvHSKgySx6lRiKcEtwR54DU5B%2Fn5QdpuQQR4irevT4OcgP4PR4%3D",oauth_body_hash="tXFm5MUDmzQF5wnmBPQ%2FLaGN454%3D",oauth_version="1.0",oauth_nonce="8352975859231600",oauth_signature_method="RSA-SHA1",oauth_consumer_key="UyzfTzNjEnHOtb542n1cYCO-nbYJ0wSGxIEIwrNa0a3b1536",oauth_timestamp="1340286491"

connectting ....

se Error :

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:168)

at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)

at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:830)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1170)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1197)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1181)

at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)

at testConn.createMCAPIConnection(testConn.java:109)

at testConn.createInquiry(testConn.java:247)

at testConn.main(testConn.java:295)

con is not null

Error x :

java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:168)

at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)

at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:830)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1170)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1197)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1181)

at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setNewClient(AbstractDelegateHttpsURLConnection.java:81)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.setNewClient(AbstractDelegateHttpsURLConnection.java:61)

at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:584)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1193)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)

at testConn.createInquiry(testConn.java:250)

at testConn.main(testConn.java:295)

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 21, 2012

    Mukul Shahrawat says:

    Is this error sporadic or showing up all the time you are trying to connect to M...

    Is this error sporadic or showing up all the time you are trying to connect to MATCH service endpoint? It usually happnes when client aborts a request or socket gets closed without performing a shutdown. Please share your client code which is producing this error.

  2. Jun 22, 2012

    Juan Fu says:

    works from my pc, but still the same error from our server, I can telnet sandbox...

    works from my pc, but still the same error from our server, I can telnet sandbox.api.mastercard.com 443 fine. Now getting the other minor issue with reponse xml file from mastercard on match request, it contains the namespace tag <ns2 as xml doc root, so the sample code from your site does not work, the line 

    if (doc.getFirstChild().getNodeName().equals("PageOffset")) {

    no biggy, will find way to parse the reponse xml file properly.


© 1994-2014. MasterCard. All rights reserved.