Search code examples
paypalwsdlpaypal-sandbox

Unable to generate a temporary class (result=1). error CS0030:


I am trying to paypal express checkout i used https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl. when i call use

PayPalAPIAASoapBinding paypal = new PayPalAPIAASoapBinding(); 

i am getting error

Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'exprtesscheckoutdemo.com.paypal.sandbox.TupleType[]' to 'paypal.sandbox.TupleType' error CS0029: Cannot implicitly convert type 'paypal.sandbox.TupleType' to

how to over come this


Solution

  • Just hit this myself when updating to version 119. In your generated Web service file, do a find for [][] and replace all occurrences with []. The bad guy seems to be the merchantDataField in the PaymentDetailsType.

    It seems to be a bug in the Microsoft WSDL tools when interacting with services that have "nested nodes with the maxOccurs attribute set to unbounded"; I've encountered it before when interacting with FedEx SOAP APIs as well.