Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • David McGawn 37 posts 150 karma points
    Feb 08, 2017 @ 10:38
    David McGawn

    Hi all i am new to Soap request and i am trying to work out how i can do a POST request to one of our partners to send them information in XML format

    the code i have so far is, any help would be appreciated, as i said this is my first time doing it this way, i can do it with JavaScript no problem but the receiving nginx server doesn't have cors access.

    also another this doing it server side would it even pass the CORS?

     @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using System.Data.Sql;
    @using System.Xml.Linq;
    @using System.Text.RegularExpressions;
    @using System.Security.Cryptography;
    @using System.Text;
    @using Umbraco.Core.Models;
    @using System;
    @using System.Net;
    @using System.IO;
    @using Stream;
    @using StreamReader;
    @using StreamWriter;
        var uri = new Uri("");
        var req = (HttpWebRequest)WebRequest.CreateDefault(uri);
        req.ContentType = "text/xml; charset=utf-8";
        req.Method = "POST";
        req.Accept = "text/xml";
        req.Headers.Add("SOAPAction", "");
        var strSoapMessage = @"<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap=' 'xmlns:xsi='' xmlns:xsd=''><soap:Body><add xmlns=''><a>23</a><b>5</b></soap:Body></soap:Envelope>";
        var stream = new StreamWriter(req.GetRequestStream(), Encoding.UTF8);



Please Sign in or register to post replies

Write your reply to: