IT한 것/webservice

Weblogic에서 Datahandler 첨부하는 방법

lovian 2007. 4. 20. 11:25
웹서비스 클라이언트는 보통 세가지 종류로 만들어진다.
사용 환경이나 목적에 따라서 Static Stub, Static Proxy, Dynamic Invocation Interface 를 사용한다.

어떤 것을 사용하던간에 jaxrpc의 Call, Service 인터페이스를 가져올 수 있는 것으로 보인다.

하여간 첨부를 하려면 해당 자료형을 변화하는 (De)Serializer가 필요하다,
DataHandler에 대한 시리얼라이저는 따로 제공되지 않기 때문에, WAS에 있는 것을 사용해야한다.

시리얼라이저를 등록하기 위해서는 TypeMapping 인터페이스를 사용하면 된다.
Service 인터페이스에서 TypeMappingRegistry 를 가져오고
TypeMappingRegistry에서 시리얼라이저를 QName과 함께 등록하여 사용하면 된다.



mapping.register( weblogic.webservice.encoding.DataHandlerArrayCodec.class, qnameAttachment, new weblogic.webservice.encoding.DataHandlerArrayCodec(), new weblogic.webservice.encoding.DataHandlerArrayCodec() );




위에 보이다시피, 웹로직에서 제공하는 DataHandlerArrayCodec을 등록한다.

이것을 등록하고 나서는 서비스 invoke시에 (De)Serializer 관련 예외가 발생하지 않을 것이다.