Hi, I am having a strange problem:
I have a SOAP service which has a method "delete".
Now everytime, I execute

$service = wsclient_service_load('producthandler');

    try {
        $result = $service->delete(array('tag' => $tag));
        .....

the service itself is deleted. How can this be? How can I solve this problem?

Comments

vistree’s picture

Sorry for pushing, but is the deletion of the service itself (it is removed from the wsclinte UI) an expected behaviour? I can't find a "service->delete" or "this->delete" in the module code ....

georgir’s picture

I'd say that it is expected behavior, because $service is an entity object:

class WSClientServiceDescription extends Entity

The Entity class is defined in the Entity API contrib module, if you are interested in the code.
To call a service method with the name 'delete', you can use invoke:

$result = $service->invoke('delete', array('tag' => $tag))
vistree’s picture

Hi georgir,
thank you for this!!!
Kind regards and a nice weekend

vistree’s picture

And here a small update: I don't know why, but I had to use
$result = $service->invoke('delete', array('delete' =>array('tag' => $tag)))
So, I had to repeat delete as inner array!!

vistree’s picture

Status: Active » Closed (fixed)