BPEL 프로세스에 대한 헬퍼 클래스 작성(.NET)

특정 웹 서비스 API 조작은 클라이언트 응용프로그램에 "문서/리터럴" 스타일 랩핑 요소를 사용하도록 요구합니다. 클라이언트 응용프로그램은 헬퍼 클래스에 필요한 랩퍼 요소 생성을 돕도록 요구합니다.

시작하기 전에

헬퍼 클래스를 작성하려면 먼저 WebSphere® Process Server 환경에서 웹 서비스 API의 WSDL 파일을 내보내야 합니다.

이 타스크의 수행 목적 및 시기

웹 서비스 API의 call()sendMessage() 조작은 BPEL 프로세스를 WebSphere Process Server 내에서 시작하도록 합니다. call() 조작의 입력 메시지는 BPEL 프로세스 입력 메시지의 문서/리터럴 랩퍼가 제공될 것으로 예상합니다. BPEL 프로세스에 필요한 Bean 및 클래스를 생성하려면 <wsdl:types> 요소를 새 XSD 파일로 복사한 후 xsd.exe 도구를 사용하여 헬퍼 클래스를 생성하십시오.

이 타스크의 단계

  1. 아직 이를 수행하지 않은 경우, WebSphere Integration Developer에서 BPEL 프로세스 인터페이스의 WSDL 파일을 내보내십시오.
  2. 문서 편집기 또는 XML 편집기에서 WSDL 파일을 여십시오.
  3. <wsdl:types> 요소의 모든 하위 요소의 컨텐츠를 복사한 후 새 스켈레톤 XSD 파일에 붙여넣으십시오.
  4. XSD 파일에서 xsd.exe 도구를 실행하십시오.

    call xsd.exe file.xsd /classes /o

    여기서:

    file.xsd
    변환할 XSD(XML Schema Definition) 파일
    /classes (/c)
    지정된 XSD 파일의 컨텐츠에 해당하는 헬퍼 클래스를 생성합니다.
    /output (/o)
    생성된 파일의 출력 디렉토리를 지정합니다. 이 디렉토리를 생략하면 기본값은 현재 디렉토리입니다.

    예를 들어 다음과 같습니다.

    call xsd.exe ProcessCustomer.xsd /classes /output:c:\temp

  5. 생성된 클래스 파일을 클라이언트 응용프로그램에 추가하십시오. 예를 들어, Visual Studio를 사용 중인 경우, 프로젝트 > 기존 항목 추가 메뉴 옵션을 사용하여 이를 수행할 수 있습니다.

예제

ProcessCustomer.wsdl 파일이 다음과 같은 컨텐츠를 포함할 경우:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:bons1="http://com/ibm/bpe/unittest/sca" 
                  xmlns:tns="http://ProcessTypes/bpel/ProcessCustomer" 
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                  name="ProcessCustomer" 
                  targetNamespace="http://ProcessTypes/bpel/ProcessCustomer">
  <wsdl:types>
    <xsd:schema targetNamespace="http://ProcessTypes/bpel/ProcessCustomer" 
                xmlns:bons1="http://com/ibm/bpe/unittest/sca" 
                xmlns:tns="http://ProcessTypes/bpel/ProcessCustomer" 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:import namespace="http://com/ibm/bpe/unittest/sca" 
                schemaLocation="xsd-includes/http.com.ibm.bpe.unittest.sca.xsd"/>
      <xsd:element name="doit">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="input1" nillable="true" type="bons1:Customer"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="doitResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="output1" nillable="true" type="bons1:Customer"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
    <wsdl:message name="doitRequestMsg">
    <wsdl:part element="tns:doit" name="doitParameters"/>
  </wsdl:message>
    <wsdl:message name="doitResponseMsg">
    <wsdl:part element="tns:doitResponse" name="doitResult"/>
  </wsdl:message>
    <wsdl:portType name="ProcessCustomer">
    <wsdl:operation name="doit">
      <wsdl:input message="tns:doitRequestMsg" name="doitRequest"/>
      <wsdl:output message="tns:doitResponseMsg" name="doitResponse"/>
    </wsdl:operation>
  </wsdl:portType>
</wsdl:definitions>
결과 XSD 파일의 컨텐츠:
<xsd:schema xmlns:bons1="http://com/ibm/bpe/unittest/sca" 
                      xmlns:tns="http://ProcessTypes/bpel/ProcessCustomer" 
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                      targetNamespace="http://ProcessTypes/bpel/ProcessCustomer">
	<xsd:import namespace="http://com/ibm/bpe/unittest/sca"
              schemaLocation="Customer.xsd"/>
	<xsd:element name="doit">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="input1" type="bons1:Customer" nillable="true"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="doitResponse">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="output1" type="bons1:Customer" nillable="true"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
관련 태스크
비즈니스 오브젝트 내보내기
관련 정보
XML 스키마 정의 도구에 관한 Microsoft 문서(XSD.EXE)

ⓒ Copyright IBM Corporation 2005, 2006.
이 Information Center는 Eclipse 기술을 기반으로 합니다. (http://www.eclipse.org)