Right now, it's not easy for non-developers to inspect webservice calls (eg, people on the testing team). I think we need an option to enable logging, which would log details of web service calls to the dblog (watchdog).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klausi’s picture

Sounds like a good idea. I'm a bit buried with other work, but I'm happy to review any patches.

blainelang’s picture

FileSize
949 bytes

Attached is a patch that I use to see the details of the SOAP request and SOAP Response from the actual __soapCall method. I was calling the wsclient defined service in my own module but looked for a way to add a global setting in the wsclient admin screen but did not see a good place. Still this is part of a solution for extra debugging detail.

To enable trace detail, this is how I setup the service to make the SOAP call in my module

  $service = wsclient_service_load('soapbased_fax_service');
  $service->settings['options']['trace'] = TRUE; 
  $result = $service->invoke('getListOfAvailableFaxReports',array('parameters' => array('userName' => 'blaine@example.com', 'password' => 'abc123')));

Normally, I use the devel dsm() to show extra debugging info to the screen (requires the devel module) and the debug function is part of drupal. Having it also write to the log file as an option would be nice to have in the final solution.

klausi’s picture

Status: Active » Needs work

Testing web services is now somewhat covered by the new wsclient_tester submodule that got committed.

An option for more logging would still be nice. The current patch does that only for SOAP services and there is no setting on the actual wsclient_service entity, so this needs some work.

boyan.borisov’s picture

Issue summary: View changes
Status: Needs work » Needs review

I've created a patch which expose a debug setting in the wsclient_service entity. There are 3 levels of the debug:
- No debug
- Enables logging with watchdog
- Enables logging with watchdog and dsm - requires devel module

Also the patch implements debug logging for the both default client services - rest and soap.

boyan.borisov’s picture

I realized that I've missed to upload the patch :)

boyan.borisov’s picture

I am adding a new patch with a few improvements:
- rest client headers are added in the trace debug message
- execution time of a API method is added in the trace debug message

lrodarte’s picture

Hi,

I've applied the patch (wsclient_debug_1801200-5.patch) and I do see the 3 levels of debug options.

What information is specifically being logged? I am using WSclient with Rules, and am interested in seeing the XML that is sent to the web service endpoint (I need to see if I am building out the XML properly). I've looked in the dblog and have being looking at Devel, but am not sure what information is being logged (and I don't see the XML either).

I come from a product management/design background, so please pardon me if I am asking something dumb.

Many thanks.

vistree’s picture

Is this path supposed also to log to watchdog when using tester? I don't get any entries inside dblog.

dman’s picture

Re-roll and repaired for conflicts. Several code tidy-ups. I still think this needs work though, it's a bit clunky and puts a LOT of heavy response data into the watchdog when run on significant transactions