OMG rvdavid you are a genius and you don't even know it. Your post brought to my attention that I am using an if instead of elseif for some strange reason. I have changed this and it works with no problem at all now, I have no idea why I did not notice this before.
glad it worked with no probs for you.
As time goes on I will be trying to streamline it a bit.
when you refactor, keep in mind that objects are allowed to have certain responsibilities,
So next time, instead of creating a generic "object to array" function/method outside of the SOAP objects, maybe you can add a specialised "toArray()" method to each/or one of the SOAP classes instead of creating a converter object which tries to understand how the two objects work.
I am making a class that decides wether to use nusoap or php soap extension (if php soap extension is not available it uses nusoap). nusoap returns results as an array.
If that is all the class does, then maybe you can glue it onto a lower level class because by the sounds of it, it doesn't warrant an object.
Off the top of my head, I'd suggest that you write up a decorator for the PHP SOAP object and add a "toArray()" or "export()" method which does the object to array conversion without having to perform logic on if it is or is not an object.
Or perhaps yuo could go the other way, and throw the array produced by NUSOAP into a DataSpace() class - which is really a glorified hash or create a decorator which uses the array exported by NUSOAP to match the way PHPSOAP's properties and object structure are organised.
If you were looking to streamline, refactor responsibilities so that they are not so general.