Delphi 6 Update 2의 의미

5980 단어 Delphi
DELPHI 6.02 사전 연구 – BizSnap/SOAP/WebService 4
-- 패치 2#의 의미
Borland는 C++ Builder 6과 Delphi 6의 두 번째 패치를 발표했다.이것은 Delphi6에 있어서 매우 중요한 패치이다. Delphi6의 일부 문제를 수정했을 뿐만 아니라 Delphi6의 기능도 어느 정도 강화했다. 특히 SOAP/웹 서비스 개발 분야에서.위의 그림은 새 웹 서비스 페이지로 패치를 하기 전보다(《DELPHI 6 선도적 연구--BizSnap/SOAP/Web 서비스 중 하나--Hello World!의 예》 등) 아이콘을 모두 바꾸는 것 외에도 SOAP Server Interface 마법사가 추가되었습니다. 이것은 새 SOAP 서버 인터페이스를 만드는 마법사입니다. 앞에서 설명한 바와 같이 새 SOAP 서버 인터페이스를 만드는 데 많은 코드를 써야 합니다. 이 마법사가 있으면 많은 것을 절약할 수 있습니다.SOAP Server Interface 마법사가 있기 때문에 웹 서비스 응용 프로그램을 새로 만들 때 서버 인터페이스가 생성되었는지 자동으로 묻습니다. 위 그림과 같습니다.SOAP로 다중 응용 개발을 진행하는 것을 제외하고는 모두 새 인터페이스를 만들어야 한다.새 서버 인터페이스의 마법사 대화상자는 다음과 같습니다.《DELPHI 6 선도적 연구--BizSnap/SOAP/Web 서비스 중 하나--Hello World!의 예》의 예를 본떠서 새 SoapHello 인터페이스를 만들고 서비스 Name에 SoapHello를 입력하면 두 개의 단원이 생깁니다: SoapHelloIntf.pas 및 SoapHelloImpl.pas, 각각 이 인터페이스의 인터페이스 정의와 인터페이스 실현 단원입니다.다음은 SoapHelloIntf.pas 단원의 내용:
{ Invokable interface ISoapHello }

unit SoapHelloIntf;

interface

uses InvokeRegistry, Types, XSBuiltIns;

type

{ Invokable interfaces must derive from IInvokable }
ISoapHello = interface(IInvokable)
['{3A9E6BD6-F128-40AD-B9F1-FB254C463CCC}']

{ Methods of Invokable interface must not use the default }
{ calling convention; stdcall is recommended }
end;

implementation

initialization
{ Invokable interfaces must be registered }
InvRegistry.RegisterInterface(TypeInfo(ISoapHello));

end.
이하는 SoapHelloImpl.pas 단원의 내용:
{ Invokable implementation File for TSoapHello which implements ISoapHello }

unit SoapHelloImpl;

interface

uses InvokeRegistry, Types, XSBuiltIns, SoapHelloIntf;

type

{ TSoapHello }
TSoapHello = class(TInvokableClass, ISoapHello)
public
end;

implementation

initialization
{ Invokable classes must be registered }
InvRegistry.RegisterInvokableClass(TSoapHello);

end.
그리고 이 두 단원에 필요한 인터페이스 방법의 정의와 실현만 추가하면 하나의 서버 인터페이스를 완성할 수 있어 원래보다 훨씬 편리하다.이것은 단지 표면적인 변화일 뿐이다. 본 장의 첫 번째 예에서 만약http://localhost/soap/soaptest.dll아무것도 보이지 않으니 입력해야 합니다http://localhost/soap/soaptest.dll/wsdl모든 인터페이스의 WSDL 목록을 볼 수 있습니다.그러나 Delphi 6 패치 2를 친 후에 이 예시 프로그램을 다시 컴파일하면http://localhost/soap/soaptest.dllVisual Studio를 사용한 멋진 페이지를 표시합니다.net에서 SOAP 개발을 진행하는 것과 유사합니다.그러나http://localhost/soap/soaptest.dll/wsdl페이지도 원래와 다르다.그러나 이것은 아직 가장 중요한 변화가 아니다. 봐봐.http://localhost/soap/soaptest.dll/wsdl/IsoapHello페이지는 앞의 WSDL에 비해 약간의 변화가 있었다. 이것이야말로 가장 중요한 것이다. 이 개선으로 Delphi 6로 개발된 웹 서비스 응용 프로그램이Visual Studio될 수 있게 되었다.net에서 개발한 클라이언트 프로그램이 호출되었습니다!다음은 새로운 WSDL 파일:
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IHelloservice"
targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<message name="GetHelloRequest">
<part name="aID" type="xs:int"/>
</message>
<message name="GetHelloResponse">
<part name="return" type="xs:string"/>
</message>
<portType name="ISoapHello">
<operation name="GetHello">
<input message="tns:GetHelloRequest"/>
<output message="tns:GetHelloResponse"/>
</operation>
</portType>
<binding name="IHellobinding" type="tns:IHello">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetHello">
<soap:operation soapAction="urn:HelloIntf-IHello#GetHello" style="rpc"/>
<input>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:HelloIntf-IHello"/>
</input>
<output>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:HelloIntf-IHello"/>
</output>
</operation>
</binding>
<service name="IHelloservice">
<port name="IHelloPort" binding="tns:IHellobinding">
<soap:address location="http://localhost:1024/WSDemo1.WSDemo1/soap/IHello"/>
</port>
</service>
</definitions>
새로운 WSDL Importer도 크게 달라졌습니다.위의 그림은 새로운 WSDL Importer 마법사를 보여줍니다. 원래(예를 들어 《DELPHI 6 선도적 연구--BizSnap/SOAP/Web 서비스 중 하나--Hello World!의 예》)보다 훨씬 예뻐요. 물론 이것도 표면일 뿐입니다.'다음'을 누르면 인터페이스를 가져오는 데 성공하면 생성된 인터페이스 파일의 내용을 바로 볼 수 있습니다.다음 그림에서 '완성' 을 누르면 인터페이스 파일을 생성할 수 있습니다. (주의: 생성된 인터페이스 파일 이름은 기본적으로 인터페이스 이름이지만 Delphi는 단원 이름이 대상과 다시 붙을 수 없기 때문에 이름을 바꾸어야 저장할 수 있습니다.)물론 WSDL Importer의 개선은 이런 표면적인 것들뿐만 아니라 가장 중요한 개선도 Visual Studio로 쉽게 가져올 수 있다는 것이다.net에서 작성한 웹 서비스 프로그램에서 생성된 WSDL은 인터페이스에 원활하게 접근할 수 있습니다.마지막으로 C++ Builder 6의 SOAP 부분은 Delphi 6의 패치 2#와 같고, 패치 2#를 하지 않은 Delphi 6의 같은 기계에 C++ Builder 6를 설치하면 Delphi 6의 SOAP 부분을 사용할 수 없게 된다. 해결 방법은 Delphi 6의 패치 2#를 치는 것이다.[Mental Studio] 맹금 Mar.20-02

좋은 웹페이지 즐겨찾기