Question

I've been pulling out my hair on this and I'm pretty much bald at this point.

Background:

Web Service works on my development machine no problem. Deployment to other machines results in the above error when called.

In code, I have a web reference to an authorize.net API. Within it is a method that returns a response of type "CreateCustomerProfileTransactionResponseType". The parameters that it requires are of type MerchantAuthenticationType, CustomerProfileType, and ValidationModeEnum.

Where everything blows up is on the method that is supposed to return the above CreateCustomerProfileTransactionResponseType. I get the error: enter image description here

What baffles me is that this isn't thrown on my machine (even when mimicking a live environment - No Visual Studio involved) but thrown on any other machine. My machine is a Windows 7 machine. I get failures deploying to 2 separate Windows Server 2008 R2 boxes. I've tried reboots, turning off UAC, etc but to no avail. I've even went so far as to cast the parameter it's complaining about to the object type that it's expecting but the error remains the same. Coding wise, The project is set up as follows:

  • Application calls a Gateway webservice
  • Gateway webservice checks web.config entry for what DLL to load and it's location
  • Gateway itself loads .dll using LoadFrom
  • Loaded dll runs my method (in this case to capture a payment) which uses the web reference to an authorize.net API
  • Response is returned to Application that calls it

Any help would be greatly appreciated as I've exhausted all other help avenues.

Thanks,

Was it helpful?

Solution 2

I figured it out. I had the .dll that I was loading (using Reflection) both in a specified location AND the bin directory of where the web service was. Seems to be a big no no. Removing the .dll from the bin directory solved my issues.

OTHER TIPS

Check the version of the assembly which contains the type 'x'. Maybe another version of it installed in GAC.

Also check this: Unable to cast object of type MyObject to type MyObject

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top