I have the WSDL for a web service that I cannot currently connect to. The web service has a method called ExecuteCommand which returns a CommandResult
CommandResult looks like:
string ResultMessage;
DataSet ResultDataset;
bool ResultSuccess;
I’ve added the WebService as a Service Reference, but since I cannot currently reach the actual WebService, I need to work off of an XML file that is (I’m told) the XML Response that the WebService would return should I call it’s ExecuteCommand method.
If the WebService was working, I would simply do something like:
MyWebService.ServiceDataInterfaceSoapClient ws = new ServiceDataInterfaceSoapClient();
MyWebService.CommandResult result = ws.ExecuteCommand();
Instead, I want to do something like:
MyWebService.CommandResult result = //Load Result from XML file which contains the XML response that ws.ExecuteCommand would return.
I’m not sure how to go about this. I attempted to create a XmlSerializer of type CommandResult, but I get XML parsing errors on the very first line. I’m hoping someone can point me to a basic example on how to do this.
I ended up figuring out the following and it’s doing what I needed: