티스토리 뷰
## 참고 사이트
http://egloos.zum.com/entireboy/v/4342149
[WebService] Apache Axis2 사용하기
http://blog.naver.com/ixoixo/120054662617
Eclipse에서 Apache Axis2를 사용하여 Web Service 구현하기 1 - server편 (bottom up)
## Guide
1. Axis2 다운로드
http://ws.apache.org/axis2/download.cgi
(Test : axis2-1.7.4)
2. Eclipse Axis2 설정
Window - preferences - web services - axis2 preferences
axis2 runtime location 폴더경로 설정
d:\dev\axis2-1.7.4
이상없다면, Axis2 runtime loaded successfully 메세지 확인
## Webservice 생성
1. Dynamic Web Project 생성
(Tomcat6.0, dynamic web version 2.5)
2. Project Facets : Axis2 Web Service 모두 체크 후 저장
3. 구현할 java source 코딩(src)
4. Web service 생성
생성한 javaFile우클릭 > Web Services > Create Web Services
- Bottom p(java to wsdl) type
- Server runtime : Tomcat v6.0
- Web service runtime : Apache Axis2
추가) 서버 기동시, 에러발생한다면.....
NoClassDefFoundError : URIResolver ?
: 해당 Service Webcontent/WEB-INF/lib 폴더에 axis2-1.7.4\lib\xmlschema-core-2.2.1.jar 추가
>> http://localhost:8082/CommonWs/services/PrintMap?wsdl
## WebService Client 생성
~2 까지 동일
3. Web Service Client 생성
- Service Definition : 위에서 생성한 웹서비스 url
(http://localhost:8082/CommonWs/services/PrintMap?wsdl)
- Server runtime : Tomcat6.0
- Web service runtime: Apache Axis2
- Generate all types for all elements referred to by schemas 체크
추가) 에러 발생시...
NoClassDefFoundError : NamespacePrefixList ?
: 해당 Service Webcontent/WEB-INF/lib 폴더에 axis2-1.7.4\lib\xmlschema-core-2.2.1.jar 추가
4. 생성된 Stub 확인
5. 비즈니스 로직 처리를 위한 메소드 추가
- TestService.java -
package org.apache.ws.axis2;
import java.rmi.RemoteException;
public class TestService{
public static void main(String[] args) throws RemoteException{
PrintMapStub stb = new PrintMapStub();
PrintMapStub.PrintAll request new PrintMapStub.PrintAll();
String ss = "Test String";
request.setHm(ss);
PrintMapStub.PrintAllResponse resonse = stub.printAll(request);
System.out.println(response.get_return());
}
}
추가) 에러 발생시...
Axis2Fault: <faultstring> OMElement printAll(OMEElement e)
/CommonWs/WebContent/WEB-INF/services/PrintMap/META-INF/services.xml
messageReceivers 수정
- messageReceivers -
<messageReceivers>
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
'Programming > Etc..' 카테고리의 다른 글
[GIT] ignore설정법 (588) | 2017.03.04 |
---|---|
[생활코딩] 정규표현식 (1311) | 2017.02.22 |
[apache,mysql,php] 웹 애플리케이션 만들기 (생활코딩) (583) | 2017.01.23 |
[SublimeText] C++ build 설정 (568) | 2017.01.02 |
[ANT] 파일리스트로 파일 복사 (java > class) (981) | 2016.12.30 |
- Total
- Today
- Yesterday
- 서머너즈워
- Git
- 생활코딩
- 프리티어
- 존맛탱
- 자금조달계획서
- 노브랜드
- 수미네 반찬
- ES6
- 웰빙헬스
- 혁오
- GraphQL
- Axis2
- 10cm
- 로꼬
- s9+
- Bitnami
- AWS npm
- 뒤꿈치 건조함
- 중국어정리
- 부동산거래계약신고필증
- AWS nodejs
- 고운발크림
- 알고리즘
- 부동신 계약시 주의사항
- 프렌즈
- 중국어강의
- 중국어공부
- 크러쉬
- 마시내 탕수육
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |