Select to view content in your preferred language

Passing token value to soap requests

909
2
06-24-2013 10:44 PM
PiotrRusinek1
New Contributor
In my SL5 Application I am parsing ArcGIS Server using wsdl mechanism. I use GetServiceDescriptions passing root of ArcGIS Server as endpoint address. I m getting in results all services which are public. I want to know how to pass token to request GetServiceDescriptions to get services which are available to logged in user.

I tried something like this:
            var u = new UriBuilder(rootUri);
            var cred = ESRI.ArcGIS.Client.IdentityManager.Current.FindCredential(rootUri);
            System.ServiceModel.Channels.AddressHeader token ;
            if (cred != null)

                token = System.ServiceModel.Channels.AddressHeader.CreateAddressHeader("token",string.Empty, cred.Token);
            else
                token = null;
            if (token != null)
            {
                folderCli.Endpoint.Address = new System.ServiceModel.EndpointAddress(u.Uri, token);

            }
            else
                folderCli.Endpoint.Address = new System.ServiceModel.EndpointAddress(rootUri);

But it doesnt work. I tried to google something but all result speaks about rest and jsons. I dont want to change wsdl to something else - it's to big change (almost whole modelview to exchange)
Thx in advance for any advice.
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
You could try adding a query parameter to your Uri: .....?token=<token>

Never tested though, I rarely use soap end point.
0 Kudos
PiotrRusinek1
New Contributor
Thank you for answer. 
I tried this way but without success.  Request generated response with message Resource not found.  I tried to seend token as cookie value with name token and agstoken also without success.
0 Kudos