Namespace Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
argyle
Forum Newbie
Posts: 3
Joined: Sun Mar 26, 2006 5:05 pm

Namespace Error

Post by argyle »

Hi, all, my first post, please be kind...

I'm currently taking a class in Webservices and XML Programming and I've decided to do my latest project in PHP. The project basically has us communicating with the GoogleSearch Webservice. I know how to use the built in PHP SOAP functions, that's not the problem. The problem is when I'm trying to generate a raw XML SOAP message to print out I get a "Namespace Error" when I try the following line:

Code: Select all

$soapGoogle = new DOMElement('ns1:doGoogleSearch');
I understand that 'ns1' is not in the default namespace, so my question is, how do I include 'ns1' in the default namespace for PHP DOM?

A side note: I know I could generate the XML using strings or by editing an existing XML file, my question is specifically on this namespace issue, so if anyone has the answer to this it would be greatly appreciated.

- jake
Post Reply