2013年7月24日星期三

InvalidOperationException exception. An error occurred while generating

the XML document. WebService code is as follows:

public DataTable GetDataFromSAP (DataTable varCondition)
{
ClaMM_Service.ClaZ_RFC_PUR obj = new ClaMM_Service.ClaZ_RFC_PUR ();
DataTable dtResult = obj.Z_RFC_PUR (varCondition);
return dtResult;
}

calling code in the system are as follows:

MM.MM_Service obj = new MM.MM_Service ();
dtFinal = obj.GetDeductDataFromSAP (dtRtn);

When the debugger to dtFinal = obj.GetDeductDataFromSAP (dtRtn); throw an exception: InvalidOperationException exception caught. An error occurred while generating the XML document.



------ Solution ------------------------------------ --------
you above code looks messed up, you may be in order conservative code. So the cause of error is not very clear.
but you can be sure you want to write xml file, write file permissions error estimates.
if only for intermediate data exchange process, I suggest you define XEelement object, or XMLElement object. With variable processing
------ Solution ------------------------------------ --------
please try the DataTable object returns an empty DataTable object and then return empty to s

没有评论:

发表评论