diff --git a/wp-rest/Controller/Soap.php b/wp-rest/Controller/Soap.php deleted file mode 100644 index 5bbabcd..0000000 --- a/wp-rest/Controller/Soap.php +++ /dev/null @@ -1,100 +0,0 @@ -get_namespace(), $this->get_rest_base(), [ - [ - 'methods' => \WP_REST_Server::ALLMETHODS, - 'permission_callback' => '__return_true', - 'callback' => [$this, 'get_item'], - ], - ]); - - } - - /** - * Get items. - * - * @since 5.25 - * - * @param WP_REST_Request $request - */ - public function get_item($request) { - - /** - * Filter request params. - * - * @since 5.25 - * - * @param array $params - * @param WP_REST_Request $request - */ - $params = apply_filters('civi_wp_rest/controller/soap/params', $request->get_params(), $request); - - // Init soap server. - $soap_server = new \SoapServer( - NULL, - [ - 'uri' => 'urn:civicrm', - 'soap_version' => SOAP_1_2, - ] - ); - - $crm_soap_server = new \CRM_Utils_SoapServer(); - - $soap_server->setClass('CRM_Utils_SoapServer', \CRM_Core_Config::singleton()->userFrameworkClass); - $soap_server->setPersistence(SOAP_PERSISTENCE_SESSION); - - // Bypass WordPress and send request from Soap server. - add_filter('rest_pre_serve_request', function($served, $response, $request, $server) use ($soap_server) { - - $soap_server->handle(); - - return TRUE; - - }, 10, 4); - - } - - /** - * Item schema. - * - * @since 5.25 - * - * @return array $schema - */ - public function get_item_schema() {} - - /** - * Item arguments. - * - * @since 5.25 - * - * @return array $arguments - */ - public function get_item_args() {} - -} diff --git a/wp-rest/Plugin.php b/wp-rest/Plugin.php index db911af..ad11ac8 100644 --- a/wp-rest/Plugin.php +++ b/wp-rest/Plugin.php @@ -142,10 +142,6 @@ public function register_rest_routes() { $widget_controller = new Controller\Widget(); $widget_controller->register_routes(); - // Soap controller. - $soap_controller = new Controller\Soap(); - $soap_controller->register_routes(); - /** * Opportunity to add more rest routes. * diff --git a/wp-rest/README.md b/wp-rest/README.md index 8f93110..11c0ad1 100644 --- a/wp-rest/README.md +++ b/wp-rest/README.md @@ -48,8 +48,6 @@ This code exposes CiviCRM's [extern](https://github.com/civicrm/civicrm-core/tre 8. `civicrm/v3/widget` - a substition for `civicrm/extern/widget.php` -9. `civicrm/v3/soap` - a substition for `civicrm/extern/soap.php` - **_Note_**: this endpoint has **not been tested** ### Settings