You could use HttpWebRequest passing the WS url and request Soap message with data to the web service, please check this article about invoding web service using HttpWebRequest.
Usually we use HttpWebRequest to post request soap message to web service whose based on Soap. and if you want to post data to another web site page using HttWebRequest, then you can refer to the following article.
programercek
Participant
1510 Points
2244 Posts
How does SOAP, how to send data to another Web site?
Jan 26, 2012 09:19 PM|LINK
Hi,
How to another website send data with SOAP?
I do not know where to start, or how.
If you can help me, I'll be very grateful.
AZMatt
Star
10622 Points
1893 Posts
Re: How does SOAP, how to send data to another Web site?
Jan 26, 2012 09:26 PM|LINK
Here is a good video about it...
http://www.asp.net/web-forms/videos/how-do-i/how-do-i-create-and-call-a-simple-web-service-in-aspnet
Matt
programercek
Participant
1510 Points
2244 Posts
Re: How does SOAP, how to send data to another Web site?
Jan 26, 2012 09:54 PM|LINK
I have VS2010.
Video that you sent. I do not have WebService on Framework4? This is only on Framework2?
Peter pi - M...
Star
12871 Points
1786 Posts
Re: How does SOAP, how to send data to another Web site?
Feb 01, 2012 04:13 AM|LINK
Hi,
You could use HttpWebRequest passing the WS url and request Soap message with data to the web service, please check this article about invoding web service using HttpWebRequest.
http://geekswithblogs.net/marcel/archive/2007/03/26/109886.aspx
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
programercek
Participant
1510 Points
2244 Posts
Re: How does SOAP, how to send data to another Web site?
Feb 01, 2012 08:50 AM|LINK
Hello,
thanks for your help.
Maybe you can help me? Why no redirect on webpage default.aspx if I POST on the default.aspx?
[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { [WebMethod] public string Register(long id, string data1) { return "ID.CUSTOMER"; } string soap = @"<?xml version=""1.0"" encoding=""utf-8""?> <soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""> <soap:Body> <Register xmlns=""http://tempuri.org/""> <id>123</id> <data1>string</data1> </Register> </soap:Body> </soap:Envelope>"; public Service () { HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://localhost:51696/WebSite4/Default.aspx"); req.Headers.Add("SOAPAction", "\"http://tempuri.org/Register\""); req.ContentType = "text/xml;charset=\"utf-8\""; req.Accept = "text/xml"; req.Method = "POST"; using (Stream stm = req.GetRequestStream()) { using (StreamWriter stmw = new StreamWriter(stm)) { stmw.Write(soap); } } WebResponse response = req.GetResponse(); Stream responseStream = response.GetResponseStream(); // TODO: Do whatever you need with the response //Uncomment the following line if using designed components //InitializeComponent(); }Peter pi - M...
Star
12871 Points
1786 Posts
Re: How does SOAP, how to send data to another Web site?
Feb 02, 2012 07:10 AM|LINK
Hi,
Usually we use HttpWebRequest to post request soap message to web service whose based on Soap. and if you want to post data to another web site page using HttWebRequest, then you can refer to the following article.
http://www.worldofasp.net/tut/WebRequest/Working_with_HttpWebRequest_and_HttpWebResponse_in_ASPNET_114.aspx
You can also look into Web Services to accomplish it.
Hope this helps
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework