Getting HelloWorld

This is to establish a webservices connection using SOAP. There is a file on a server I have and I am trying to return a value. I have a button that has an action with this code in it :

  dim sock as new HTTPSecureSocket
  dim CertFile As FolderItem = wildcardwithkey.pfx
  sock.CertificateFile =CertFile
  dim URL as String = "https://tsfarm.tammsonline.com/SlimWebService1.asmx?WSDL"
  dim WebService as new SOAPMethod()
  WebService.UseSocket(sock)
  WebService.LoadWSDLFromURL (URL)

I am not sure how to add the certificate file to the code. Once I have access to that there is a function called Hello World, that should display output. Please guide me Obi-Wan’s of the code world.

Where is this file?

You have to actually point the FolderItem to the file somehow. For example, if the file is on the desktop:

Dim CertFile As FolderItem = SpecialFolder.Desktop.Child(“wildcardwithkey.pfx”)

The certificate file is needed, so far as I know, only when you are listening for a connection, not when you make a SSL based connection to consume a web service. I was just monkeying around with this yesterday, so I can definitely be wrong about this, but I think that is the way it works.

HTTPSecureSocket is based upon SSLSocket, which is where it inherits the certificate file property from, and what I am basing the suggestion above on. Of course, if you have a local certificate that was issued to connect to the service with, then you do need to use it. I have not tried that.

Very interested in this answer myself- the docs are quite unclear to me.

http://documentation.xojo.com/index.php/SSLSocket.CertificateFile

-Paul

@Paul Lefebvre Looks like that worked for me. Now to figure the rest out :slight_smile: