SOAP Action parameter is missing

phantonymphantonym Member ✭✭
edited February 2018 in Xamarin.Forms

I'm trying to consume a web service that uses Soap 1.2.

Added the WSDL reference and using VS-generated proxy class:

var client = new MyApp.Droid.MyWS.AuthService();
var response = client.InitSession();

From generated Reference.cs:

[System.Web.Services.WebServiceBindingAttribute(Name="AuthService", Namespace="link-to-namespace")]
public partial class AuthService : SoapHttpClientProtocol

    public AuthService()
    {
        SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
        ...
    }

    [SoapDocumentMethod("link-to-action", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
    public SResponse InitSession(InitSessionRequest request)
    {
        ...

My request fails because the action parameter is not included in the HTTP header:

Content-Type: application/soap+xml; charset=utf-8

Required header:

Content-Type: application/soap+xml; charset=utf-8; action="link-to-action"

Meanwhile, the same code works successfully in ASP.NET Web Forms.

Are there maybe errors in Mono Framework?

Sign In or Register to comment.