Apply Security Header to SOAP Service in PCL or Android+iOs


I try to consume a SOAP webservice in Xamarin. I implemented the service as service reference(pcl) and was web reference(proxy/iOs+Android project). I can get data from any other web services that dont need a security header. The problem is the web service I need to consume has a security header and I cant find any spot to add this informations.

I have no access to modify the web service.

In SOAPUi the following Header does the job:
<s:Envelope xmlns:s=""> <s:Header> <Security s:mustUnderstand="1" xmlns=""> <wsse:UsernameToken xmlns:wsu="" xmlns:wsse=""> <wsse:Username>UserName</wsse:Username> <wsse:Password Type="">Password</wsse:Password> </wsse:UsernameToken> </Security> </s:Header> ...

My Code that works in "normal" .net applications:

        var request = new webserviceRequest();
                    var requestType = new webserviceRequestType
                   //parameter declaration
                    request.webserviceRequest1 = requestType;

                    System.ServiceModel.EndpointAddress endpoint = new System.ServiceModel.EndpointAddress("");
                    System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();

                    client = new RRCWebserviceClient(binding, endpoint);

                    // UserPassword Token for the Header
                    PasswordDigestBehavior behavior = new PasswordDigestBehavior("user", "passwort");


But it seems that my class PasswordDigestBehavior that references from IEndpointBehavioris is not implement in the mono framework. Anyone has a way how to deal it? PCL oder not I dont care.


Sign In or Register to comment.