views:

148

answers:

1

i have webservice with one method which recieves xml as string:

[WebMethod]
public int Catch_string(string str)
{  
}

how can i send xml file to this method from win forms?

why doesn't it work^

HttpWebRequest req = 
(HttpWebRequest)WebRequest.Create("http://localhost/test/service.asmx");
       req.ContentType = "text/xml;charset=\"utf-8\"";
       req.Accept = "text/xml";
       req.Method = "POST";
       Stream stm = req.GetRequestStream();
       outXml.Save(stm);
       stm.Close();
+1  A: 

Add a webreference to your winforms application and use the generated proxy class to invoke the webservice.

Checkout this link for implementation details.

Vinay B R
sry. solved my problem/ thx to all
eba