A SOAP client application can interact with 4PSA VoipNow Core server by sending a request (SOAP message) over HTTP. A SOAP message is an ordinary XML document containing the following elements:
Envelope - defines the XML document as a SOAP message, wraps the Header and the Body
Header - contains header information used by 4PSA VoipNow Core to authenticate the user making the request
Body - contains method call and response information
When developing a client application that interacts with the web service, keep in mind the following tasks:
Create a SOAP client based on the web services description in voipnowcoreservice.wsdl
.
Create a SOAP message header containing the authentication data. The authentication can be performed in two ways:
plain credentials -
The header includes the username and password used to log in the 4PSA VoipNow Core interface.
<SOAP-ENV:Header> <ns3:userCredentials xsi:type="https://4psa.com/HeaderData.xsd/2.0.0"> <username>admin</username> <password>welcome</password> </ns3:userCredentials> </SOAP-ENV:Header>
OpenSSL encryption credentials
The header includes the base64 encrypted login. Encrypt the above sequence using the public API key that was configured in
4PSA VoipNow Core. For this purpose, access the Encryption keys management page, by
clicking the
Encryption keys icon, located in the Core features
page. Click the certificate's public key icon
to download the public key, or click on the certificate's name to access all its features, including
its public key.
<SOAP-ENV:Header> <ns2:userCredentials xsi:type="https://4psa.com/HeaderData.xsd/2.0.0"> <cryptedAuth>{base64EncryptedLogin}</cryptedAuth> </ns2:userCredentials> </SOAP-ENV:Header>
Create the SOAP message body to be send to the web service. The body has to be formated in accordance with the method package
definition in schema {Service}Messages.xsd
.
The schema defining the requests may contain elements that are marked as required. If you do not include these elements in your request, the message will not be sent to the web service or will result in a custom fault received from 4PSA VoipNow Core SOAP server.
<SOAP-ENV:Fault> <faultcode>117</faultcode> <faultstring>Request invalid. Missing parameter {param}.</faultstring> </SOAP-ENV:Fault>
Send the request to the web service and process the response.