JAX-WS 웹 서비스의 WSDL 바인딩 준수 강제 실행
WSDL 문서에서 바인딩 확장기능을 추가한 다음 Liberty에서 JAX-WS 지원을 사용하는 애플리케이션에 확장기능을 적용할 수 있습니다.
이 태스크 정보
Liberty는 JAX-WS 2.2 스펙에서 필요한 wsdl:binding 확장기능의 사용을 지원합니다. 이 주제는 WSDL 확장기능을 정의한 다음 Liberty에서 사용자 정의된 확장성 요소와 바인드하는 방법에 대해 설명합니다.
프로시저
- 확장성 요소를 정의하고 WSDL 확장에서 정의되는
사용자에게 맵핑하십시오. 다음 예제는 WSDL 확장
{http://server.respectbinding.jaxws22/}goodBinding에 바인드하는 방법을 보여줍니다.
@XmlRootElement(name = "goodBinding", namespace = "http://server.respectbinding.jaxws22/") public class GoodBindingElement implements ExtensibilityElement, Serializable { private String uri; private QName elementType = null; private Boolean required = null; @XmlAttribute(name = "uri") public String getUri() { return this.uri; } @Override public QName getElementType() { return this.elementType; } @XmlAttribute(name = "required", namespace="http://schemas.xmlsoap.org/wsdl/") public Boolean getRequired() { return this.required; } public void setUri(String uri){ this.uri = uri; } @Override public void setElementType(QName elementType) { this.elementType = elementType; } @Override public void setRequired(Boolean required) { this.required = required; } }
- 웹 또는 EJB 애플리케이션의 /META-INF 디렉토리에 extensions.xml 파일을
추가하십시오. 이 파일은 WSDL 문서에서 확장기능을 사용할 수 있는
위치를 정의합니다. 다음 예에서는,
javax.wsdl.Binding 특성을
goodBindingElement 클래스의 상위 유형으로 설정하는
항목이 extensions.xml 파일에 추가됩니다. 또한
이 항목은 WSDL 문서에서 binding 요소 아래에만
{http://server.respectbinding.jaxws22/}goodBinding
확장기능을 추가할 수 있음을 의미합니다.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <!-- XML Binding --> <entry key="org.apache.cxf.bindings.xml-1">javax.wsdl.Binding=jaxws22.respectbinding.server.common.GoodBindingElement</entry> </properties>
- 다음과 같이 {http://server.respectbinding.jaxws22/}goodBinding
확장기능을 binding 요소 아래에 추가하십시오.
... <binding name="EchoPortBinding" type="tns:Echo"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <tns:goodBinding wsdl:required="true" uri="http://good/good" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /> <operation name="echo"> <soap:operation soapAction=""/> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> <fault name="Exception"> <soap:fault name="Exception" use="literal"/> </fault> </operation> </binding> ...
상위 주제: Liberty에 JAX-WS 애플리케이션 배치


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twlp_dep_jaxws_extension
파일 이름: twlp_dep_jaxws_extension.html