Adding SOAP service to the latest Episerver instance

Vote:
 

Hi,

I have e requirement to add a soap service on our end so that another system can send in data through it.. 

i know is old but we dont have so much choice.. 

I found a way for CMS 7 but its removed in the newer versions.. anyone have done it for the new CMS version, i know its hard to make in nice but what are your tips :)? 
Maybe some nice nuget you know about? 

we have CMS 11.. 

thank for any tips :) 

#196186
Aug 21, 2018 15:06
Vote:
 

Hi,

I think you just need to add an ASP.NET Web Service to your solution as described here: 

https://support.microsoft.com/en-au/help/308359/how-to-write-a-simple-web-service-by-using-visual-c-net

This is purely ASP.NET, nothing to do with Episerver.

#196213
Aug 22, 2018 10:10
Vote:
 

Hi,

Tuan Le is right. I gave it a try on CMS 11 (Alloy site) and it works well.

On your CMS project, you can add a Web Service (ASMX) withVisual Studio, says WebService1.asmx 

Then create a WebMethod to accept the post data, for example

/// <summary>
    /// Summary description for WebService1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {
        [WebMethod]
        public string Submit(string data)
        {
            return data;
        }
    }

Then you can try making a SOAP request to your service using Postman. See the below reference for details: 

http://blog.getpostman.com/2014/08/22/making-soap-requests-using-postman/?_ga=2.15521716.349499286.1534926274-299386579.1534926274

Your SOAP message will look like this

<?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>
    <Submit xmlns="http://tempuri.org/">
      <data>Your test data goes here</data>
    </Submit>
  </soap:Body>
</soap:Envelope>

Hope this helps

#196218
Edited, Aug 22, 2018 10:40
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.