views:

47

answers:

1

Hello,

I have attempted to extract an attribute from the paypal soap wsdl file using SimpleXml and DOM in php5 but they all skip over the root tag where the namespace declarations are.

It is not clear to me yet how to get a node referencing the root tag so that I can retrieve the value of ns:version using the current attributes function or array reference.

I need the version value for use in the classes I dynamically generate from a wsdl file.

Thanks for any help provided.

[Edit] Solved it already, lol.

A: 

To access namespaced elements, you have to register the appropriate namespaces URIs. See

On a sidenote, there is a ready to use package called

and PHP has a native SOAP extension as well. Using SimpleXML or DOM is like low level access when you can have a convenient API for the PayPal API.

Gordon
Just looked at the package and it seems I am reinventing the wheel... thanks
Edward
@Edward you're welcome. I am pretty sure there is other packages available on the net as well. Have you checked with the [PayPal site](https://www.paypalobjects.com/de_DE/html/IntegrationCenter/ic_sdk-resource.html) already?
Gordon
The current documentation they have is kinda up to date but the soap sdks are old. So I have to derive my own classes using the wsdl file in order to perform updated and compatible api calls.
Edward