从wsdl文件中获取数据是不同的语言

时间:2015-12-01 02:36:07

标签: php web-services vb6 wsdl

我的项目是关于通过使用vb6中的差异从wsdl函数返回数据。 我可以从函数中获取数据,但它不能令人讨厌的是泰语。 数据不满是" ???"

我的代码

server.php

<?php
require_once("lib/nusoap.php");
$server = new soap_server();
//$server->configureWSDL("Testing WSDL ","urn:Testing WSDL ");
$server->configureWSDL("GetInformation","urn:GetInformation");
//Create a complex type

//----------------------------------
//Add ComplexType with Array
$server->wsdl->addComplexType("ArrayOfString", 
             "complexType", 
             "array", 
             "", 
             "SOAP-ENC:Array", 
             array(), 
             array(array("ref"=>"SOAP-  ENC:arrayType","wsdl:arrayType"=>"xsd:string[]")), 
             "xsd:string");  
//----------------------------------

$server->register('getInfo',array('CASE_ID' =>    'xsd:string'),array('return' => 'tns:ArrayOfString'),'urn:Info','urn:Info#getInfo');

function getInfo($case_id) {

include("ConnectSQL.php");

$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer"); 

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB"); 

$strCase_ID = $case_id;
// Query
$qry = "SELECT * ";
$qry .= "FROM tbCustomer WHERE CASE_ID = '$strCase_ID' ";
//$arr[0]= $qry;
//execute the SQL query and return records
$result = mssql_query($qry);
//$arr[0] = $strCase_ID;
$i = 0;
$recordcount = mssql_num_rows($result);
if ($recordcount != 0)
{

    //display the results 
    while($row = mssql_fetch_array($result))
    {

        $myname = $row["PREFIX"] ." ". $row["NAME"] ." ".  $row["MIDDLE"]." " ;

        $arr[$i] =  $myname;


        $i = $i+1;

    }
    //close the connection
    mssql_close($dbhandle);
    //return $myname; //iconv("ISO-8859-1", "UTF-8", $myname );
    return $arr;
}
else
{
    return $arr;
    //echo "<font color=red>**</font> Username & Password is wrong";
}


}

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA  : '';
$server->service($HTTP_RAW_POST_DATA);
exit(); 
?>

WSDL

<definitions xmlns:SOAP-   ENV="http://schemas.xmlsoap.org/soap/envelope/"   xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP- ENC="http://schemas.xmlsoap.org/soap/encoding/"  xmlns:tns="urn:GetInformation"  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"  xmlns="http://schemas.xmlsoap.org/wsdl/"  targetNamespace="urn:GetInformation">
<types>
<xsd:schema targetNamespace="urn:GetInformation">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
<xsd:complexType name="ArrayOfString">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</types>
<message name="getInfoRequest">
<part name="CASE_ID" type="xsd:string"/>
</message>
<message name="getInfoResponse">
<part name="return" type="tns:ArrayOfString"/>
</message>
<portType name="GetInformationPortType">
<operation name="getInfo">
<input message="tns:getInfoRequest"/>
<output message="tns:getInfoResponse"/>
</operation>
</portType>
<binding name="GetInformationBinding" type="tns:GetInformationPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getInfo">
<soap:operation soapAction="urn:Info#getInfo" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:Info" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:Info" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="GetInformation">
<port name="GetInformationPort" binding="tns:GetInformationBinding">
<soap:address location="http://localhost/MyProject4/server.php"/>
</port>
</service>
</definitions>

vb6代码

Dim clnt As New SoapClient30
Dim strText
Dim strID As String

clnt.MSSoapInit "http://localhost/MyProject4/server.php?wsdl"

strID = "001"
strText = clnt.getInfo(strID) 
MsgBox strText(0)
请帮助我。

0 个答案:

没有答案