Forum Xamarin.Forms

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.

I'm using a Web reference and generated proxy class. My request:

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-soap-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-soap-action"

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

Is there maybe a mistake with Mono's implementation of SoapHttpClientProtocol or any of its parent classes?

Sign In or Register to comment.