Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service 'OU' already exists #203

Open
artmcel opened this issue Oct 5, 2022 · 0 comments
Open

Service 'OU' already exists #203

artmcel opened this issue Oct 5, 2022 · 0 comments

Comments

@artmcel
Copy link

artmcel commented Oct 5, 2022

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');
}); 
@artmcel artmcel changed the title SOAP-ERROR: Encoding: object has no 'X' property with Fetch Service 'OU' already exists Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant