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

Hello,

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="http://schemas.xmlsoap.org/soap/envelope/"> <s:Header> <Security s:mustUnderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:Username>UserName</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">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("http://placeholder.de/webservice/webService/");
                    System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();

                    client = new RRCWebserviceClient(binding, endpoint);

                    // UserPassword Token for the Header
                    PasswordDigestBehavior behavior = new PasswordDigestBehavior("user", "passwort");
                    client.Endpoint.Behaviors.Add(behavior);

                    client.webservice(request.webserviceRequest1);

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.

THANKS

Sign In or Register to comment.