最近のプロジェクトは、「DB2 に直接アクセスする WinForm」から「PHP Web サービス経由で DB2 にアクセスする WinForm」に移植されました。
この提案の難しさは、DB2 にアクセスすることではなく、.NET から PHP Web サービスを呼び出すことです。長い間 .NET を使って作業してきた私にとって、PHP Web サービスは .NET 経由でのみ呼び出すことができると常々思っていましたが、これは本当に少し難しいことです。
しかし、問題はまだ解決する必要があり、期限は目の前にあります。いくつかの調査の結果、ついに手がかりが得られたので、今回はそれを共有します。
まず、PHP サーバーには少なくとも 2 つのファイル (WSDL ファイルと PHP ファイル) が必要です。 WSDL ファイルは、WebService によって提供されるサービスと呼び出しメソッドを記述するために使用される機械可読 XML ファイルです (.NET の場合、呼び出しコードは自動的に生成され、非常に使いやすいです)。ウェブサービス。
1) PHPサーバーサイドコード
1-1) TestWebService.phpコード
<ol class="dp-c"> <li class="alt"><span><span>TestWebService.php </span></span></li> <li> <span><?php </SPAN><LI class=alt><SPAN></SPAN><SPAN class=keyword><STRONG><FONT color=#006699>class</FONT></STRONG></SPAN><SPAN> TestWebService </SPAN></SPAN><LI><SPAN>{ </SPAN><LI class=alt><SPAN> </SPAN><SPAN class=keyword><STRONG><FONT color=#006699>public</FONT></STRONG></SPAN><SPAN> </SPAN><SPAN class=keyword><STRONG><FONT color=#006699>function</FONT></STRONG></SPAN><SPAN> HelloWorld() </SPAN></SPAN><LI><SPAN> { </SPAN><LI class=alt><SPAN> </SPAN><SPAN class=keyword><STRONG><FONT color=#006699>return</FONT></STRONG></SPAN><SPAN> </SPAN><SPAN class=keyword><STRONG><FONT color=#006699>array</FONT></STRONG></SPAN><SPAN>(</SPAN><SPAN class=string><FONT color=#0000ff>"HelloWorldResult"</FONT></SPAN><SPAN>=></span><span class="string"><font color="#0000ff">"Hello"</font></span><span>); </span> </li> <li><span> } </span></li> <li class="alt"><span> </span></li> <li> <span> </span><span class="keyword"><strong><font color="#006699">public</font></strong></span><span> </span><span class="keyword"><strong><font color="#006699">function</font></strong></span><span> GetArray(</span><span class="vars"><font color="#dd0000">$args</font></span><span>) </span> </li> <li class="alt"><span> { </span></li> <li> <span> </span><span class="comment"><font color="#008200">/* </font></span> </li> <li class="alt"><span><span class="comment"><font color="#008200"> 注意,Web Service的方法在声明时至多一个参数, </font></span> </span></li> <li><span><span class="comment"><font color="#008200"> 可是在调用该方法时就必须传value1,value2两个参数。 </font></span> </span></li> <li class="alt"><span><span class="comment"><font color="#008200"> (这一点十分令人费解,我的理解是,在调用该方法时,系统把所有参数都放到一个对象里传过来的) </font></span> </span></li> <li><span><span class="comment"><font color="#008200"> */</font></span><span> </span></span></li> <li class="alt"><span> </span></li> <li> <span> </span><span class="vars"><font color="#dd0000">$value1</font></span><span> = </span><span class="vars"><font color="#dd0000">$args</font></span><span>->value1; </span> </li> <li class="alt"> <span> </span><span class="vars"><font color="#dd0000">$value2</font></span><span> = </span><span class="vars"><font color="#dd0000">$args</font></span><span>->value2;</span><span class="comment"><font color="#008200">//这两句是获取真正的参数 </font></span><span> </span> </li> <li><span> </span></li> <li class="alt"> <span> </span><span class="vars"><font color="#dd0000">$arry</font></span><span> = </span><span class="keyword"><strong><font color="#006699">array</font></strong></span><span>(</span><span class="vars"><font color="#dd0000">$value1</font></span><span>,</span><span class="vars"><font color="#dd0000">$value2</font></span><span>); </span> </li> <li><span> </span></li> <li class="alt"> <span> </span><span class="comment"><font color="#008200">//返回值也很特别,不是直接返回$arry,而是把它放到一个对象里再返回。 </font></span><span> </span> </li> <li> <span> </span><span class="keyword"><strong><font color="#006699">return</font></strong></span><span> </span><span class="keyword"><strong><font color="#006699">array</font></strong></span><span>(</span><span class="string"><font color="#0000ff">"GetArrayResult"</font></span><span>=></span><span class="vars"><font color="#dd0000">$arry</font></span><span>); </span> </li> <li class="alt"><span> } </span></li> <li><span>} </span></li> <li class="alt"> <span></span><span class="comment"><font color="#008200">//创建WebSevice实例 </font></span><span> </span> </li> <li> <span></span><span class="vars"><font color="#dd0000">$server</font></span><span> = </span><span class="keyword"><strong><font color="#006699">new</font></strong></span><span> SoapServer(</span><span class="string"><font color="#0000ff">"TestWebService.wsdl"</font></span><span>); </span> </li> <li class="alt"> <span></span><span class="comment"><font color="#008200">//指定类名 </font></span><span> </span> </li> <li> <span></span><span class="vars"><font color="#dd0000">$server</font></span><span>->setClass(</span><span class="string"><font color="#0000ff">"TestWebService"</font></span><span>); </span> </li> <li class="alt"> <span></span><span class="vars"><font color="#dd0000">$server</font></span><span>->handle(); </span> </li> <li><span>?> </span></li> </ol>
1-2) TestWebService.wsdlコード
<ol class="dp-xml"> <li class="alt"><span><span>TestWebService.wsdl </span></span></li> <li> <span></span><strong><font color="#006699"><span class="tag"><?</SPAN><SPAN class=tag-name>xml</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>version</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"1.0"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>encoding</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"utf-8"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>?></span></font></strong><span> </span> </li> <li class="alt"> <span></span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:definitions</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:soap</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/wsdl/soap/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:tm</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://microsoft.com/wsdl/mime/textMatching/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:soapenc</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/soap/encoding/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:mime</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/wsdl/mime/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:tns</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:s</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://www.w3.org/2001/XMLSchema"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:soap12</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/wsdl/soap12/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:http</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/wsdl/http/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>targetNamespace</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>xmlns:wsdl</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/wsdl/"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:types</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:schema</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>elementFormDefault</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"qualified"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>targetNamespace</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorld"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:complexType</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:element</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorldResponse"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>minOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"0"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>maxOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"1"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorldResult"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"s:string"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:element</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArray"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>minOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"0"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>maxOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"1"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"value1"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"s:string"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>minOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"0"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>maxOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"1"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"value2"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"s:string"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:element</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArrayResponse"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>minOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"0"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>maxOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"1"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArrayResult"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:ArrayOfString"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:element</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:complexType</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"ArrayOfString"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>s:element</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>minOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"0"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>maxOccurs</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"unbounded"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"string"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>nillable</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"true"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"s:string"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:sequence</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:complexType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>s:schema</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:types</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:message</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorldSoapIn"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:part</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"parameters"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>element</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:HelloWorld"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:message</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:message</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorldSoapOut"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:part</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"parameters"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>element</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:HelloWorldResponse"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:message</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:message</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArraySoapIn"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:part</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"parameters"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>element</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:GetArray"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:message</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:message</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArraySoapOut"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:part</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"parameters"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>element</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:GetArrayResponse"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:message</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:portType</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"TestWebServiceSoap"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorld"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:input</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>message</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:HelloWorldSoapIn"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:output</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>message</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:HelloWorldSoapOut"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:operation</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArray"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:input</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>message</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:GetArraySoapIn"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:output</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>message</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:GetArraySoapOut"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:operation</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:portType</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:binding</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"TestWebServiceSoap"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:TestWebServiceSoap"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:binding</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>transport</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/soap/http"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorld"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>soapAction</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/HelloWorld"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>style</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"document"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:operation</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArray"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>soapAction</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/GetArray"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>style</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"document"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:operation</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:binding</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:binding</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"TestWebServiceSoap12"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>type</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:TestWebServiceSoap"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:binding</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>transport</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://schemas.xmlsoap.org/soap/http"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"HelloWorld"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>soapAction</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/HelloWorld"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>style</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"document"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:operation</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"GetArray"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:operation</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>soapAction</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://tempuri.org/GetArray"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>style</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"document"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:input</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:body</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>use</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"literal"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:output</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:operation</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:binding</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:service</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"TestWebService"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:port</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"TestWebServiceSoap"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>binding</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:TestWebServiceSoap"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap:address</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>location</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://localhost/phpmyadmin/ws/TestWebService.php"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:port</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>wsdl:port</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>name</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"TestWebServiceSoap12"</FONT></SPAN><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>binding</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"tns:TestWebServiceSoap12"</FONT></SPAN><SPAN class=tag><STRONG><FONT color=#006699>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"><</SPAN><SPAN class=tag-name>soap12:address</SPAN></FONT></STRONG><SPAN> </SPAN><SPAN class=attribute><FONT color=#ff0000>location</FONT></SPAN><SPAN>=</SPAN><SPAN class=attribute-value><FONT color=#0000ff>"http://localhost/phpmyadmin/ws/TestWebService.php"</FONT></SPAN><SPAN> </SPAN><SPAN class=tag><STRONG><FONT color=#006699>/></span></font></strong><span> </span> </li> <li> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:port</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li class="alt"> <span> </span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:service</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> <li> <span></span><strong><font color="#006699"><span class="tag"></</SPAN><SPAN class=tag-name>wsdl:definitions</SPAN><SPAN class=tag>></span></font></strong><span> </span> </li> </ol>
WSDLコードはメソッドが多いと無理です。コードを手動で入力します。賢い方法としては、.NET を使用して実際のメソッド本体を使用せずに Web サービスを実装し、http://***/TestWebService.asmx?wsdl のメソッドを通じて wsdl コード ファイルを生成するという方法があります。
WSDL ファイルに関して、2 つの特別な点を説明したいと思います。
(1) soap:address ノードは WebService が宣言されているアドレスであり、デプロイメント中に対応するアドレスに変更する必要があります
(2) 1 次元配列の宣言型は ArrayOfType で、文字列配列は ArrayOfString です。 Type が単純型ではない場合、Type を個別に宣言する必要があります。
2) .NET クライアント コード
まず、Web 参照を追加します。アドレスは WSDL ファイルの Http アドレスです。
.NET は PHP Web サービス呼び出しコード (C#) を呼び出します
<ol class="dp-xml"> <li class="alt"><span><span>//初始化WebService </span></span></li> <li> <span> localhost.TestWebService </span><span class="attribute"><font color="#ff0000">srv</font></span><span> = </span><span class="attribute-value"><font color="#0000ff">new</font></span><span> localhost.TestWebService(); </span> </li> <li class="alt"><span> //调第一个方法 </span></li> <li> <span> string </span><span class="attribute"><font color="#ff0000">str</font></span><span> = </span><span class="attribute-value"><font color="#0000ff">srv</font></span><span>.HelloWorld(); </span> </li> <li class="alt"><span> //调第二个方法 </span></li> <li> <span> string[] </span><span class="attribute"><font color="#ff0000">arry</font></span><span>= </span><span class="attribute-value"><font color="#0000ff">srv</font></span><span>.GetArray("string1","string2"); </span> </li> </ol>
.NET は PHP Web サービスを呼び出します 概要:
(1) PHP は型付けが弱い言語であり、エラーをチェックするのが困難です。配列型も一般的に理解されている配列とは異なります。また、使用法も Hashtable と似ています。
(2) 実際に呼び出されたときのパラメータと戻り値はすべてオブジェクトにパッケージ化されて送信されるため、PHP Web サービス メソッドは最大 1 つの受信パラメータと戻り値を持つことができます。
(3) PHP Web サービスは、カスタム型やカスタム型配列などの複合型もサポートしますが、複数の配列はサポートしません。
(4) 戻り値が複数の 2 次元テーブルである必要がある場合、形式は
[テーブル 1 の行数], [テーブル 1 の列数] で渡せると表面的に考えました。テーブル1]、[テーブル1の列数] 1列名1]、[テーブル1の列名2]、... [テーブル1の列名N]、[テーブル1の行と列に格納される値]
[テーブル2の行番号]、[テーブル2の列番号]、[テーブル2の列名1]、[テーブル2の列名2]、...[テーブル2の列名N]、[テーブル2に格納されている値]行と列]...
[テーブル M 行番号],[テーブル M 列数], [テーブル M 列名 1], [テーブル M 列名 2],...[テーブル M 列名 N ]、[表 2 の行と列に格納されている値]
上記の [] を順番に並べます。内容は文字列配列に結合されており、10,000 行 240 列のデータをテストしました。既製のエンコードとデコードのコードがありますので、ご興味がございましたら、お問い合わせください。
http://www.bkjia.com/PHPjc/446603.html
技術記事