Friday, September 4, 2009

Web Service Consumer with Credentials in Domino

Over the last while I've been tearing what little is left of my hair out trying to authenticate with a web service using Domino.

I need to put it down here so I don't forget but hopefully it will be of use to someone else too.

When creating a Web Service Consumer, Domino creates the code for you based on the WSDL

The extra piece in the jigsaw is as follows:
//Code generated by Domino
Sub NEW
Call Service.Initialize ("somethingorother ", _
"somethingorother .Domino", "http://somethingorother/somethingorother?OpenWebService", _
"somethingorother ")
//Code generated by Domino
//Credential Code
Call Service.setCredentials( "Username", "Password" )
//Credential Code
//Code generated by Domino
End Sub
//Code generated by Domino

You can find this in the lsxsd.lss file

Looks like it's only for 8.5. I've tried to hack it to work in 8 but to no avail so far

11 comments:

  1. Thanks Chris! This was exactly what I was looking for!
    But do you know, can I also use encrypted password there instead of palin text ?

    ReplyDelete
  2. Hi Jüri

    I've not tried it.

    Possibly try https:// on the endpoint and set require SSL connection on the database properties.

    Even it doesn't accept an encrypted password, SSL should encrypt the traffic.

    ReplyDelete
  3. Chris -- You made my day!! Thank you for this post -- Sue

    ReplyDelete
  4. I have been looking everywhere for this - THANK YOU!! -- Jeff

    ReplyDelete
  5. Thank you, Thank you, Thank you. I can't believe how long it took to find this answer.

    ReplyDelete
  6. Thank you ! That helped a lot...

    ReplyDelete
  7. Thank you, this was very helpful.
    I was thinking about doing,something like
    http://somethingorother/somethingorother?OpenWebService&username=someuser&password=somepassword.
    But this post helped me.

    ReplyDelete
  8. Thank you !!!!!

    ReplyDelete
  9. For a moment there I thought I had found the answer to my problem :(
    I've got a web service consumer that crashes the notes client when it is invoked. A bit vague I know but could anyone provide any pointers as to what it could be? Thanks
    Dave

    ReplyDelete
  10. Thank you !!!!!

    ReplyDelete
  11. If you need to use SSL, adding this line will make it work:
    Call Service.SetSSLOptions(NOTES_SSL_ACCEPT_SITE_CERTS + NOTES_SSL_ACCEPT_EXPIRED_CERTS)

    ReplyDelete