Michael McGinnis's Avatar

Michael McGinnis

26 Sep, 2012 02:21 PM

I'm looking at the PHP Github examples while waiting for our IT department to give me access to web services. I'm just learning how to read the WSDL file.

On lines 20-21 of https://github.com/hannonhill/Webservices-PHP-Sample-Project/blob/m...
it says:

$xmlBlock = $reply->readReturn->asset->xmlBlock;
$xmlBlock->metadata->title="A new title";

Could that be changed to

    $xhtmlBlock = $reply->readReturn->asset->xhtmlDataDefinitionBlock;
    $xhtmlBlock->metadata->title="A new title";

Would this work if I wanted to replace the content instead of the metadata?

    $xhtmlBlock->xhtml="A new page content";

Or if I had only one h1 tag (probably asking too much)

    $xhtmlBlock->xhtml->h1="A new heading";
  1. 1 Posted by Ryan Griffith on 26 Sep, 2012 02:34 PM

    Ryan Griffith's Avatar

    Hi Michael,

    Correct, if you are updating an XHTML Block that does not have a Data Definition applied with HTML content, you would use something like:

    $xhtmlBlock->xhtml="<h1>A new page content</h1>";

    Note that $xhtmlBlock->xhtml returns a string, so you would place the HTML content within the string itself and not use the XML object notation.

    If there is a Data Definition, you would use the structuredData element, which would at that point be very similar to updating a Page asset (ie structuredData->structuredDataNodes->structuredDataNode->...)

    Please let me know if you have any questions.


  2. 2 Posted by Michael McGinni... on 28 Sep, 2012 03:29 AM

    Michael McGinnis's Avatar

    Great, it's working!

    You had suggested using id instead of path, and this is the syntax that worked:

    $identifier = array (
        'id' => 'fe95804fd81c2904175ee05629e561658',
        'type' => 'block'
  3. 3 Posted by Ryan Griffith on 28 Sep, 2012 12:09 PM

    Ryan Griffith's Avatar

    Glad to hear you got things working, Michael!

    I'm going to go ahead and close this discussion, feel free to reply or comment to re-open this discussion if you have any additional questions.


  4. Ryan Griffith closed this discussion on 28 Sep, 2012 12:09 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac