Skip to content

Service 'OU' already exists #203

Open
@artmcel

Description

@artmcel

Hello, I'm trying to bulding a kind of API routes in Laravel9 but when try a php artisan route:list command, returns:

Artisaninweb\SoapWrapper\Exceptions\ServiceAlreadyExists
Service 'OU' already exists.
at C:\wamp64\www\soap-laravel\vendor\artisaninweb\laravel-soap\src\Artisaninweb\SoapWrapper\SoapWrapper.php:47
 43▕
 44▕       return $this;
 45▕     }
 46▕
➜  47▕     throw new ServiceAlreadyExists("Service '" . $name . "' already exists.");
 48▕   }
 49▕
 50▕   /**
 51▕    * Add services by array
        services by array

1   C:\wamp64\www\soap-laravel\app\Http\Controllers\OperacionesUnificadasController.php:23
  Artisaninweb\SoapWrapper\SoapWrapper::add("OU", Object(Closure))

2   [internal]:0
  App\Http\Controllers\OperacionesUnificadasController::__construct(Object(Artisaninweb\SoapWrapper\SoapWrapper))

I'm usign this version "artisaninweb/laravel-soap": "0.3.0.10",

I checked all my controllers and anyone is repeat.

This is my __contructor().

public function __construct(SoapWrapper $soapWrapper)
{
    $this->soapWrapper = $soapWrapper;
    
    $this->soapWrapper->add( 'OU', function($service){

        $service
        ->wsdl( 'myURL' )
        ->trace( TRUE );

    });

}

This function is for POST request

public function getNiveles( Request $request){

    //here the request is empty with fetch but with cURL is correct
    //return $request;

    $params = $request->toArray();
    
    /*all methods are diferent*/
    $niveles = $this->soapWrapper->call('OU.Mymethod', [ $params ]);

    if(!$niveles){
        return response()->json(['messagge' => 'error']);
    }else {
        return $niveles->ObtenerCatalogoNivelEscolarResult->NivelDTO;
    }
}

My routes

Route::controller(OperacionesUnificadasController::class)->group(function(){
    // route with Reques method
    Route::get('oferta/planteles', 'getPlanteles');
    Route::any('oferta/niveles', 'getNiveles');
    Route::post('oferta/periodos', 'getPeriodos');
    Route::post('oferta/carreras', 'getCarreras');
    Route::post('oferta/turnos', 'getTurnos');
    Route::post('agrega-prospecto', 'addProspecto');
    Route::post('verifica-prospecto', 'existeProspecto');
    Route::get('estados', 'getEstados');
    Route::post('municipios', 'getMunicipios');
    Route::post('proyeccion', 'addProyeccion');
    Route::post('dia-unimex', 'addDiaUnimex');
    Route::post('prospectacion', 'addProspectacion');
}); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions