XML问题(20分)

  • 主题发起人 主题发起人 Fucool
  • 开始时间 开始时间
F

Fucool

Unregistered / Unconfirmed
GUEST, unregistred user!
我从网上的WEB servers服务取得以下XML封装的信息,如何还原???
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<FindMP3Response>
<MP3Results>
<MP3>
<FileName>Cartoon Theme - Simpsons.mp3</FileName>
<URL>http://xmlrad.com/MP3/Cartoon Theme - Simpsons.mp3</URL>
<FileSize>721682</FileSize>
</MP3>
<MP3>
<FileName>Cartoon Theme - Super Chicken.mp3</FileName>
<URL>http://xmlrad.com/MP3/Cartoon Theme - Super Chicken.mp3</URL>
<FileSize>528759</FileSize>
</MP3>
<MP3>
<FileName>Cartoon Theme - X-Men.mp3</FileName>
<URL>http://xmlrad.com/MP3/Cartoon Theme - X-Men.mp3</URL>
<FileSize>943461</FileSize>
</MP3>
</MP3Results>
</FindMP3Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
附上引入的单元
unit WSDL;
interface
uses InvokeRegistry, Types, XSBuiltIns;
type
// ************************************************************************ //
// The following types, referred to in the WSDLdo
cument are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in thedo
cument. The types from the latter category
// typically map to predefined/known XML or Borland types;
however, they could also
// indicate incorrect WSDLdo
cuments that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2000/10/XMLSchema"

// ************************************************************************ //
// Namespace : http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll/wsdl
// soapAction: FindMP3
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// binding : WSFindMP3Binding
// service : WSFindMP3Service
// port : WSFindMP3Port
// URL : http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll
// ************************************************************************ //
WSFindMP3PortType = interface(IInvokable)
['{E457DCF3-304F-29EC-B38A-7A50C0B4EEBD}']
procedure FindMP3(const SearchString: String;
const MaxReturn: String);
stdcall;
end;

function GetWSFindMP3PortType(UseWSDL: Boolean=System.False;
Addr: string=''): WSFindMP3PortType;

implementation
uses SOAPHTTPClient;
function GetWSFindMP3PortType(UseWSDL: Boolean;
Addr: string): WSFindMP3PortType;
const
defWSDL = 'http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll/WSDL';
defURL = 'http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll';
defSvc = 'WSFindMP3Service';
defPrt = 'WSFindMP3Port';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
RIO := THTTPRIO.Create(nil);
try
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
Result := (RIO as WSFindMP3PortType);
finally
if Result = nil then
RIO.Free;
end;
end;

initialization
InvRegistry.RegisterInterface(TypeInfo(WSFindMP3PortType), 'http://xmlrad.com/WSFindMP3Bin/WSFindMP3.dll/wsdl', '');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(WSFindMP3PortType), 'FindMP3');
end.
 
你要还原成什么?
 
接受答案了.
 
后退
顶部