Java tutorial
/* * * ***************************************************************************** * * Copyright ( c ) 2016 Heren Tianjin Inc. All Rights Reserved. * * * * This software is the confidential and proprietary information of Heren Tianjin Inc * * ("Confidential Information"). You shall not disclose such Confidential Information * * and shall use it only in accordance with the terms of the license agreement * * you entered into with Heren Tianjin or a Heren Tianjin authorized * * reseller (the "License Agreement"). * **************************************************************************** * */ package com.heren.turtle.server.core; import org.apache.ws.security.WSPasswordCallback; import org.springframework.stereotype.Component; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.UnsupportedCallbackException; import java.io.IOException; /** * com.heren.turtle.entrance.ws * * @author zhiwei * @create 2017-03-13 13:14. */ public class ClientCallBackHandler implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; pc.setPassword("mnis1020"); } }