Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Oct 23, 2019 1:32 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: SOAP call of a webservice
PostPosted: Tue Jan 17, 2012 7:17 am 
Offline

Joined: Thu Jul 14, 2011 4:30 pm
Posts: 25
Hello,

i haver to translate a SOAP call of an webservice from .NET to RB.

Here is the source in .NET:

string url = "http://macnas11:7047/DiVA602/WS/DiVA%20Versandhandel%20601/Page/Contact”;

StringBuilder soap = new StringBuilder();
soap.Append ("<?xml version='1.0' encoding='utf-8'?>");
soap.Append("<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>");
soap.Append("<soap:Body>");
soap.Append("<Read xmlns='urn:microsoft-dynamics-schemas/page/contact'>");
soap.Append("<No>100128</No>");

soap.Append("</Read>");
soap.Append("</soap:Body>");
soap.Append("</soap:Envelope>");

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
XmlDocument soapEnvelopeXml = new XmlDocument();

webRequest.Headers.Add("SOAP Action", "urn:microsoft-dynamics-schemas/page/contact:Read");
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
webRequest.UseDefaultCredentials = false;
webRequest.Credentials = mNetworkCredential;

soapEnvelopeXml.LoadXml(soap.ToString());
using (Stream stream = webRequest.GetRequestStream())
{
soapEnvelopeXml.Save(stream);

}

using (WebResponse response = webRequest.GetResponse())
{
using (StreamReader rd = new StreamReader(response.GetResponseStream()))
{
string result = rd.ReadToEnd();
}
}

Thanks for your help!

Leffe


Top
 Profile  
Reply with quote  
 Post subject: Re: SOAP call of a webservice
PostPosted: Tue Jan 17, 2012 12:08 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Simply use HTTPSocket with it's options.


Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group