http://www.ibm.com/developerworks/java/library/j-jws4/에서 유용한 예제를 발견했습니다. axis2.xml에서 OutflowSecurity 매개 변수를 제거했습니다. 패스워드 콜백 클래스도 없앴다. 나는 그것을로드하기 위해 policy.xml 파일과 코드를 추가했다. 이 코드를 사용하여 사용자 이름과 비밀번호를 제공합니다.
// Prepare the client
PartnerAPIStub stub = stubProvider.getStub();
ServiceClient client = stub._getServiceClient();
client.engageModule("rampart");
org.apache.axis2.client.Options options = client.getOptions();
options.setProperty(RampartMessageData.KEY_RAMPART_OUT_POLICY, policy);
options.setUserName(account.getApiUser());
options.setPassword(account.getApiPassword());
// Send the request
RetrieveResponseMsg response = stub.retrieve(requestDoc).getRetrieveResponseMsg();