3434import java .io .FileInputStream ;
3535import java .io .IOException ;
3636import java .io .StringReader ;
37- import java .lang .reflect .InvocationTargetException ;
3837import java .security .KeyStore ;
3938import java .security .cert .PKIXParameters ;
4039import java .security .cert .TrustAnchor ;
@@ -91,16 +90,14 @@ public static Map runTransaction(Map<String,String> request, Properties props)
9190 * @throws FaultException if a fault occurs.
9291 * @throws ClientException if any other exception occurs.
9392 */
94- @ SuppressWarnings ("unchecked" )
95- public static Map runTransaction (
93+ public static Map runTransaction (
9694 Map <String , String > request , Properties props ,
9795 Logger _logger , boolean prepare , boolean logTranStart )
9896 throws FaultException , ClientException {
9997 MerchantConfig mc ;
10098 LoggerWrapper logger = null ;
10199 Connection con = null ;
102100
103-
104101 try {
105102 setVersionInformation (request );
106103
@@ -125,39 +122,8 @@ public static Map runTransaction(
125122// FileWriter writer = new FileWriter(new File("signedDoc.xml"));
126123// writer.write(XMLUtils.PrettyDocumentToString(signedDoc));
127124// writer.close();
128- if (mc .isCustomHttpClassEnabled ()){
129- Class <Connection > customConnectionClass ;
130- try {
131- customConnectionClass = (Class <Connection >) Class .forName (mc .getcustomHttpClass ());
132- Class [] constructor_Args = new Class [] {com .cybersource .ws .client .MerchantConfig .class , javax .xml .parsers .DocumentBuilder .class , com .cybersource .ws .client .LoggerWrapper .class };
133- con =customConnectionClass .getDeclaredConstructor (constructor_Args ).newInstance (mc , builder , logger );
134-
135- } catch (InstantiationException e ) {
136- logger .log (Logger .LT_INFO , "Failed to Instantiate the class " +e );
137- throw new ClientException (e , false , null );
138- } catch (IllegalAccessException e ) {
139- logger .log (Logger .LT_INFO , "Could not Access the method invoked " +e );
140- throw new ClientException (e , false , null );
141- } catch (ClassNotFoundException e ) {
142- logger .log (Logger .LT_INFO , "Could not load the custom HTTP class " );
143- throw new ClientException (e , false , null );
144- } catch (IllegalArgumentException e ) {
145- logger .log (Logger .LT_INFO , "Method invoked with Illegal Argument list " +e );
146- throw new ClientException (e , false , null );
147- } catch (SecurityException e ) {
148- logger .log (Logger .LT_INFO , "Security Exception " +e );
149- throw new ClientException (e , false , null );
150- } catch (InvocationTargetException e ) {
151- logger .log (Logger .LT_INFO , "Exception occured while calling the method " +e );
152- throw new ClientException (e , false , null );
153- } catch (NoSuchMethodException e ) {
154- logger .log (Logger .LT_INFO , "Method not found " );
155- throw new ClientException (e , false , null );
156- }
157- }
158- else {
159- con = Connection .getInstance (mc , builder , logger );
160- }
125+
126+ con = Connection .getInstance (mc , builder , logger );
161127 Document wrappedReply = con .post (signedDoc );
162128 Map <String , String > replyMap = soapUnwrap (wrappedReply , mc , logger );
163129 logger .log (Logger .LT_INFO , "Client, End of runTransaction Call " ,false );
0 commit comments