SOAP SOE Credentials

599
5
02-19-2011 11:07 AM
MeleKoneya
Occasional Contributor III
I have a SOAP SOE that I am trying to access from a .NET console application as a service reference.   The SOE resides on an ArcGIS Server that implements security.   We are using windows authentication to secure our Map Services.

Below is the code to call a method from the SOE:

using (PrintMap_From_LIS_SOE.ServiceReference3.TE_Coll_Offset_SOEPortClient te = new TE_Coll_Offset_SOEPortClient())
   
{
    string coords = te.OffsetCoords("N 94TH ST", "E CACTUS RD", 711670, 944759, "E", 140);
}

I was able to access the SOE before we implemented security and now I am getting this message:

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

How do I pass credentials to the SOE?

Thanks,

Mele
0 Kudos
5 Replies
RichardWatson
Frequent Contributor
We use a custom ASP.NET provider and simply attach a token to the underlying URL of the SOAP service.

I see where you are using Windows Authentication so my solution will not work for you.

If no one else has an answer to this then you might want to start here:

http://davenport.sourceforge.net/ntlm.html

I think that you have to respond to the challenge with credentials.
0 Kudos
CameronIrvine
New Contributor II
I have a SOAP SOE that I am trying to access from a .NET console application as a service reference.   The SOE resides on an ArcGIS Server that implements security.   We are using windows authentication to secure our Map Services.

Below is the code to call a method from the SOE:

using (PrintMap_From_LIS_SOE.ServiceReference3.TE_Coll_Offset_SOEPortClient te = new TE_Coll_Offset_SOEPortClient())
   
{
    string coords = te.OffsetCoords("N 94TH ST", "E CACTUS RD", 711670, 944759, "E", 140);
}

I was able to access the SOE before we implemented security and now I am getting this message:

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

How do I pass credentials to the SOE?

Thanks,

Mele


Hi Mele,

I have exactly the same problem as you have with a print service and a map service legend that now no longer work once Security is enabled.  Did you ever resolve this problem?

Thanks
Cameron
0 Kudos
MeleKoneya
Occasional Contributor III
Cameron,

Here is what I was able to do to get my console application to call my SOE with security in place on ArcGIS Server.   After I added a service reference to my SOE (WSDL) in VS 2010,   I went in and changed the security tag in app.config from this:

<security mode="None">
     [INDENT]<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
     <message clientCredentialType="UserName" algorithmSuite="Default" />[/INDENT] </security>

To this:

<security mode="TransportCredentialOnly">
    [INDENT]<transport clientCredentialType="Ntlm" realm="" />[/INDENT]</security>

Hope this helps.   

Mele
0 Kudos
CameronIrvine
New Contributor II
Cameron,

Here is what I was able to do to get my console application to call my SOE with security in place on ArcGIS Server.   After I added a service reference to my SOE (WSDL) in VS 2010,   I went in and changed the security tag in app.config from this:

<security mode="None">
     [INDENT]<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
     <message clientCredentialType="UserName" algorithmSuite="Default" />[/INDENT] </security>

To this:

<security mode="TransportCredentialOnly">
    [INDENT]<transport clientCredentialType="Ntlm" realm="" />[/INDENT]</security>

Hope this helps.   

Mele


Hi Mele,

Thanks for your help on this.  Seeing that ours is a web service rather than a application I tried to add the transportcredentialonly mode into the web.config of the web service but there was no transport under the transportcredentialonly mode.  Any ideas how I would do this with a web service?

Thanks again
Cameron
0 Kudos
MeleKoneya
Occasional Contributor III
Cameron,

I talked with our developer who is using our Print Server Object Extension from a WPF application.   Within the WPF application, a web reference is created to our WSDL for the SOE.  They are calling it with the following code:

            string xml = Serializer.SerializeMapInfo(MyMap, txtTitle.Text.Replace("'","''"), cboPaperSize.SelectedIndex);
            using (var proxy = new LIS_Print_SOE_lis_print())
            {
                AppStatsLogger.Log("LIS", "PDF made", 1);
                proxy.LIS_Print_PDFCompleted += proxy_LIS_Print_PDFCompleted;
                proxy.UseDefaultCredentials = true;
                proxy.LIS_Print_PDFAsync(xml);
            }

I am not an expert on this method to pass the credentials, but you can see that there is a 'UseDefualtCredentials' property.     I am assuming that it is using the user's  credentials on our city domain to pass to the SOE.

Hope this points you in the right direction,

Mele
0 Kudos