Awarious OfficePortal - HRMS Application

WCF auto generate proxy causes type conversion exception for de-serialization

0 votes
asked Jul 12, 2014 in WCF by Vinod Othayoth

I have added a service reference for a java webservice. As per the WSDL description of the webservice, the proxy supposes to create single dimensional array for the collections. But for some reason, it is creating the collections with 2 dimensional arrays. Based on some Google searching I did, I have manually changed the 2 dimensional arrays to single dimensional array. But now, even though there is no de-serialization exception, the number of items in the collection is always one.

code that caused exception

 {"Unable to generate a temporary class (result=1).\r\nerror CS0030: Cannot convert type '****classificationPair[]' to '****classificationPair '\r\nerror CS0030: 
Cannot convert type 'MYWSDL.ServiceReference1.MyHistory[]' to 'MYWSDL.ServiceReference1.MyHistory      System.Exception {System.InvalidOperationException}

1 Answer

0 votes
answered Jul 12, 2014 by anonymous
selected Jul 12, 2014 by administrator
Best answer

Some time the issue can be resolved by changing the two dimensional arrays to single dimensional array. But if it did not, then change the single dimensional array in the proxy class to List collection as below manually.

private List<classificationPair> valuesField

Your answer


Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
site design / logo / content © 2013 - 2019