I believe it should be possible for module to allow an override when parameters are passed. (needed this with custom wsdl)
Just implemented a hook that can be implemented by other modules. Perhaps not the best way but I saw no other possibility to set the correct parameters.
See patch for changed code.
Here is an example of the code I used in my module
/**
* Implements hook_wsclient_parameter()
*
* Overrides the parameters for getEvents
*/
function ao_service_wsclient_parameter($named_arguments, $operation) {
if ($operation == 'getEvents') {
$args_out['eventsRequest'] = $named_arguments['parameter'];
return $args_out;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Screenshot-1.png | 168.14 KB | domidc |
| wsclient-parameter-override.patch | 800 bytes | domidc |
Comments
Comment #1
klausiHm, why would modules want to change parameters? The WSDL explicitly defines how parameters should be passed, so changing them would violate the service contract. What is your use case?
Comment #2
domidc commentedWell actually it kind of happend because the parameter was not correctly set when the wsdl was imported. In the screenshot you see it has parameter set instead of eventsRequest. I dont know if this is due to a malformed wsdl/xsd or due to an error in the import. It seems that the name is taken from the part instead of the element. Is that how it is supposed to be done? Anyways setting the setting to eventsRequest solved my problem. No need for the hook anymore.
Comment #3
klausiLooks like a problem during the import of the WSDL. Can you post your WSDL without PHP variables in it so that I can test it?
Comment #4
klausiReopen if this is still an issue.
And you can also use hook_wsclient_service_load() to mess around with operations and parameters after a service description has been loaded.