Click here to Skip to main content
15,906,947 members
Home / Discussions / C#
   

C#

 
AnswerRe: folder Pin
Peace ON5-May-10 23:33
Peace ON5-May-10 23:33 
AnswerRe: folder Pin
Dave Kreskowiak6-May-10 1:52
mveDave Kreskowiak6-May-10 1:52 
GeneralRe: folder Pin
OriginalGriff6-May-10 2:05
mveOriginalGriff6-May-10 2:05 
QuestionWidth of list view not reducing below certain value Pin
dashingsidds5-May-10 23:04
dashingsidds5-May-10 23:04 
AnswerRe: Width of list view not reducing below certain value Pin
#realJSOP5-May-10 23:21
professional#realJSOP5-May-10 23:21 
GeneralRe: Width of list view not reducing below certain value Pin
dashingsidds5-May-10 23:47
dashingsidds5-May-10 23:47 
AnswerRe: Width of list view not reducing below certain value Pin
V.6-May-10 1:03
professionalV.6-May-10 1:03 
Questioncannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' [modified] Pin
sirTachyon5-May-10 22:36
sirTachyon5-May-10 22:36 
I have a form with a button.
It sends a XmlDocument (which I load from a xml-file) to a Webservice (webmethod) and it also receives a XML-file to

acknowledge/ACK (or not acknowledge/NACK) the file just being sent.

Code for the button (client-side):
private void button2_Click(object sender, EventArgs e)
{

    ServiceReference1.Service1SoapClient webservice = new ServiceReference1.Service1SoapClient();
    XmlDocument xmlReceived = new XmlDocument();


    XmlDocument xmlSend = new XmlDocument();
    xmlSend.Load("C:\\incoming.xml");

    xmlReceived = webservice.PostNotify(xmlSend);

}



On the server-side I made a simple Webservice. It receives a XML-file and send a XML-file back with a acknowledge or

not acknowledge. I use this code:

[WebMethod(CacheDuration=30)]
public XmlDocument PostNotify(XmlDocument xml)
{

    xml.Save("C:\\save_XML.xml");

    XmlDocument xmlAck = new XmlDocument();
    xmlAck.LoadXml("C:\\acknowledge_XML.xml");

    return xmlAck;
}


I already tried the communications with just sending strings and it worked fine. But when I run it when passing

XmlDocuments it says:
Argument '1': cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement'	


And it refers to the function in the client-side code, the post ...webservice.PostNotify(xmlSend);-part

modified on Thursday, May 6, 2010 5:56 AM

AnswerRe: cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' Pin
#realJSOP5-May-10 23:25
professional#realJSOP5-May-10 23:25 
GeneralRe: cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' Pin
sirTachyon5-May-10 23:56
sirTachyon5-May-10 23:56 
AnswerRe: cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' Pin
Arun Jacob6-May-10 0:50
Arun Jacob6-May-10 0:50 
GeneralRe: cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' Pin
sirTachyon6-May-10 2:10
sirTachyon6-May-10 2:10 
AnswerRe: cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' Pin
Arun Jacob6-May-10 2:43
Arun Jacob6-May-10 2:43 
GeneralRe: cannot convert from 'System.Xml.XmlDocument' to 'System.Xml.XmlElement' Pin
king40210-May-10 17:16
king40210-May-10 17:16 
QuestionConnect To MySQL when working behind proxy Pin
Waheed Ur Rehman5-May-10 20:44
Waheed Ur Rehman5-May-10 20:44 
QuestionDataset Accept change is not working Pin
Shahzad.Aslam5-May-10 20:04
Shahzad.Aslam5-May-10 20:04 
AnswerRe: Dataset Accept change is not working Pin
Peace ON5-May-10 21:13
Peace ON5-May-10 21:13 
Questioni m in need of application code Pin
manila dahal5-May-10 18:06
manila dahal5-May-10 18:06 
AnswerRe: i m in need of application code Pin
riced5-May-10 21:11
riced5-May-10 21:11 
AnswerRe: i m in need of application code Pin
Eddy Vluggen6-May-10 1:03
professionalEddy Vluggen6-May-10 1:03 
QuestionUpdating controls on another form Pin
gmhanna5-May-10 17:57
gmhanna5-May-10 17:57 
AnswerRe: Updating controls on another form Pin
Peace ON5-May-10 21:23
Peace ON5-May-10 21:23 
GeneralRe: Updating controls on another form Pin
DaveyM695-May-10 23:40
professionalDaveyM695-May-10 23:40 
AnswerRe: Updating controls on another form Pin
DaveyM695-May-10 23:29
professionalDaveyM695-May-10 23:29 
QuestionRead certificate from USB Pin
Maurinho05-May-10 12:34
Maurinho05-May-10 12:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.