


SoapDiscovery.class.php source code is as follows:
========================================== =====================
<span> 1</span> <span>php </span><span> 2</span><span> 3</span><span>/*</span><span>* </span><span> 4</span><span> * Copyright (c) 2005, Braulio Jos?Solano Rojas </span><span> 5</span><span> * All rights reserved. </span><span> 6</span><span> * </span><span> 7</span><span> * Redistribution and use in source and binary forms, with or without modification, are </span><span> 8</span><span> * permitted provided that the following conditions are met: </span><span> 9</span><span> * </span><span> 10</span><span> * Redistributions of source code must retain the above copyright notice, this list of </span><span> 11</span><span> * conditions and the following disclaimer. </span><span> 12</span><span> * Redistributions in binary form must reproduce the above copyright notice, this list of </span><span> 13</span><span> * conditions and the following disclaimer in the documentation and/or other materials </span><span> 14</span><span> * provided with the distribution. </span><span> 15</span><span> * Neither the name of the Solsoft de Costa Rica S.A. nor the names of its contributors may </span><span> 16</span><span> * be used to endorse or promote products derived from this software without specific </span><span> 17</span><span> * prior written permission. </span><span> 18</span><span> * </span><span> 19</span><span> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND </span><span> 20</span><span> * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, </span><span> 21</span><span> * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF </span><span> 22</span><span> * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE </span><span> 23</span><span> * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR </span><span> 24</span><span> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, </span><span> 25</span><span> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT </span><span> 26</span><span> * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; </span><span> 27</span><span> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) </span><span> 28</span><span> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN </span><span> 29</span><span> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span> 30</span><span> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, </span><span> 31</span><span> * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </span><span> 32</span><span> * </span><span> 33</span><span> * </span><span> 34</span><span> * @version $Id$ </span><span> 35</span><span> * @copyright 2005 </span><span> 36</span><span>*/</span><span> 37</span><span> 38</span><span>/*</span><span>* </span><span> 39</span><span> * SoapDiscovery Class that provides Web Service Definition Language (WSDL). </span><span> 40</span><span> * </span><span> 41</span><span> * @package SoapDiscovery </span><span> 42</span><span> * @author Braulio Jos?Solano Rojas </span><span> 43</span><span> * @copyright Copyright (c) 2005 Braulio Jos?Solano Rojas </span><span> 44</span><span> * @version $Id$ </span><span> 45</span><span> * @access public </span><span> 46</span><span> *</span><span>*/</span><span> 47</span><span>class</span><span> SoapDiscovery { </span><span> 48</span><span>private</span><span>$class_name</span> = ''<span>; </span><span> 49</span><span>private</span><span>$service_name</span> = ''<span>; </span><span> 50</span><span> 51</span><span>/*</span><span>* </span><span> 52</span><span> * SoapDiscovery::__construct() SoapDiscovery class Constructor. </span><span> 53</span><span> * </span><span> 54</span><span> * @param string $class_name </span><span> 55</span><span> * @param string $service_name </span><span> 56</span><span> *</span><span>*/</span><span> 57</span><span>public</span><span>function</span> __construct(<span>$class_name</span> = '', <span>$service_name</span> = ''<span>) { </span><span> 58</span><span>$this</span>->class_name = <span>$class_name</span><span>; </span><span> 59</span><span>$this</span>->service_name = <span>$service_name</span><span>; </span><span> 60</span><span> } </span><span> 61</span><span> 62</span><span>/*</span><span>* </span><span> 63</span><span> * SoapDiscovery::getWSDL() Returns the WSDL of a class if the class is instantiable. </span><span> 64</span><span> * </span><span> 65</span><span> * @return string </span><span> 66</span><span> *</span><span>*/</span><span> 67</span><span>public</span><span>function</span><span> getWSDL() { </span><span> 68</span><span>if</span> (<span>empty</span>(<span>$this</span>-><span>service_name)) { </span><span> 69</span><span>throw</span><span>new</span><span>Exception</span>('No service name.'<span>); </span><span> 70</span><span> } </span><span> 71</span><span>$headerWSDL</span> = "<?xml version=\"1.0\" ?>\n"<span>; </span><span> 72</span><span>$headerWSDL</span>.= "<definitions name='\"<span'>$this->service_name\" targetNamespace=\"urn:<span>$this</span>->service_name\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:tns=\"urn:<span>$this</span>->service_name\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns=\"http://schemas.xmlsoap.org/wsdl/\">\n"<span>; </span><span> 73</span><span>$headerWSDL</span>.= "<types xmlns='\"http://schemas.xmlsoap.org/wsdl/\"'></types>\n"<span>; </span><span> 74</span><span> 75</span><span>if</span> (<span>empty</span>(<span>$this</span>-><span>class_name)) { </span><span> 76</span><span>throw</span><span>new</span><span>Exception</span>('No class name.'<span>); </span><span> 77</span><span> } </span><span> 78</span><span> 79</span><span>$class</span> = <span>new</span> ReflectionClass(<span>$this</span>-><span>class_name); </span><span> 80</span><span> 81</span><span>if</span> (!<span>$class</span>-><span>isInstantiable()) { </span><span> 82</span><span>throw</span><span>new</span><span>Exception</span>('Class is not instantiable.'<span>); </span><span> 83</span><span> } </span><span> 84</span><span> 85</span><span>$methods</span> = <span>$class</span>-><span>getMethods(); </span><span> 86</span><span> 87</span><span>$portTypeWSDL</span> = '<porttype name="'.<span>$this</span>->service_name.'Port">'<span>; </span><span> 88</span><span>$bindingWSDL</span> = '<binding name="'.<span>$this</span>->service_name.'Binding" type="tns:'.<span>$this</span>->service_name." port>\n<binding style='\"rpc\"' transport='\"http://schemas.xmlsoap.org/soap/http\"'></binding>\n"<span>; </span><span> 89</span><span>$serviceWSDL</span> = '<service name="'.<span>$this</span>->service_name.">\n<documentation></documentation>\n<port name='\"".<span'>$this->service_name.'Port" binding="tns:'.<span>$this</span>->service_name."Binding\"><address location='\"http://".<span'>$_SERVER['SERVER_NAME'].':'.<span>$_SERVER</span>['SERVER_PORT'].<span>$_SERVER</span>['PHP_SELF']."\" />\n</address></port>\n</service>\n"<span>; </span><span> 90</span><span>$messageWSDL</span> = ''<span>; </span><span> 91</span><span>foreach</span> (<span>$methods</span><span>as</span><span>$method</span><span>) { </span><span> 92</span><span>if</span> (<span>$method</span>->isPublic() && !<span>$method</span>-><span>isConstructor()) { </span><span> 93</span><span>$portTypeWSDL</span>.= '<operation name="'.<span>$method</span>->getName().">\n".'<input message="tns:'.<span>$method</span>->getName()." request>\n<output message='\"tns:".<span'>$method->getName()."Response\" />\n</output></operation>\n"<span>; </span><span> 94</span><span>$bindingWSDL</span>.= '<operation name="'.<span>$method</span>->getName().">\n".'<operation soapaction="urn:'.<span>$this</span>->service_name.'#'.<span>$this</span>->class_name.'#'.<span>$method</span>->getName()."></operation>\n<input><body use='\"encoded\"' namespace='\"urn:<span'>$this->service_name\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\n\n<output>\n<body use='\"encoded\"' namespace='\"urn:<span'>$this->service_name\" encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" />\n</body></output>\n</body></operation>\n"<span>; </span><span> 95</span><span>$messageWSDL</span>.= '<message name="'.<span>$method</span>->getName()." request>\n"<span>; </span><span> 96</span><span>$parameters</span> = <span>$method</span>-><span>getParameters(); </span><span> 97</span><span>foreach</span> (<span>$parameters</span><span>as</span><span>$parameter</span><span>) { </span><span> 98</span><span>$messageWSDL</span>.= '<part name="'.<span>$parameter</span>->getName()." type='\"xsd:string\"'></part>\n"<span>; </span><span> 99</span><span> } </span><span>100</span><span>$messageWSDL</span>.= "</message>\n"<span>; </span><span>101</span><span>$messageWSDL</span>.= '<message name="'.<span>$method</span>->getName()." response>\n"<span>; </span><span>102</span><span>$messageWSDL</span>.= '<part name="'.<span>$method</span>->getName()." type='\"xsd:string\"'></part>\n"<span>; </span><span>103</span><span>$messageWSDL</span>.= "</message>\n"<span>; </span><span>104</span><span> } </span><span>105</span><span> } </span><span>106</span><span>$portTypeWSDL</span>.= "</binding></porttype>\n"<span>; </span><span>107</span><span>$bindingWSDL</span>.= "\n"<span>; </span><span>108</span><span>//</span><span>return sprintf('%s%s%s%s%s%s', $headerWSDL, $portTypeWSDL, $bindingWSDL, $serviceWSDL, $messageWSDL, '</span></definitions>');<span>109</span><span>110</span><span>$fso</span> = <span>fopen</span>(<span>$this</span>->class_name . ".wsdl", "w"<span>); </span><span>111</span><span>fwrite</span>(<span>$fso</span>, <span>sprintf</span>('%s%s%s%s%s%s', <span>$headerWSDL</span>, <span>$portTypeWSDL</span>, <span>$bindingWSDL</span>, <span>$serviceWSDL</span>, <span>$messageWSDL</span>, ''<span>)); </span><span>112</span><span> } </span><span>113</span><span>114</span><span>/*</span><span>* </span><span>115</span><span> * SoapDiscovery::getDiscovery() Returns discovery of WSDL. </span><span>116</span><span> * </span><span>117</span><span> * @return string </span><span>118</span><span> *</span><span>*/</span><span>119</span><span>public</span><span>function</span><span> getDiscovery() { </span><span>120</span><span>return</span> "<?xml version=\"1.0\" ?>\n<discovery xmlns:disco='\"http://schemas.xmlsoap.org/disco/\"' xmlns:scl='\"http://schemas.xmlsoap.org/disco/scl/\"'>\n<contractref ref='\"http://".<span'>$_SERVER['SERVER_NAME'].':'.<span>$_SERVER</span>['SERVER_PORT'].<span>$_SERVER</span>['PHP_SELF']."?wsdl\" />\n</contractref></discovery>"<span>; </span><span>121</span><span> } </span><span>122</span><span>} </span><span>123</span><span>124</span> ?>
The above has introduced SoapDiscoveryclassphp, including discovery content. I hope it will be helpful to friends who are interested in PHP tutorials.

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!
