레이블이 Web Service인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Web Service인 게시물을 표시합니다. 모든 게시물 표시

2007년 6월 14일 목요일

XML-RPC와 SOAP Web Service

XML-RPC is a protocol that allows programs of different languages on different machines to easily talk to each other. By sending a well-defined XML document over unadorned HTTP, a client program can make a remote procedure call to a server. The server processes the request and wraps its response in another well-defined XML document that is sent back to the client over that same HTTP connection.

XML-RPC는 이종 머신상의 이종 언어들이 각자 쉽게 데이터를 주고 받을 수 있게 도와주는 일종의 프로토콜이다. 잘 정의된 XML문서를 HTTP를 통해 보내고 클라이언트는 서버의 프로시져를 호출 할 수 있다. 서버는 클라이언트의 요청에 대해 마찬가지로 잘 정의된 XML문서로 답변한다.

 

Because procedure requests and responses are all in XML, each end of the RPC connection need not be written in the same language or even for the same platforms

프로시져의 호출과 답변이 XML 이루어 지기 때문에 같은 환경과 언어가 필요하지 않다.

 

Clients code to an agreed-upon API that a Web service listener implements. Either side of the API fence can change without affecting the other side. In this way, Web services in general, and XML-RPC in particular, can help break down the Berlin Wall of incompatible OS platforms and make language-agnostic software network components.

클라이언트의 서비스Api 지원한다. Xml-RPC Web Service 일반적인 방법은 Web Service이고 XML-RPC 특별한 방법이다.

 

Although less famous than its younger sibling SOAP, XML-RPC is a simple and easy tool that can help you integrate even the most uncommunicative of systems

서비스보다 유명하진 않지만 XML-RPC 통신할 없는 시스템조차도 관리할 있는 쉬운 방법이다.

 

Where SOAP is a generalized, object-oriented, messaging protocol that is designed to carry arbitrary XML payloads across any network protocol, XML-RPC is a simple procedural protocol designed only to make remote function calls

SOAP 서비스는 XML 전송하기 위한 객체 지향의 네트워크 프로토콜인데 반해 XML-RPC 단순 리모트 펑션을 부르기 위한 방법 하나이다.

 

CPAN의 RPC::XML 모듈을 사용한다.

 

결론: SOAP Web Service와 XML-RPC는 다름 ㅋㅋㅋㅋ

데이터를 전송하는 복잡한 행동 보다는 서버의 프로시져를 단순히 CALL해서 사용할 때 사용한다.

두 개의 프로토콜을 적절히 조합해서 사용하면 최상의 결과를 얻을 수 있음

2007년 5월 14일 월요일

Mashup ... 이제는 필수...

요즘 웹서비스에 대해 공부 중이다..Mashup 우리 프로그램도 결국 Mashup으로 가야 할 듯.
허덕이며 따라가는건지...앞서 가는건지.. 알수가 없구만..

웹 서비스나 공개 API를 제공하는 업체들에서 데이터를 받아 전혀 다른 새로운 서비스나 융합 애플리케이션을 만들어 내는 것. 구글이 공개한 검색 관련 응용 프로그램 인터페이스(API)와 지도 관련 API, 그리고 기타 여러 웹 서비스 정보들을 혼합하여 부동산 매매에 응용(예: HousingMaps.com)한 것처럼 다수의 정보원으로부터 제공되는 콘텐츠를 조합하여 하나의 서비스로 제공하는 웹 사이트 또는 애플리케이션을 가리킨다. 팝 뮤직에서 처음 사용되기 시작한 매시업아티스트디스크자키가 두 곡 또는 그 이상의 곡을 섞어 하나의 곡으로 연주하는 것을 의미한다.

2007년 5월 2일 수요일

[SOAP] 간단한 Server / Client 예제 작성 중

URL: http://guide.soaplite.com/#item_uri

Web Service에 대한 대략적 study와 병행해서 실제 perl의 SOAP::Lite를 사용하여  Web Service를 작성해 보고자 한다.

#============================
# business module
# date: 2007.5.2
#
package Demo;

  sub hi {
        my ($class, $a) = @_;

        return "HI $a \n";
  }

  sub bye {
    return "goodbye, cruel world";
  }

  #===============================
  # object Acess
  #
  sub new {
      my $self = shift;
      my $class = ref($self) || $self;
      bless {_temperature => shift} => $class;
  }
  sub as_fahrenheit {
      return shift->{_temperature};
  }
  sub as_celsius {
      return 5/9*(shift->{_temperature}-32);
  }
1;

#================================
# service.cgi
# date: 2007.5.2
#!/usr/bin/perl -w

  use SOAP::Transport::HTTP;
  use Demo;

  SOAP::Transport::HTTP::CGI
    -> dispatch_to('Demo')
    -> handle;


#================================
# client.pl
# date: 2007.5.2
#!perl -w
  use SOAP::Lite;
    # -> uri('http://www.ezadmin.co.kr')
  # uri는 class의 위치?
  print SOAP::Lite
    -> uri('http://[domain]/Demo')
    -> proxy('http://[domain]/service.cgi')
    -> hi( "123" )
    -> result;


결과
$ perl client.pl
HI 123

쩝 이 단순한 결과를 얻기 위해 하루종일 이렇게 저렇게 해보다니..ㅠ.ㅠ 내일은 autodispatch 에 대해서 작업할 예정