using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
namespace SOAPTest
{
public class Program
{
/// <summary>
/// Execute a Soap WebService call
/// </summary>
public static void Execute()
{
HttpWebRequest request = CreateWebRequest();
XmlDocument soapEnvelopeXml = new XmlDocument();
soapEnvelopeXml.LoadXml(@"<?xml version=""1.0"" encoding=""utf-8""?>
<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:web=""http://api.channeladvisor.com/webservices/"">
<soapenv:Header>
<web:APICredentials>
<web:DeveloperKey>???????</web:DeveloperKey>
<web:Password>??????</web:Password>
</web:APICredentials>
</soapenv:Header>
<soapenv:Body>
<web:GetAuthorizationList />
</soapenv:Body>
</soapenv:Envelope>");
using (Stream stream = request.GetRequestStream())
{
soapEnvelopeXml.Save(stream);
}
using (WebResponse response = request.GetResponse())
{
using (StreamReader rd = new StreamReader(response.GetResponseStream()))
{
string soapResult = rd.ReadToEnd();
Console.WriteLine(soapResult);
}
}
}
/// <summary>
/// Create a soap webrequest to [Url]
/// </summary>
/// <returns></returns>
public static HttpWebRequest CreateWebRequest()
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(@"https://api.channeladvisor.com/ChannelAdvisorAPI/v7/AdminService.asmx?WDSL");
webRequest.Headers.Add(@"SOAP:Action");
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
return webRequest;
}
static void Main(string[] args)
{
Execute();
}
}
}
There is also a lot of talk about using tokens. Are they needed to run an example like this?
Thanks,
Martin
--
You received this message because you are subscribed to a topic in the Google Groups "ChannelAdvisor Developer Network" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadn/09C7GT9oKpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cadn+unsubscribe@googlegroups.com.
To post to this group, send email to ca...@googlegroups.com.
Visit this group at https://groups.google.com/group/cadn.
For more options, visit https://groups.google.com/d/optout.
This email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited.
Martin
--
You received this message because you are subscribed to a topic in the Google Groups "ChannelAdvisor Developer Network" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadn/09C7GT9oKpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cadn+unsubscribe@googlegroups.com.
To post to this group, send email to ca...@googlegroups.com.
Visit this group at https://groups.google.com/group/cadn.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to ca...@googlegroups.com.
To post to this group, send email to ca...@googlegroups.com.
Visit this group at https://groups.google.com/group/cadn.
For more options, visit https://groups.google.com/d/optout.
--Martin PalmerIntegrations DeveloperHerschel Supply CompanyThis email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited
This email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited.
--
You received this message because you are subscribed to a topic in the Google Groups "ChannelAdvisor Developer Network" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadn/09C7GT9oKpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ca...@googlegroups.com.
To post to this group, send email to ca...@googlegroups.com.
Visit this group at https://groups.google.com/group/cadn.
For more options, visit https://groups.google.com/d/optout.
--Martin PalmerIntegrations DeveloperHerschel Supply CompanyThis email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited
This email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited.
--
You received this message because you are subscribed to a topic in the Google Groups "ChannelAdvisor Developer Network" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadn/09C7GT9oKpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ca...@googlegroups.com.
To post to this group, send email to ca...@googlegroups.com.
Visit this group at https://groups.google.com/group/cadn.
For more options, visit https://groups.google.com/d/optout.
--Martin PalmerIntegrations DeveloperHerschel Supply CompanyThis email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited
This email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited.
--
You received this message because you are subscribed to a topic in the Google Groups "ChannelAdvisor Developer Network" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadn/09C7GT9oKpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ca...@googlegroups.com.
To post to this group, send email to ca...@googlegroups.com.
Visit this group at https://groups.google.com/group/cadn.
For more options, visit https://groups.google.com/d/optout.
--Martin PalmerIntegrations DeveloperHerschel Supply CompanyThis email (including any attachments) may contain confidential and/or privileged information. Any unauthorized distribution, copying or disclosure is prohibited