diff options
author | emkael <emkael@tlen.pl> | 2016-02-24 23:18:07 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-02-24 23:18:07 +0100 |
commit | 6f7fdef0f500cd4bb540affd3bc1482243f337c1 (patch) | |
tree | 4853eecd0769a903e6130c1896e1d070848150dd /lib/prado/framework/3rdParty/WsdlGen/WsdlMessage.php | |
parent | 61f2ea48a4e11cb5fb941b3783e19c9e9ef38a45 (diff) |
* Prado 3.3.0
Diffstat (limited to 'lib/prado/framework/3rdParty/WsdlGen/WsdlMessage.php')
-rw-r--r-- | lib/prado/framework/3rdParty/WsdlGen/WsdlMessage.php | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/lib/prado/framework/3rdParty/WsdlGen/WsdlMessage.php b/lib/prado/framework/3rdParty/WsdlGen/WsdlMessage.php new file mode 100644 index 0000000..3597c97 --- /dev/null +++ b/lib/prado/framework/3rdParty/WsdlGen/WsdlMessage.php @@ -0,0 +1,80 @@ +<?php +/** + * WsdlMessage file. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the BSD License. + * + * Copyright(c) 2005 by Marcus Nyeholt. All rights reserved. + * + * To contact the author write to {@link mailto:tanus@users.sourceforge.net Marcus Nyeholt} + * This file is part of the PRADO framework from {@link http://www.xisc.com} + * + * @author Marcus Nyeholt <tanus@users.sourceforge.net> + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @package System.Web.Services.SOAP + */ + +/** + * Represents a WSDL message. This is bound to the portTypes + * for this service + * @author Marcus Nyeholt <tanus@users.sourceforge.net> + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @version $Revision$ + */ +class WsdlMessage +{ + /** + * The name of this message + * @var string + */ + private $name; + + /** + * Represents the parameters for this message + * @var array + */ + private $parts; + + /** + * Creates a new message + * @param string $messageName The name of the message + * @param string $parts The parts of this message + */ + public function __construct($messageName, $parts) + { + $this->name = $messageName; + $this->parts = $parts; + + } + + /** + * Gets the name of this message + * @return string The name + */ + public function getName() + { + return $this->name; + } + + /** + * Return the message as a DOM element + * @param DOMDocument $wsdl The wsdl document the messages will be children of + */ + public function getMessageElement(DOMDocument $dom) + { + $message = $dom->createElementNS('http://schemas.xmlsoap.org/wsdl/', 'wsdl:message'); + $message->setAttribute('name', $this->name); + + foreach ($this->parts as $part) { + if (isset($part['name'])) { + $partElement = $dom->createElementNS('http://schemas.xmlsoap.org/wsdl/', 'wsdl:part'); + $partElement->setAttribute('name', $part['name']); + $partElement->setAttribute('type', $part['type']); + $message->appendChild($partElement); + } + } + + return $message; + } +} |