Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83109

C# soap request to websevice

$
0
0
Hey, I have build a C# page where i can get data from my (Mendix) webservice. This should give the name to my Mendix app, and the mendix app uses this name to create an object. Then it should return the object in XMl, but intsead it returns the HTML of the page and it doesn't create an object. Does somebody know how to fix this? Here is my c# code:   public void Execute()     {       HttpWebRequest request = CreateWebRequest();       XmlDocument soapEnvelopeXml = new XmlDocument();       soapEnvelopeXml.LoadXml(@"        Naam1234      ");       using (Stream stream = request.GetRequestStream())       {         soapEnvelopeXml.Save(stream);       }       using (WebResponse response = request.GetResponse())       {         using (StreamReader rd = new StreamReader(response.GetResponseStream()))         {           string soapResult = rd.ReadToEnd();           System.Diagnostics.Debug.WriteLine(soapResult);         }       }     }     ///      /// Create a soap webrequest to [Url]     ///      ///      public HttpWebRequest CreateWebRequest()     {       HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(@"http://localhost:8080/ws-doc/Published_web_service/SoapRequest");       webRequest.Headers.Add(@"SOAP:Action");       webRequest.ContentType = "text/xml;charset=\"utf-8\"";       webRequest.Accept = "text/xml";       webRequest.Method = "POST";       return webRequest;     }     protected void Button1_Click(object sender, EventArgs e)     {        Execute();          }   } Here is my Mendix microflow:

Viewing all articles
Browse latest Browse all 83109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>