0

My First data web service code is working fine on local machine. Followed Patricker answer here at stackoverflow Link To Code for WebService .Problem is when I deploy it on server I get error.

Am I missing any WebService DLL or dependency because I don't see anything in my deployable file created with VS2010 using Build Deployment Package for upload.

I have noticed onething in the error. Path is C:\Users\Chris\Documents\Visual Studio 2010... which is my local machine and the server is generated on the host server. Whats wrong?

ERROR

An internal error occurred.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: An internal error occurred.


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

    [CryptographicException: An internal error occurred.
    ]
       System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr) +33
       System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) +0
       System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags) +237
       System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password) +80
       DataFirstWebWebService.CLinkTransaction.BuildOrderService() in C:\Users\Chris\Documents\Visual Studio 2010\Projects\DataFirstWebWebService\DataFirstWebWebService\CLinkTransaction.cs:120
       DataFirstWebWebService.CLinkTransaction.ChargeCreditCard(String cardNumber, String expMonth, String expYear, String ccv, Decimal chargeTotal, Billing billingInfo, CLinkTransResponse transResponse) in C:\Users\Chris\Documents\Visual Studio 2010\Projects\DataFirstWebWebService\DataFirstWebWebService\CLinkTransaction.cs:29
       DataFirstWebWebService._default.Button1_Click(Object sender, EventArgs e) in C:\Users\Chris\Documents\Visual Studio 2010\Projects\DataFirstWebWebService\DataFirstWebWebService\default.aspx.cs:38
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Community
  • 1
  • 1
Pirzada
  • 4,685
  • 18
  • 60
  • 113
  • The exception is being thrown when it tries to load in the p12 file. Note 'System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password)'. Try doing a System.IO.File.Exists check on your P12 file first to make sure it exists. – Peter Aug 22 '11 at 13:53
  • 1
    Another possibility is that you updated either the path to the p12 file, or the password for opening it, but not the opposite. So it's trying to open a mis-matched p12 file/password combination. – Peter Aug 22 '11 at 14:07
  • @patricker , if the problem was of password than it shouldn't work on local machine first? . I check file exist thing. – Pirzada Aug 22 '11 at 14:46
  • @patricker , Trying to find solution. One Question in your webservice code where do you mention credit card type? . Because I don't see against what credit card user is paying. Any help. – Pirzada Aug 23 '11 at 01:40
  • You don't need to specify the type. FDGG figures it out automatically (if it starts with a 4 then visa, 5 then mastercard, etc...) – Peter Aug 24 '11 at 03:21

0 Answers0