Generally speaking, you can typically take PHP code and place a comment at the top:
/* Plugin Name: My SOAP Plugin
You can then create a folder for the plugin inside /wp-content/plugins/ (for example, /wp-conten/plugins/my-soap-plugin/) and place the PHP file inside that folder. At that point, you can activate the plugin from wp-admin.
You can store field values and error messages in session or transient and use them when (re)displaying your form.
In your callback action, if data is not valid, save error message and submitted field values. In admin_notices hook check for saved error message. If there is one, show it as error notice. Don't forget to remove saved session/transient value.