Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Enterprise Service - Cast Exception

Former Member
0 Kudos

Hi folks,

I'm currently working on a project to implement a project that consumes an SAP web service, but I've come across an error that I'm finding difficult to solve. Composing an independent project I'm able to successfully consume the web service. However, when I transfer the same code to the main project, using the same steps to add a web reference in visual studio 2005, I get an InvalidCastException when the service is called:

ERROR: System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidCastException: Unable to cast object of type 'N.SAP.SAPSPProcessor.com.sap.esworkplace.erp.EmplERPSimplElmntsQryMsg_s' to type 'N.SAP.SAPSPProcessor.com.sap.esworkplace.erp.EmplERPSimplElmntsQryMsg_s'.

The proxy code in Reference.cs is the same in both instances, and I've made sure the web.config in the new project has the correct settings. Does anyone have an idea of what may be going on? Or has anyone encountered this error before? Any help is much appreciated!

thanks!

Ryan

1 REPLY 1

Former Member
0 Kudos

anyone?