AXIS2경로\bin\wsdl2java.bat -uri [WSDL의 경로] -o [Generating될 Java Source 경로]-u
이를 통하여 만들어진 경우 CXF와는 좀 다르게 Stub 까지만 떨어짐.
그래서 실제 통신할 수 있는 class를 추가적으로 만들어야함. 아래 소스를 참고...
예)
public static DT_SR getResult(DT_S s)
{
DT_SR sr = null;
try
{
OutServiceStub stub = new OutServiceStub();
// HTTP Basic Auth가 존재하는 경우
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setUsername(username);
auth.setPassword(password);
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE , auth);
MSG_S p = new MSG_S();
p.setMSG_S(s);
MSG_SR result = stub.sRC_Out(p);
sr = result.getMSG_SR();
}
catch(Exception e)
{
e.printStackTrace();
}
return sr;
}
'Snippets' 카테고리의 다른 글
Ubuntu에서 mosquitto 설치하기 (0) | 2016.02.17 |
---|---|
apt-add-repository 명령어를 찾지 못할 경우 (0) | 2016.02.17 |
Ubuntu 14.04 LTS 64bit + Oracle JDK 8 + Tomcat 8 (0) | 2014.05.15 |
Ubuntu 12.04 Kworker CPU가 peek 칠 때... (0) | 2013.02.14 |
Eclipse에서 PHP 개발하기. (Eclipse Indigo + PDT 3.0.x + Remote System Explorer) (0) | 2012.01.30 |