| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* WsdlMessage file.
|
|
|
4 |
*
|
|
|
5 |
* This program is free software; you can redistribute it and/or modify
|
|
|
6 |
* it under the terms of the BSD License.
|
|
|
7 |
*
|
|
|
8 |
* Copyright(c) 2005 by Marcus Nyeholt. All rights reserved.
|
|
|
9 |
*
|
|
|
10 |
* To contact the author write to {@link mailto:tanus@users.sourceforge.net Marcus Nyeholt}
|
|
|
11 |
* This file is part of the PRADO framework from {@link http://www.xisc.com}
|
|
|
12 |
*
|
|
|
13 |
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
|
|
|
14 |
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
|
|
|
15 |
* @version $Id: WsdlMessage.php 1689 2007-02-12 12:46:11Z wei $
|
|
|
16 |
* @package System.Web.Services.SOAP
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
/**
|
|
|
20 |
* Represents a WSDL message. This is bound to the portTypes
|
|
|
21 |
* for this service
|
|
|
22 |
* @author Marcus Nyeholt <tanus@users.sourceforge.net>
|
|
|
23 |
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
|
|
|
24 |
* @version $Revision$
|
|
|
25 |
*/
|
|
|
26 |
class WsdlMessage
|
|
|
27 |
{
|
|
|
28 |
/**
|
|
|
29 |
* The name of this message
|
|
|
30 |
* @var string
|
|
|
31 |
*/
|
|
|
32 |
private $name;
|
|
|
33 |
|
|
|
34 |
/**
|
|
|
35 |
* Represents the parameters for this message
|
|
|
36 |
* @var array
|
|
|
37 |
*/
|
|
|
38 |
private $parts;
|
|
|
39 |
|
|
|
40 |
/**
|
|
|
41 |
* Creates a new message
|
|
|
42 |
* @param string $messageName The name of the message
|
|
|
43 |
* @param string $parts The parts of this message
|
|
|
44 |
*/
|
|
|
45 |
public function __construct($messageName, $parts)
|
|
|
46 |
{
|
|
|
47 |
$this->name = $messageName;
|
|
|
48 |
$this->parts = $parts;
|
|
|
49 |
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
* Gets the name of this message
|
|
|
54 |
* @return string The name
|
|
|
55 |
*/
|
|
|
56 |
public function getName()
|
|
|
57 |
{
|
|
|
58 |
return $this->name;
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
/**
|
|
|
62 |
* Return the message as a DOM element
|
|
|
63 |
* @param DOMDocument $wsdl The wsdl document the messages will be children of
|
|
|
64 |
*/
|
|
|
65 |
public function getMessageElement(DOMDocument $dom)
|
|
|
66 |
{
|
|
|
67 |
$message = $dom->createElementNS('http://schemas.xmlsoap.org/wsdl/', 'wsdl:message');
|
|
|
68 |
$message->setAttribute('name', $this->name);
|
|
|
69 |
|
|
|
70 |
foreach ($this->parts as $part) {
|
|
|
71 |
if (isset($part['name'])) {
|
|
|
72 |
$partElement = $dom->createElementNS('http://schemas.xmlsoap.org/wsdl/', 'wsdl:part');
|
|
|
73 |
$partElement->setAttribute('name', $part['name']);
|
|
|
74 |
$partElement->setAttribute('type', $part['type']);
|
|
|
75 |
$message->appendChild($partElement);
|
|
|
76 |
}
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
return $message;
|
|
|
80 |
}
|
|
|
81 |
}
|
|
|
82 |
?>
|