急Delphi调用C#编写的WebService,怎么解决中文编码有关问题

急!!Delphi调用C#编写的WebService,如何解决中文编码问题?
我用C#编写了一个简单的测试WebService,UTF-8编码
[WebMethod]
public   string   Echo(string   inStr)
{
return   "你传入的是: "   +   inStr;
}
当我用Delphi调用的时候,为何传入汉字,返回的是乱码?
即使我用   UTF8Encode( '传入的测试字符串 ')   来编码,
为何WebService端返回的是乱码呢?

那位大侠知道,请告诉我。

------解决方案--------------------
delphi用PCHAR
------解决方案--------------------
哈,這個分多.我來答.

web service
[WebService(Name= "SmartLinkTest ",Description= "xxxxxxTest ", Namespace = "xxxxxx ")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class TestService : System.Web.Services.WebService
{
public TestService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod(MessageName= "GetString ",Description = "Get String Hello World. ")]
public string GetString()
{
return "Hello World,世界,你好 ";
}
[WebMethod(MessageName= "GetInt ",Description = "Get Int 1001. ")]
public int GetInt()
{
return 1001;
}
[WebMethod(MessageName = "GetInput ", Description = "Get String that u Input in Box. ")]
public string GetInput(string strInput)
{
return strInput;
}

}


function GetxxxxxxTestSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): SmartLinkTestSoap;
const
defWSDL = 'http://localhost/xxxxxx/Service.asmx?WSDL ';
defURL = 'http://localhost/xxxxxx/Service.asmx ';
defSvc = 'xxxxxxTest ';
defPrt = 'xxxxxxTestSoap ';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = ' ') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as SmartLinkTestSoap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;


initialization
InvRegistry.RegisterInterface(TypeInfo(xxxxxxTestSoap), 'xxxxxx ', 'utf-8 ');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(xxxxxxTestSoap), 'xxxxxx/%operationName% ');

end.

procedure TFSmartLinkTestService.Button1Click(Sender: TObject);
var
sTmp1,sTmp2:Widestring;

begin
showmessage(httprio1.WSDLLocation );
edit1.text:=(httprio1 as xxxxxxTestSoap).GetString ;
sTmp1:=edit1.text;
//showmessage(inttostr((httprio1 as xxxxxxTestSoap).GetInt));
//sTmp2:=(httprio1 as xxxxxxTestSoap).GetInput(sTmp1);
//showmessage(sTmp2);
end;

在xp下調試通過.
InvRegistry.RegisterInterface(TypeInfo(xxxxxxTestSoap), 'xxxxxx ', 'utf-8 ');
這句別寫錯了.

------解决方案--------------------
暈寫得太多被人搶沙發了.
------解决方案--------------------
Dispatch: 派遣,分派 Invoke: 调用 Invokable: 可调用接口

TReomtable: WebService中自定义类都是继承自该类 TSOAPAttachment: Attachment:附件,一种流类型,可以返回流数据 CGI:(EXE)