function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tim__mTim__m 

Callout to a SOAP service that uses NTLM authentication

Is it possible to make a callout from APEX to a SOAP web service that uses NTLM authentication? If so is there documentation and or samples?

 

I was able to generate an apex class from the WSDL but I don't know how to use it with NTLM auth and I have a funny feeling its not even possible.

 

NTLM authentication is always getting in my way (unless I'm building in .NET) but I have no say in what authentication protocol is used.

mravagnamravagna

Tim, did you ever figure this out?  I'm stuck on the same thing.

Deepika GulatiDeepika Gulati
Hi 

I think i am little late but i recently solved this issue. 
We had MSD-SFDC integration where a SOAP Service was exposed on Nav2013 server. 

The mode of authentication used was NTLM authentication. 

I downloaded the classes from the below package in my org for Encryption of user name and password : 
https://github.com/natewallace/ApexNTLM

For integration, we made a HTTP call : 
        MSDCredentials__c mc = MSDCredentials__c.getValues('MSD Credentials');
        String username = mc.Domain__c + '\\' + mc.Username__c;
        String password = mc.Password__c;  
        HttpClient httpObj = new HttpClient(username,password,True);
        MSDIntegrationURL__c urlVar; 

        HttpRequest req = new HttpRequest();
        String body = createXMLRequest(request);    
        req.setBody(body);

        String ep;
        ep = urlVar.EndPointURL__c;
        Map<String,String> headerMap = new Map<String,String>();
        headerMap.put('SOAPAction',urlVar.SOAPAction__c);
        headerMap.put('Content-Type','text/xml;charset=UTF-8');
        headerMap.put('Accept-Encoding','gzip,deflate');
            
        req.setEndpoint(ep);
        req.setMethod('POST')

        Httpresponse res = new Httpresponse();
    
        res = httpObj.send(req,headerMap);


The SOAP Action can be obtained from RAW request in SOAP UI client.

Let me know if this helps. 

Thanks.

        
Willebaldo Páez MartínezWillebaldo Páez Martínez
Hello,
I have execute the code but I have a error: System.HttpResponse[Status=Bad Request, StatusCode=400]
I think is the BodyXML is wrong, someone have an example of this?

Thanks...

 
Smith david 6Smith david 6
https://www.affilorama.com/member/kaanya556
https://coolors.co/u/aanya_kapoor
http://challengeroulette.com/UserProfile/tabid/43/UserID/2258831/Default.aspx
http://myboxmoving.com/UserProfile/tabid/43/userId/706456/Default.aspx
http://riosabeloco.com/User-Profile/userId/155164
http://www.elektroenergetika.si/UserProfile/tabid/43/userId/407919/Default.aspx
https://www.bassettiphoto.com/User-Profile/UserId/15778
https://gaiauniversity.org/members/aanya556/profile/
https://www.buymeacoffee.com/kaanya556n
https://myblogu.com/profile/aanya556
https://www.gamerlaunch.com/community/users/blog/6191202/?mode=view&gid=535 (https://www.gamerlaunch.com/community/users/blog/6191202/?mode=view&gid=535)
http://newdigital-world.com/members/aanya556.html
https://kustomcoachwerks.com/Forums/users/aanya556/
http://www.texasbbqforum.com/memberlist.php?mode=viewprofile&u=21159 (http://www.texasbbqforum.com/memberlist.php?mode=viewprofile&u=21159)
https://www.jqwidgets.com/community/users/aanya556/
https://roomstyler.com/users/aanya556
https://desall.com/User/aanya556/Profile
https://forum.smartcanucks.ca/members/aanya556/
https://www.soshified.com/forums/user/560211-aanya556/
http://www.thereichertfoundation.org/UserProfile/tabid/42/userId/194072/Default.aspx
http://vjf.dk/UserProfile/tabid/63/userId/254810/language/da-DK/Default.aspx
https://aanya556.gumroad.com/
https://jsfiddle.net/aanya556/ek09ba1v/
https://forums.powwows.com/member/1152487-aanya556/about
https://www.1001fonts.com/users/aanya556/
https://www.teachertube.com/user/channel/aanya556
https://databasin.org/people/aanya556/
https://conifer.rhizome.org/aanya556
https://bikepgh.org/message-board/users/aanya556/
https://community.allen-heath.com/members/aanya556/
https://www.stencyl.com/users/index/1154881
https://www.planetnatural.com/forums/users/kaanya556/
https://support.advancedcustomfields.com/forums/users/aanya556/
http://ifoundthisongoogle.meducation.net/resources/1779352-The-Calendrier
http://csrid.potensi-utama.ac.id/ojs/index.php/CSRID/user/viewPublicProfile/40770
https://forums.phpfreaks.com/profile/213544-aanya556/?tab=field_core_pfield_13
https://forums.focus-entmt.com/user/aanya-k
https://jobs.cncf.io/employers/1283287-aanya
https://www.siccness.net/xf/members/aanya556.81217/#about
https://linustechtips.com/profile/1028462-aanya556/?tab=field_core_pfield_46
https://gotartwork.com/Profile/aanya-kapoor/152004/
https://www.cakeresume.com/me/aanya-kapoor