웹 서비스 엔드포인트 사용자 정의
애플리케이션 내에서 서버 제공자와 클라이언트에 대한 웹 서비스 엔드포인트를 사용자 정의하기 위해 ibm-ws-bnd.xml 파일을 사용할 수 있습니다.
시작하기 전에
ibm-ws-bnd.xml 파일은 웹 기반 웹 서비스 애플리케이션(WAR 파일)의 /WEB-INF 디렉토리 또는 EJB 기반 웹 서비스 애플리케이션(JAR 파일)의 /META-INF 디렉토리에 있어야 합니다. 클라이언트가 clientContainer에서 실행 중인 경우, ibm-ws-bnd.xml 파일이 클라이언트 EAR에 있는 JAR 파일의 /META-INF 디렉토리에 있어야 합니다.
이 태스크 정보
ibm-ws-bnd.xml 파일을 구성함으로써, 서비스 제공자와 이용자 모두에서 웹 서비스 주소 구성을 대체하고 Liberty에 배치된 애플리케이션에서 특정 URL을 사용하여 웹 서비스를 내보내며 JAX-WS 클라이언트 애플리케이션에서 웹 서비스를 가져올 수 있습니다.
ibm-ws-bnd.xml 파일에서 구성할 수 있는 사용 가능한 모든 요소에 대해서는 Liberty: ibm-ws-bnd.xml 파일의 내용을 참조하십시오.
프로시저
- 서비스 제공자에 대한 웹 서비스 바인딩을 대체하십시오.
- 웹 서비스 엔드포인트 주소를 대체하십시오. webservice-endpoint 요소에서 port-component-name 속성에 의해 식별된
웹 서비스 엔드포인트의 엔드포인트 주소를 대체할 수 있습니다.
address 속성은 애플리케이션의 컨텍스트 루트에 대한 상대적
경로를 지정합니다.
<?xml version="1.0" encoding="UTF-8"?> <webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd" version="1.0"> <!-- 0 to many endpoint descriptions --> <webservice-endpoint port-component-name="Hello" address="/hiService" /> </webservices-bnd>
- EJB 기반 웹 서비스에 대한 컨텍스트 루트를 대체하십시오. 웹 서비스가 EJB 기반 웹 서비스이고 EJB 애플리케이션(JAR
아카이브)에서 정의되는 경우 기본 컨텍스트 루트는 EJB
jar 이름입니다. 그러나, http-publishing 요소의
context-root 속성을 사용하여 기본값을 대체할 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?> <webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd" version="1.0"> <!-- optional http publishing module overrides --> <http-publishing context-root="/HiServer" /> </webservices-bnd>
참고: context-root 속성은 웹 서비스가 EJB 기반 웹 서비스이고 EJB jar 아카이브에 정의된 경우에만 적용됩니다. 웹 서비스가 웹 애플리케이션(WAR 아카이브)에 정의된 경우, EJB 기반 웹 서비스인지 여부에 관계없이 http-publishing 요소의 context-root 속성이 무시되고 컨텍스트 루트는 항상 웹 애플리케이션의 컨텍스트 루트가 됩니다.
- 웹 서비스 엔드포인트 주소를 대체하십시오. webservice-endpoint 요소에서 port-component-name 속성에 의해 식별된
웹 서비스 엔드포인트의 엔드포인트 주소를 대체할 수 있습니다.
address 속성은 애플리케이션의 컨텍스트 루트에 대한 상대적
경로를 지정합니다.
- 클라이언트 애플리케이션에 대한 웹 서비스 바인딩을 대체하십시오.
- WSDL 문서의 위치를 대체하십시오. service-ref 요소에서 웹 서비스 클라이언트 애플리케이션 내에
웹 서비스 참조의 WSDL 위치를 대체할 수 있습니다.
wsdl-location 속성은 절대 URI(HTTP 또는 파일 프로토콜)를 지정하며, 클라이언트 애플리케이션의 루트에 대한 상대 URI일 수 있습니다. 예:<?xml version="1.0" encoding="UTF-8"?> <webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd" version="1.0"> <service-ref name="services/hello" wsdl-location="http://localhost:9080/HiServer/hiService?wsdl" /> </webservices-bnd>
<?xml version="1.0" encoding="UTF-8"?> <webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd" version="1.0"> <service-ref name="services/hello" wsdl-location="WEB-INF/wsdl/hiService.wsdl" /> </webservices-bnd>
- 포트 주소를 대체하십시오. port 요소에서 웹 서비스 클라이언트의
웹 서비스 참조 내에서 포트의 주소를 대체할 수 있습니다.
port 요소의 address 속성은 웹 서비스 포트의 절대 URI를 지정합니다. 참조된 웹 서비스에 하나의 포트만 있는 경우, service-ref 요소의 port-address 속성을 사용할 수 있습니다. 예:<?xml version="1.0" encoding="UTF-8"?> <webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd" version="1.0"> <service-ref name="services/hello" wsdl-location="WEB-INF/wsdl/hiService.wsdl"> <port name="HelloPort" namespace="http://server.ejb.hello.sample.jaxws.ws.ibm.com/" address="http://localhost:9080/HiServer/hiService" /> </service-ref> </webservices-bnd>
<webservices-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-ws-bnd_1_0.xsd" version="1.0"> <service-ref name="services/hello" port-address="http://localhost:9080/HiServer/hiService" /> </webservices-bnd>
참고: service-ref 요소의 port-address 속성과 port 요소의 address 속성 둘 다를 지정하는 경우 port 요소의 address 속성이 적용됩니다.
- WSDL 문서의 위치를 대체하십시오. service-ref 요소에서 웹 서비스 클라이언트 애플리케이션 내에
웹 서비스 참조의 WSDL 위치를 대체할 수 있습니다.

파일 이름: twlp_dep_jaxws_binding.html