Jump to content

Recommended Posts

Hi everybody,

 

I start with prestashop 1.7 and try to do a WS API for sync my mongoDB with prestaDB. I found in documentation 2 way to do this with new hook AddWebserviceResources :

with class or with specific_management.

 

With class, i extend objectmodel for bind my table, in $webserviceParameter in push objectMethods with [update=>'updateWs']

but i doesn't know how manage the output. My function updateWs can return true, but i want return my own response with JSON

 

With implementing WebserviceSpecificManagementInterface i cannot retrieve body parameter (inputXML of wsobject is protected) but i can modify this->output and do $this->objOutput->getObjectRender()->overrideContent($this->output)

Can anyone write some little snippet for the right use of this technologies ?

 

BTW : if only class version working it's fine, if i can override the reponse.

 

Thanks a lot

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More