How to create a web service in zend-soap (or laminas-soap) with parameters with hyphens in their name?

161 Views Asked by At

I'm trying to create my first web service with zend-soap, but I need it to have some parameters with hyphens (like parameter-name). I have to implement a given WSDL so I can't change this requirement.

How can I do it, since PHP doesn't allow variables with hyphens?

1

There are 1 best solutions below

0
LearnPhpOnline On

Do you use the autodiscover functionality? The class attributes are being converted to the WSDL parameters so you have to go by the attribute syntax of PHP. So in this situation I think it's only possible if you make your own WSDL or make a core change in Zend, but I don't think that would be a good advice.