Hi Friends,
I am trying to call a Java Web Service from .Net using C#. This is a SOAP request that I am making.
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlFile);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Headers.Add("SOAPAction", "\"\"");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
xmlDoc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
string sRet = r.ReadToEnd();
WriteLogFile("SOAP Response:" + sRet);
return sRet;
When I try the above request it fails and the Java client doesnt get any request message. But when I change the
req.Method = "POST"; to
req.Method = "updateTableFromXML";
then the java client can see the message with the method name(UPDATETABLEFROMXML) that I am calling in the web service.
Now they want me to send the parameter along with the method name. I am having difficulties in sending this parameter which is an xml file stored in an string.
Please advice how can i resolve this issue.
Thanks,
-Nitin.