IBM®
메인 컨텐츠로 가기
    Korea [국가변경]    이용약관
 
 
   
        제품    서비스 & 솔루션    고객지원 & 다운로드    회원 서비스    
메인 컨텐츠로 가기

한국 developerWorks  >  SOA와 웹서비스 | WebSphere  >

SOA 복합 비즈니스 서비스 구현하기, Part 11: 등록자 권한 부여 프로세스 구현하기 (한글)

WebSphere Service Registry and Repository를 커스터마이징 하고, 이것을 WebSphere Process Server에 통합하기

developerWorks
문서 옵션

JavaScript가 필요한 문서 옵션은 디스플레이되지 않습니다.

토론

샘플 코드

영어원문

영어원문


제안 및 의견
피드백

난이도 : 중급

Ying Chun Guo , Software Engineer, IBM 
Naveen Sachdeva, Consulting IT Specialist, IBM
Indrajit Poddar, Software Architect, IBM

2007 년 12 월 18 일

이전 기술자료에서는 IBM® WebSphere® Service Registry and Repository와 IBM WebSphere Process Server가 서비스 소비 거버넌스에 어떻게 사용될 수 있는지에 대한 다소 어려운 주제를 설명했습니다. 이 글에서는 구현 상세를 설명하고, WebSphere Service Registry and Repository를 커스터마이징 하여 서비스 소비를 지원하고, WebSphere Process Server를 사용하여 등록자 권한 부여 프로세스를 구현하고, 이것을 SOAP 인터페이스를 사용하여 WebSphere Service Registry and Repository와 통합하는 방법을 설명합니다.

개요

WebSphere Service Registry and Repository는 서비스 메타데이터용 레지스트리 및 저장소이다. 다른 소스에서 얻은 서비스 메타데이터를 찾고 관리하는 중앙 포인트를 구축한다. 서비스 메타데이터의 예는 서비스 공급자(SP)와 서비스 등록자(SS)간 합의된 비용과 응답 시간이 될 수 있다. WebSphere Service Registry and Repository는 SP에 맞게 커스터마이징 될 수 있는 많은 요소들을 갖고 있다. 예를 들어, XML 스키마를 사용하여 WebSphere Service Registry and Repository 템플릿을 정의하여 SP 중심의 계약 정보를 나타낼 수 있다. 또한, Web Ontology Language (OWL)을 사용하여 분류 클래스를 정의하여 다른 WebSphere Service Registry and Repository 엔터티들을 연관시킬 수 있다. WebSphere Service Registry and Repository는 또한 UI를 위해 확장성 있는 커스터마이징 기능을 제공한다. 사용자의 조직 역할에 상응하는 퍼스펙티브가 웹 UI에 정의되어 개인화 된 서비스 메타데이터의 뷰를 제공한다. WebSphere Service Registry and Repository는 밸리데이션과 공지 플러그인을 추가하는 기능을 제공하여 저장소에 있는 콘텐트 변화에 대응하는 개인화 된 작동을 구현한다.

관련 콘텐트

WebSphere Process Server는 Business Process Execution Language (BPEL) 워크플로우용 컨테이너이다. BPEL로 작성된 비즈니스 프로세스는 웹 서비스로서 반출될 수 있고, 다른 애플리케이션에 의해 액세스 될 수 있다. 한 가지 예가 SOAP 인터페이스를 사용하는 WebSphere Service Registry and Repository이다. WebSphere Process Server와 WebSphere Service Registry and Repository를 통합하여 WebSphere Service Registry and Repository에 저장된 메타데이터의 상태 변화에 대응하여 워크플로우를 실행할 수 있다. 그림 1에서 보듯, WebSphere Process Server의 BPEL 프로세스는 WebSphere Service Registry and Repository의 사용자 정의 공지 플러그인을 통해 WebSphere Service Registry and Repository에 의해서 호출될 수 있다. BPEL 프로세스는 WebSphere Service Registry and Repository SOAP API를 사용하여 WebSphere Service Registry and Repository에 있는 정보를 생성 또는 업데이트 할 수 있다.


그림 1. WebSphere Process Server와 WebSphere Service Registry and Repository 통합 포인트

이 글에서는 WebSphere Service Registry and Repository를 커스터마이징 하고, 이것을 WebSphere Process Server에 통합하여 이전 기술자료에서 설명한 등록자 권한 부여 프로세스를 구현하는 방법을 설명한다.




위로


WebSphere Service Registry and Repository 커스터마이징

템플릿, 분류, 역할 또는 퍼스펙티브를 WebSphere Service Registry and Repository에 추가함으로써 WebSphere Service Registry and Repository를 커스터마이징 한다. 커스터마이징 상세는 다음 섹션에서 설명한다.

템플릿 커스터마이징

먼저, 본 시리즈 이전 기술자료에서 설명했던 시나리오에 대해 세 개의 XML Schema Definition (XSD) 복합 유형(Listing 1)을 정의한다:

  • Service는 서비스를 나타낸다. (예를 들어, BatchACHService는 Batch Automatic check Clearing House이다.)
  • Batch ACH Service Subscribe Endpoint는 Batch ACH Service의 다른 엔드포인트들과 관련된 애트리뷰트들의 컬렉션을 나타낸다. (예, highVolumeBatchACHServiceEPlowVolumeBatchACHServiceEP).
  • Batch ACH Service Subscribe Contract는 SP와 서비스 등록자 간 계약을 나타낸다. (예, JamesHuBatchACHServiceContract).

Listing 1. 등록자 권한 부여 프로세스를 위한 XSD 복합 유형
                
 <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
	targetNamespace="http://f49.j2b.ibm.com/1/0/template"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo"
	xmlns:sdoxml="commonj.sdo/xml"
	xmlns:tns="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/governance/SampleTaxonomy"
	xmlns:srsdo="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/sdo">

	<xsd:complexType name="Service">
		<xsd:attribute name="businessOwner" type="xsd:string" />
		<xsd:attribute name="availableEndpoints" type="xsd:IDREFS" />
		<xsd:attribute name="providedInterface" type="xsd:IDREFS" />
		<xsd:attribute name="contractTemplate" type="xsd:IDREFS"/>
		<xsd:attribute name="serviceDependencies" type="xsd:IDREFS" />
	</xsd:complexType>

	<xsd:complexType name="Batch ACH Service Subscribe Endpoint">
		<xsd:attribute name="executionCost" type="xsd:string" />
		<xsd:attribute name="responseTime" type="xsd:string" />
		<xsd:attribute name="maxChecksPerBatch" type="xsd:string" />
		<xsd:attribute name="minChecksPerBatch" type="xsd:string" />
		<xsd:attribute name="definingWSDLPort" type="xsd:IDREFS" />
	</xsd:complexType>

	<xsd:complexType name="Batch ACH Service Subscribe Contract">
		<xsd:attribute name="responsetime" type="xsd:string" />
		<xsd:attribute name="cost" type="xsd:string" />
		<xsd:attribute name="email" type="xsd:string" />
		<xsd:attribute name="servicename" type="xsd:string" />
		<xsd:attribute name="maxChecksPerRequest" type="xsd:string" />
		<xsd:attribute name="maxRequestPerHour" type="xsd:string" />
		<xsd:attribute name="isTestNeeded" type="xsd:string" />
		<xsd:attribute name="service" type="xsd:IDREFS" />
	</xsd:complexType>

</xsd:schema>
        

Listing 1의 XSD 문서를 WebSphere Service Registry and Repository에 가져오고, 이러한 복합 유형들을 템플릿으로 분류하여 복합 유형들에 상응하는 WebSphere Service Registry and Repository 템플릿을 정의한다. WebSphere Service Registry and Repository 웹 UI에서 다음과 같은 템플릿을 볼 수 있다. (그림 2)


그림 2. Listing 1의 복합 유형에서 파생된 WebSphere Service Registry and Repository 템플릿
Listing 1의 복합 유형에서 파생된 WebSphere Service Registry and Repository 템플릿

이 서비스 템플릿은 다음과 같은 애트리뷰트를 갖고 있다:

  • 프로퍼티: businessOwner는 SP를 나타낸다. (예, Peter Partell).
  • 관계: availableEndpoints는 서비스가 액세스 될 수 있는 엔드포인트를 나타낸다.
  • 관계: providedInterface는 서비스용 Web Services Description Language (WSDL) 인터페이스를 나타낸다. (예, BatchACHServiceWSDL.xml).
  • 관계: contractTemplate은 SP와 SS 간 계약의 템플릿을 나타낸다. (예,WebSphere Service Registry and Repository 개념: 템플릿에서 인스턴스화 된 JamesHuBatchACHServiceContract: Batch ACH Service Subscribe Contract).
  • 관계: serviceDependencies는 서비스와 종속 서비스들 간 관계를 나타낸다. (예, JamesHuAccountsPayableProcess).

Batch ACH Service Subscribe Endpoint 템플릿은 다음과 같은 애트리뷰트를 갖고 있다:

  • 프로퍼티: executionCost는 서비스 호출 비용을 나타낸다. (예, 체크 당 5 센트)
  • 프로퍼티: responseTime은 서비스 실행에 대한 응답 시간이다. (예, 체크 당 2 밀리초)
  • 프로퍼티: maxChecksPerBatch는 서비스가 일괄로 핸들할 수 있는 최대 체크의 수이다. (예, highVolumeBatchACHServiceEP는 최대 배치(batch)당 10,000개 체크를 핸들할 수 있고, lowVolumeBatchACHServiceEP는 배치 당 1,000 체크를 핸들할 수 있다.)
  • 프로퍼티: minChecksPerBatch는 Batch ACH Service Subscribe Endpoint의 특정 프로퍼티이고, 서비스가 일괄로 핸들할 수 있는 최소 체크의 수를 나타낸다. (예, highVolumeBatchACHServiceEP는 배치 당 최소 1,000 체크를 핸들할 수 있고, lowVolumeBatchACHServiceEP는 최소 배치 당 1개의 체크를 핸들한다.)
  • 관계: definingWSDLPort는 엔드포인트와 이것의 WSDL 포트 정의 간 관계를 나타낸다. (예, BatchACHServiceSOAPPort).

Batch ACH Service Subscribe Contract 템플릿은 다음과 같은 애트리뷰트를 갖고 있다:

  • responsetime은 SP와 SS 사이에 상호 동의한 서비스 응답 시간을 나타낸다. (예, 체크 당 5 밀리초)
  • cost는 SP와 SS간 상호 동의한 서비스 호출 비용을 나타낸다.(예, 배치 당 체크의 수가 1,000보다 작으면 체크 당 3센트이고, 배치 당 체크의 수가 1,000보다 크면 체크 당 5 센트이다.)
  • email은 SS의 이메일을 나타낸다. (예, jameshu@servicesubscriber.com).
  • servicename은 등록된 서비스의 이름을 나타낸다. (예, BatchACHService).
  • maxChecksPerRequest는 상호 동의한 요청 당 최대 체크의 수를 나타낸다. 핸들링 용량을 검사할 용도이다. (예, 3,000).
  • maxRequestPerHour는 인프라스트럭처 용량 플래닝 용도의 시간 당 최대 요청 수를 나타낸다. (예, 4,000).
  • isTestNeeded는 테스트용 엔드포인트가 필요한지 여부를 나타낸다.
  • service는 계약서에 정의된 서비스 개념에 대한 관계이다.

분류 커스터마이징

WebSphere Service Registry and Repository에 여섯 개의 클래스(분류법)을 도입했다:

  • Test는 테스팅 목적으로 사용될 엔트포인트를 나타낸다. (예, TestEndpoint).
  • Production은 실행 환경에 사용될 엔드포인트를 나타낸다. (예, ProxyEndpoint).
  • Public은 서비스 등록자에게 노출되는 엔드포인트를 나타낸다. (예, TestEndpointProxyEndpoint).
  • Private은 서비스 등록자에게는 노출되지 않는 엔드포인트를 나타낸다. IBM WebSphere Enterprise Service Bus 중재 모듈은 퍼블릭 엔드포인트에서 온 호출을 maxChecksPerBatch (예를 들어, highVolumeBatchACHServiceEPlowVolumeBatchACHServiceEP) 같은 여러 기준들에 기반하여 적절한 개별 엔드포인트로 라우팅 한다. WebSphere Enterprise Service Bus 중재 모듈의 사용법을 보여주는 시나리오는 "복합 비즈니스 서비스를 다양하게 적용시키기, Part 4: WebSphere Enterprise Service Bus 중재 모듈 사용하기" (developerWorks, 2007년 7월).
  • Contract는 계약 템플릿의 인스턴스를 나타낸다. (예, Subscription for Batch ACH Service)
  • ContractTemplate은 WebSphere Service Registry and Repository의 계약 템플릿 엔터티를 나타낸다. (예, Batch ACH Service Subscribe Contract).

OWL 파일에 다음과 같은 분류를 정의할 수 있고(Listing 2), 이것을 WebSphere Service Registry and Repository에 가져와서, 새로운 분류법을 만들 수 있다. (그림 3).


Listing 2. OWL에 정의된 등록자 권한 부여 프로세스에 사용되는 WebSphere Service Registry and Repository 분류법
                
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
	<!ENTITY wsrrgst "http://f49.j2b.ibm.com/1/0/Taxonomy#">
]?>
<rdf:RDF xml:base="http://f49.j2b.ibm.com/1/0/Taxonomy#"
	xmlns:owl="http://www.w3.org/2002/07/owl#"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
	xmlns:wsrrgst="http://f49.j2b.ibm.com/1/0/Taxonomy#"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema#"?>
	
<owl:Ontology rdf:about="http://f49.j2b.ibm.com/1/0/Taxonomy"?>
	<rdfs:label>Jivaro2 Taxonomy</rdfs:label?>
</owl:Ontology?>

<owl:Class rdf:about="&wsrrgst;Production"?>
	<rdfs:label?>Product?</rdfs:label?>
	<rdfs:comment?>Services that are published as part of products?</rdfs:comment?>
</owl:Class?>
<owl:Class rdf:about="&wsrrgst;Test"?>
	<rdfs:label?>Test?</rdfs:label?>
	<rdfs:comment?>Services that are published for test?</rdfs:comment?>
</owl:Class?>
<owl:Class rdf:about="&wsrrgst;Public"?>
	<rdfs:label?>Public?</rdfs:label?>
	<rdfs:comment?>Services that are public?</rdfs:comment?>
</owl:Class?>
<owl:Class rdf:about="&wsrrgst;Private"?>
	<rdfs:label>Private</rdfs:label?>
	<rdfs:comment?>Services that are private?</rdfs:comment?>
</owl:Class?>
<owl:Class rdf:about="&wsrrgst;ContractTemplate"?>
	<rdfs:label?>ContractTemplate?</rdfs:label?>
	<rdfs:comment?>Contract Template?</rdfs:comment?>
</owl:Class?>
<owl:Class rdf:about="&wsrrgst;Contract"?>
	<rdfs:label?>Contract?</rdfs:label?>
	<rdfs:comment?>Contract?</rdfs:comment?>
</owl:Class?>


</rdf:RDF?>


그림 3. WebSphere Service Registry and Repository Listing 2에 있는 OWL 파일에 WebSphere Service Registry and Repository를 가져온 후에 만들어진 커스터마이징 된 분류법
WebSphere Service Registry and Repository Listing 2에 있는 OWL 파일에 WebSphere Service Registry and Repository를 가져온 후에 만들어진 커스터마이징 된 분류법

역할과 퍼스펙티브

소셜 북마크

mar.gar.in mar.gar.in
digg Digg
del.icio.us del.icio.us
Slashdot Slashdot

두 개의 역할인, Viewer와 Subscriber가 WebSphere Service Registry and Repository 웹 UI에 추가되었고, 두 개의 퍼스펙티브가 각 역할을 위해 생성되었다. 등록자는 퍼블릭 엔드포인트와 종속 서비스 같은 등록된 서비스 상세를 볼 수 있다. 또한, IBM Tivoli® Access Manager 기반 권한 정책 하에서 등록된 서비스를 호출할 수 있고, Viewer 역할에 있는 사용자들은 할 수 없다. 처음에, 모든 사용자들은 Viewer 역할에 있다. Subscriber 권한 부여 프로세스를 완료하면, 각 사용자는 Viewer 역할에서 Subscriber 역할로 이동한다. WebSphere Service Registry and Repository Java™ Command Language (Jacl) 스크립트는 역할과 사용자들을 설정하고, 퍼스펙티브용 정의와 설정 파일을 로딩하는데 사용되었다. 예를 들어, Viewer와 Subscriber 역할을 WebSphere Service Registry and Repository에 추가했고, 사용자 JamesHu는 Viewer 역할에 추가되었다.

또한, Viewer라는 이름의 새로운 퍼스펙티브는 Viewer 역할을 위해 생성되었다. 이 퍼스펙티브는 Viewer 역할에 있는 사용자들이 등록에 사용할 수 있는 모든 서비스들을 보고 여기에 등록할 수 있도록 한다. Perspective, Navigation Tree, Collection View, Detail View, View Query에 대한 정의 파일이 Viewer 퍼스펙티브를 위해 생성되었다. Viewer 퍼스펙티브 정의는 Listing 3에 나타나 있다:

  • Viewer 역할의 멤버들만 퍼스펙티브를 볼 수 있다.
  • ViewerNavigationTree는 Navigation 프레임에 디스플레이 될 것이다.
  • 객체들의 컬렉션에 대한 Collection View와 특정 객체에 대한 상세 뷰들이 작업 영역 프레임에 나타난다.

Listing 3. Viewer 역할을 위한 WebSphere Service Registry and Repository 퍼스펙티브 정의의 엘리먼트
                   
<perspective-definition xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
  PerspectiveDefinition"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
  PerspectiveDefinition
     ./../schemas/PerspectiveDefinition.xsd"
    perspective-definition-name="Viewer"
    weight="97">

 <title-message resource-bundle-name="SampleResources" message-key=
  "perspective.display.name.viewer"/>

 <roles>
  <role>Viewer</role>
 </roles>
	
 <navigation-tree-name>ViewerNavigationTree</navigation-tree-name>

 <detail-view-mappings>
  ......
  <view-mapping display-type="Service" view-definition-name="JivaroService" />
  <view-mapping display-type="Subscriber" view-definition-name="JivaroSubscriber" />
  <view-mapping display-type="contract" view-definition-name="JivaroContractDetail" />
  ......
 </detail-view-mappings>

 <collection-view-mappings>
  ......
  <view-mapping display-type="Service" view-definition-name="JivaroServices" />
  <view-mapping display-type="Subscriber" view-definition-name="JivaroSubscribers" />
  ......
 </collection-view-mappings>
</perspective-definition>

Viewer 퍼스펙티브용 Navigation Tree와 View Query 정의는 Listing 4와 5에 각각 나타나 있다. Navigation Tree는 하나의 노드인 Service를 정의하는데, 이것은 Navigation Tree에 디스플레이 된다. Services 노드를 클릭하면, 뷰 쿼리 showViewServices가 수행된다. View Query는 템플릿이 Service인 모든 Generic Objects를 리턴하는 것으로 showViewServices 뷰 쿼리를 정의한다.


Listing 4. Viewer 퍼스펙티브용 Navigation Tree 정의
                  
<NavigationTree xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
     NavigationTreeDefinition"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
        NavigationTreeDefinition ../../schemas/NavigationTree.xsd"
       name="ViewerNavigationTree">
				
 <node id="navtree_root" node-resource-key="navigationtree.service.registry">
  <node id="businessmetadata" node-resource-key="navigationtree.unified.service.metadata">
   <node id="bservice" node-resource-bundle="SampleResources"
    node-resource-key="navigationtree.service.business.service" view-query-id=
    "showViewServices"/>
		</node>
  </node>
</NavigationTree>


Listing 5. Viewer 퍼스펙티브용 View Query 정의
                    
<ViewQueryDefinitionSet xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
  ViewQueryDefinitionSet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
  ViewQueryDefinitionSet ../../schemas/ViewQueryDefinitionSet.xsd">
    <QueryDefinitions>
     ......
     <Query id="showViewServices">
      <ObjectType>GenericObject</ObjectType>
      <DisplayType>Service</DisplayType>
      <Relationship name="template">
        <Target>
          <Property name="name" value="Service" />
        </Target>
      </Relationship>
     </Query>
     ......
    </QueryDefinitions>
</ViewQueryDefinitionSet>

Navigation Tree에 있는 Services 노드가 클릭되면, Collection View가 디스플레이 된다. Collection View는 서비스 이름들의 컬렉션에 대한 정보를 보여준다. Collection View 정의 파일은 Listing 6에 나타나 있다.


Listing 6. Services 객체 컬렉션을 위한 Collection View 정의
                  
<collection-view-definition xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
      CollectionViewDefinition"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
      CollectionViewDefinition ../../../schemas/CollectionViewDefinition.xsd"
      view-definition-name="JivaroServices">
 <messages>
  <title-message resource-bundle-name="SampleResources"
      message-key="sample.collection.view.business.services.title"/>
  <description-message resource-bundle-name="SampleResources"
      message-key="sample.collection.view.business.services.description"/>
 </messages>
  <column-definitions>
   <column-definition filterable="true">
  <heading-message message-key="collection.view.column.name"/>
    <property-name>name</property-name>
    <action>ViewDetail</action>
   </column-definition>
   <column-definition filterable="true">
  <heading-message message-key="collection.view.column.description"/>
    <property-name>description</property-name>
   </column-definition>
   <column-definition filterable="true">
  <heading-message message-key="collection.view.column.version"/>
    <property-name>version</property-name>
   </column-definition>
  </column-definitions>
 
  <button-definitions>
  </button-definitions>
</collection-view-definition>

Collection View에 있는 서비스가 클릭되면, Detail View가 디스플레이 된다. Service 객체용 Detail View 정의 파일은 Listing 7에 나타나 있다. Detail View는 이름과 레퍼런스 프로퍼티 같은 일반 프로퍼티들을 나타낸다: contractTemplate. 레퍼런스 프로퍼티는 HTML 링크로서 디스플레이 된다. 링크를 클릭하면 사용자들은 contractTemplate 유형의 커스터마이징 된 Collection View를 검색할 수 있다.


Listing 7. Service 객체에 대한 Detail View
                     
detail-view-definition xmlns="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
  DetailViewDefinition" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.ibm.com/xmlns/prod/serviceregistry/6/0/
  DetailViewDefinition ../../../schemas/DetailViewDefinition.xsd" 
  view-definition-name="JivaroService">
 <messages>
  <callout-message resource-bundle-name="SampleResources"
   message-key="sample.detail.view.business.service.callout" />
  <title-message resource-bundle-name="SampleResources" message-key=
   "sample.detail.view.business.service.title" />
  <description-message resource-bundle-name="SampleResources"
   message-key="sample.detail.view.business.service.description" />
 </messages>
 <tab-definition tab-name="details" tab-content="/pages/detailContent.jsp">
  <tab-title-message message-key="detail.details" />
  <general-properties>
   <heading-message message-key="detail.view.general.properties" />
   <property>
    <property-name>name</property-name>
    <property-messages>
     <property-message message-key="detail.view.name" />
     <field-help-message message-key="detail.view.name.field.help" />
    </property-messages>
   </property>
   ......
  </general-properties>
  <additional-properties>
   <heading-message message-key="detail.view.relationships" />
   <property hide-on-new="true">
    <action>ViewRelationshipDetail</action>
    <property-name>contractTemplate</property-name>
    <property-messages>
     <property-message resource-bundle-name="SampleResources" message-key=
        "sample.detail.view.contract" />
     <field-help-message message-key="detail.view.version.field.help" />
    </property-messages>
   </property>
  </additional-properties>
 </tab-definition>
</detail-view-definition>




위로


WebSphere Service Registry and Repository와 WebSphere Process Server 통합하기

등록자 권한 부여를 위해 WebSphere Service Registry and Repository와 거버넌스 프로세스를 통합하려면, WebSphere Service Registry and Repository 공지 플러그인, WebSphere Process Server에서 실행되는 BPEL 워크플로우, WebSphere Service Registry and Repository 클라이언트를 만들어야 한다. 자세한 통합 과정은 다음 섹션에서 설명하겠다.

WebSphere Service Registry and Repository 공지 플러그인

공지 플러그인이 생성되어 Viewer가 Contract Template의 인스턴스를 만들 때, 등록자 권한 부여 프로세스가 자동으로 호출되도록 한다.

WebSphere Service Registry and Repository 공지 플러그인을 생성하는 첫 번째 단계는 com.ibm.serviceregistry.ServiceRegistryNotifier 인터페이스를 구현하는 자바 클래스를 개발하는 것이다. 이 인터페이스는 세 개의 메소드, create, update, delete를 갖고 있는데, 이것은 WebSphere Service Registry and Repository 객체가 생성, 업데이트, 삭제될 때 호출된다. 예를 들어, Listing 8은 create 메소드용 소스 코드이다. 이 메소드에서, 생성되는 객체가 Contract Template의 인스턴스라면, 이 인스턴스의 프로퍼티는 WebSphere Service Registry and Repository API를 사용하여 얻어지고, 등록자 권한 부여 프로세스는 웹 서비스 클라이언트를 사용하여 호출된다. 생성되는 객체 역시 분류 Contract를 추가하고 등록된 서비스에 대한 관계를 설정함으로써 업데이트 된다.


Listing 8. 등록자 권한 부여 프로세스를 호출하는 WebSphere Service Registry and Repository 공지 플러그인
                  
public void create(OriginalObject obj, boolean success.
     ServiceRegistryException arg2) {
   if (classificationURI==null)
        initProperties();
   if (!success)
        return;
   if ((obj==null) || (obj.getTemplate()==null) || 
   (obj.getTemplate().getClassificationURIs()==null))
   {
        return;
   }
   if (!obj.getTemplate().getClassificationURIs().contains(
             classificationURI)) {
        return;
   }

   if (wsrrClient == null) {
        init();
   }
	
   try {
        String servicename = BSRSDOHelper.INSTANCE.getPropertyValue(obj,"servicename");
        if ((servicename==null) || (servicename.trim().length()==0))
        {
             throw new RuntimeException("Servicename cannot be null");
        }
        GenericObject service = getServiceObjectFromServicename(servicename);
        if (service==null) {
             System.out.println("Cannot find subscribed service name");
             return;
        }
		
        BSRSDOHelper.INSTANCE.setTargetObject(obj,"service",service);
        ((WSRR)((GenericObjectImpl)obj).getRootObject()).
        getArtefacts().addAll(
        ((WSRR)((ComplexTypeDefinitionImpl)service.getTemplate()).getRootObject()).
        getArtefacts());
        obj.getClassificationURIs().add(contractClassification);
        wsrrClient.update(obj);

        String email="",responsetime="";

        StringBuffer buffer=new StringBuffer();
        List properties = obj.getUserDefinedProperties();
        for (int i = 0; i < properties.size(); i++) {
              UserDefinedProperty property = (UserDefinedProperty) properties.get(i);
              String propertyname = property.getName();
              if (propertyname.equals("email"))
              {
                   email=property.getValue();
              }
              else if (propertyname.equals("responsetime"))
              {
                   responsetime=property.getValue();
              }
              else if (!propertyname.equals("servicename")){
                   String propertyvalue = property.getValue();
                   if (propertyvalue!=null && propertyvalue.length()>0)
                   {
                      if (i==0)
                        buffer.append(property.getName()+"="+property.getValue());
                      else
                        buffer.append("&"+property.getName()+"="+property.getValue());
                   }
              }
        }

        invokeEntitlementProcess(service.getName(),obj.getOwner(),
             email,responsetime,buffer.toString(),obj.getBsrURI());
        }
        catch(Exception e)
        {
        System.out.println("Exception happened when add the relationship 
             service in contract:"+e.getMessage());
        e.printStackTrace();
        }
}

private String invokeEntitlementProcess(String serviceName,
        String contactorUserId,
        String contactorEmail,
        String contractResponsetime,
        String contractString,
        String contractBsrURI)
{
   try{
        EntitlementProcessInterfaceProxy proxy = new EntitlementProcessInterfaceProxy();
        proxy.setEndpoint(processendpoint);
        EntitlementProcessInterface service = proxy.getEntitlementProcessInterface();
        String result = service.process(serviceName,contactorUserId,contactorEmail,
             contractResponsetime,contractString,contractBsrURI);
        return result;
        }
   catch(Exception e)
        {
        e.printStackTrace();
	}
   return "";
}

공지 플러그인은 공유 라이브러리로서 WebSphere Service Registry and Repository에 전개된다. 전개하려면 WebSphere Service Registry and Repository를 재시작 해야 한다.

등록자 권한 부여 프로세스

등록자 권한 부여 프로세스는 이전 기술자료에서 설명한 대로, IBM WebSphere Integration Developer에 BPEL을 사용하여 생성되고 WebSphere Process Server에 전개된다.

등록자 권한 부여 프로세스의 인터페이스는 그림 4에 나타나 있다. 인풋에는 다음이 포함된다:

  • ServiceName, 등록된 서비스의 이름이다. 서비스 상세는 서비스 이름에 의해서 WebSphere Service Registry and Repository에서 쿼리된다.
  • 등록자의 UserId
  • 등록자의 Email
  • ResponseTime, 계약에 정의된 원하는 responseTime
  • contractProperties, 등록자 계약의 프로퍼티로서, 요청 당 최대 체크의 수시간 당 최대 요청 수를 포함하고 있다.
  • contractBsrURI, WebSphere Service Registry and Repository의 계약 인스턴스의 bsrURI 애트리뷰트. 계약 인스턴스는 이 애트리뷰트에 의해 배치되고 WebSphere Service Registry and Repository API를 사용하여 업데이트 된다.

그림 4. WebSphere Integration Developer에 나타난 등록자 권한 부여 프로세스의 인터페이스
WebSphere Integration Developer에 나타난 등록자 권한 부여 프로세스의 인터페이스

등록자 권한 부여 프로세스는 WebSphere Service Registry and Repository와 통신하여 등록된 서비스의 정보를 얻고, 계약 인스턴스의 상태를 업데이트 하고, WSRRServiceHelper를 통해 섭스크립션을 생성한다. 이 프로세스는 Tivoli Access Manager가 액세스 컨트롤 리스트를 업데이트 하여 서비스 등록자가 등록된 서비스를 호출할 수 있도록 설정한다. 이것은 휴먼 태스크(AdminConfigureTAM)를 통해 수행된다. 이 프로세스 역시 WebSphere Service Registry and Repository를 설정하여 또 다른 휴먼 태스크인 AdminAddSubscriberRole을 통해 등록자 역할을 추가한다. 휴먼 태스크와 웹 서비스는 WebSphere Integration Developer의 어셈블리 다이어그램에 있는 등록자 권한 부여 프로세스로 구성된다. (그림 5)


그림 5. 등록자 권한 부여 프로세스에 대한 어셈블리 다이어그램
등록자 권한 부여 프로세스에 대한 어셈블리 다이어그램

WebSphere Service Registry and Repository 클라이언트

WSRRServiceHelper는 WebSphere Service Registry and Repository API의 웹 서비스 클라이언트를 통해 WebSphere Service Registry and Repository와 통신하도록 생성되었다. (Listing 9)


Listing 9. WebSphere Service Registry and Repository API를 사용하여 WebSphere Service Registry and Repository 클라이언트 만들기
                  
   System.setProperty(SYSTEM_TRUST_STORE, "C:\\DummyClientTrustFile.jks");
   System.setProperty(SYSTEM_TRUST_STORE_PASSWORD, "WebAS");
   System.setProperty(SYSTEM_KEY_STORE, "C:\\DummyClientKeyFile.jks");
   System.setProperty(SYSTEM_KEY_STORE_PASSWORD, "WebAS");
WSRRCoreSDOClient wsrrClient = new WSRRCoreSDOClient("https://localhost:9443/
WSRRCoreSDO/services/WSRRCoreSDOPort","wpsbind","wpsbind");

웹 서비스의 인터페이스와 메소드는 그림 6과 Listing 10, Listing 11, Listing 12에 나타나 있다.


그림 6. WSRRServiceHelper 웹서비스의 인터페이스
WSRRServiceHelper 웹서비스의 인터페이스

Listing 10. WSRRServiceHelper 웹 서비스의 addSubscription 메소드
                  
 Subscription sub = (Subscription)DataFactory.INSTANCE.create(Subscription.class);
sub.setTargetBsrURI(serviceInstance.getBsrURI());
sub.setEmailAddress("mailto:"+email);
sub.setString("name","Subscription for service "+serviceName);
sub.setString("owner",userid);
String bsrURI = wsrrClient.create(sub);


Listing 11. WSRRHelper 웹 서비스에 있는 updateProperty 메소드
                  
 BaseObject obj = wsrrClient.retrieve(bsrURI);
BSRSDOHelper.INSTANCE.setPropertyValue(obj,property,value);
wsrrClient.update(obj);	


Listing 12. 이름에 따라 서비스를 쿼리하고 relationship: availableEndpoints에서 관련 엔드포인트를 얻는 방법을 나타내는 WSRRHelper 웹 서비스의 getAvailableEndpoint 메소드
                
 GraphQuery graphQuery = SdoFactory.INSTANCE.createGraphQuery();
String FIND_WSDL = "/WebSphere Service Registry and Repository/GenericObject[@name=\""
+serviceName+"\" and template(.)/@name=\"Service\"]";
graphQuery.setQueryExpression(FIND_WSDL);
List results = wsrrClient.executeQuery(graphQuery);
GenericObject serviceObj = (GenericObject)results.get(0);
List relations = serviceObj.getUserDefinedRelationships();
for(int i=0;i<relations.size();i++)
{
	UserDefinedRelationship relation = (UserDefinedRelationship)relations.get(i);
	if (relation.getName().equals("availableEndpoints"))
	{
		List targets = relation.getTargets();
		......
	}
}




위로


결론

관련 자료 다운로드
웹스피어 소프트웨어
자세히 보기

이 글에서는, 사용자 정의 템플릿, 역할과 권한, UI 퍼스펙티브, 분류 시스템을 통해 WebSphere Service Registry and Repository를 커스터마이징 하는 방법을 설명했다. WebSphere Service Registry and Repository와 WebSphere Process Server 서버에서 실행되는 등록자 권한 부여 프로세스를 통합하여 공지 플러그인과 WebSphere Service Registry and Repository API를 사용하는 방법을 배웠다. WebSphere Service Registry and Repository 커스터마이징 기술과 통합 기술이 WebSphere Process Server와 결합하여 공개된 서비스에 등록자 권한 부여에 대한 거버넌스 프로세스를 구현하는데 어떻게 사용되는지도 배웠다.

감사의 말

이 글을 검토해 주신 Ashleigh Brothers와 Patrick Flanders에게 감사의 말을 전하고 싶다.





위로


다운로드 하십시오

설명이름크기다운로드 방식
본 기술자료의 샘플 코드wsrrgov.zip7.3MBHTTP
다운로드 방식에 대한 정보


참고자료

교육

제품 및 기술 얻기
  • Innovate your next development project with IBM 시험판 소프트웨어를 이용하여 차기 개발 프로젝트를 혁신해보라(다운로드 및 DVD 제공)


토론


필자소개

author photo

Ying Chun Guo은 China Technology Institute, China Software Development Laboratory의 소프트웨어 엔지니어이다. 복합 비즈니스 서비스(CBS)와 서비스 지향 아키텍처(SOA) 분야에서 일하고 있다.


Photo of Naveen Sachdeva

Naveen Sachdeva 는 Worldwide Business Process Management Technical Sales 팀 멤버이며, WebSphere Service Registry and Repository 제품 리더이다. 중요한 기술 세일즈 계약에 참여하고 있으며, 필드 인에이블먼트와 브랜드 지원 책임을 맞고 있다. IBM 인증 IT 전문가이자, 14년 경력의 SOA Solution Designer이다. IBM Software Group에서 소프트웨어 개발 및 지원, 비즈니스 파트너 기술 인에이블먼트, 기술 세일즈 분야에서 9년 동안 경력을 쌓았다. developerWorks에 글을 기고하며, IBM Redbooks도 공동 집필했다.


Indrajit Poddar photo

Indrajit Poddar(IP)는 소프트웨어 엔지니어 고문이고, 현재는 IBM Software Group의 Strategy and Technology 팀의 일원이다. IBM Software Group 제품들(WebSphere Application Server, Process Server, Portal Server and Tivoli, Rational)을 사용하여 서비스 지향 아키텍처를 사용하는 복합 애플리케이션을 구현하는데 관심을 갖고 있다.




기사에 대한 평가


보다 나은 서비스를 제공하기 위함이오니 잠시 짬을 내어 이 양식을 제출하여 주십시오.



아니오잘 모르겠음
 


 


12345
 



위로


IBM, the IBM logo, Redbooks, Tivoli, and WebSphere are registered trademarks of IBM in the United States, other countries or both. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. 기타 회사, 제품, 및 서비스명은 다른 상표나 서비스 마크일 수 있습니다.

developerWorks 콘텐트를 다른 사이트에 전재하기:
developerWorks 콘텐트에 대한 저작권은 IBM에 있습니다. IBM의 서면 허가나 원본 저자의 허락이 없이는 전재를 금합니다. 저희 콘텐트를 전재하시려면 IBM developerWorks 담당자 에게 문의하십시오.
    IBM 소개 개인정보 보호정책 문의