This quick test assumes access to NHS Digital Opentest or one of the Path to live environments, using a template of the GetNHSNumber message and curl to access the service.
Firstly we convert the NHS Digital provided PKCS#12 file (for a specific environment) into a PEM, for use with curl: openssl pkcs12 -in pkcs_filename.p12 -out pem_filename.pem -nodes -clcerts
Using this file getNHSNumber.xml which contains a test patient example from the opentest environment, execute the following curl command, substituting the certificate name and message endpoint (Opentest url shown in example). Note: the patient search details may need to be altered depending on the environment being accessed.
$ curl -i -X POST -H “SOAPAction: urn:nhs-itk:services:201005:getNHSNumber-v1-0” -H “content-type: text/xml” –E pem_filename.pem -d @getNHSNumber.xml -k https://192.168.128.11/smsp/pds
Note: there are some variations in curl 7.43.0 on OS X, this is a working command line:
$ curl -X POST -H SOAPAction:urn:nhs-itk:services:201005:getNHSNumber-v1-0 -H content-type:text/xml -E p12_filename.p12:Password -d @getNHSNumber.xml -k https://192.168.54.6/smsp/pds
This will return:
The returned NHS number is 9473480032.