delphi调用C# Webservice返回数据集

yangchchMsn


procedure TForm1.Button1Click(Sender:TObject);
var
IService: DataSetWebServiceSoap;
begin
IService := HTTPRIO1 asDataSetWebServiceSoap;
IService.Customers;
//ShowMessage(IService.HelloWorld());
//}
end;

procedure TForm1.HTTPRIO1BeforeExecute(constMethodName: string;
var SOAPRequest: WideString);
var
ts: tStringStream;
buffer: string;
begin
{
buffer := SOAPrequest;
ts := tStringStream.Create(buffer);
Showxml(ts, Send);
}
end;

procedure TForm1.HTTPRIO1AfterExecute(constMethodName: string;
SOAPResponse: TStream);
var
XMLDoc: IXMLDocument;
begin
SOAPResponse.Position := 0;
Memo1.Lines.LoadFromStream(SOAPResponse);
ClientDataset1.Active := FALSE;
SOAPResponse.Position := 0;
XMLDoc := NewXMLDocument;//应该是'SUTF8'并需要引用XMLIntf,XMLDoc两个单元
// XMLDoc.Encoding := SUTF8;
SOAPResponse.Position := 0;
XMLDoc.LoadFromStream(SOAPResponse);
//XMLDoc.SaveToFile('c:\aa.xml');
//XMLTransformProvider1.TransformRead.SourceXmlFile:= 'c:\aa.xml';
XMLTransformProvider1.TransformRead.SourceXmlDocument:= XMLDoc.GetDOMDocument;
ClientDataset1.Active := TRUE;

http://www.cnblogs.com/fuyingke/archive/2006/07/31/438442.html
end;

你可能感兴趣的:(c,webservice,C#,buffer,Delphi)