Home Backend Development PHP Tutorial A typical example of .NET calling PHP Web Service_PHP Tutorial

A typical example of .NET calling PHP Web Service_PHP Tutorial

Jul 15, 2016 pm 01:26 PM
.net php service web example of access transfer project

最近一个项目由"WinForm直接访问DB2"移植到"WinForm通过PHP Web Service来访问DB2”。

这个命题的难点不是访问DB2,而是.NET调用PHP Web Service。对于我这个长期作.NET,之前一直以为只有通过.NET调用PHP Web Service……的人来说,真是有点强“聪”所难了。

但是问题还是要解决的,期限就摆在眼前呢。经过一番调查,终于有了眉目,现在分享给大家。

首先要说明的,PHP服务器需要至少需要两个文件——一个WSDL文件和一个PHP文件。WSDL文件是一种机读的XML文件,用于描述WebService提供的服务和调用方法(对于.NET则可以自动生成调用代码,十分好用),php文件就是真正实现的WEB服务了。

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>
Copy after login

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>
Copy after login

WSDL的代码比较长,当方法很多时,手敲代码是不太可能的。有一个巧的办法,就是也用.NET实现一个不含真正方法体的Web Serivce,然后通过http://***/TestWebService.asmx?wsdl的方法生成wsdl代码文件。

关于WSDL文件,我要说明特别说明两点:

(1)soap:address结点是声明WebService的地址,在部署时要改成相应地址;

(2)一维数组的声明类型为ArrayOfType,字符串数组为ArrayOfString。如果Type不是简单类型,则Type需要另外声明。

2).NET客户端代码

先要添加Web引用,地址为WSDL文件的Http地址。

.NET调用PHP Web Service调用代码(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>
Copy after login

.NET调用PHP Web Service总结:

(一)PHP是一种弱类型语言,检查错误比较困难。array类型也与一般理解的数组不同,它也有类似Hashtable的用法。

(二)PHP Web Service方法的传入参数、返回值都至多有一个,因为真正调用时的参数和返回值,都是包装到一个对象中传送的。

(三)PHP Web Service也支持自定义类型和自定义类型数组等复杂类型,但不支持多组数组。

(四)若返回值需要是多张二维表时,我浅薄的以为,可以传化一组字符串数组传送,格式为

[表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中按行列存放的值]

按顺序将上面[]中的内容串成字符串数组,效率还不错,我测试10000行240列的数据,我有现成编解代码,有兴趣的可以向我索取.


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/446603.htmlTechArticle最近一个项目由"WinForm直接访问DB2"移植到"WinForm通过PHP Web Service来访问DB2”。 这个命题的难点不是访问DB2,而是.NET调用PHP Web Service。对于我...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles