기본 콘텐츠로 건너뛰기

라벨이 gSOAP인 게시물 표시

gSOAP으로 웹 서비스 이용하기

1. gsoap 라이브러리 다운받기 gsoap 홈페이지에가서 최신 버전을 다운받습니다. 2. WSDL에서 헤더 파일(*.h) 생성 3. wsdl2h -o MyFirstWebService.h http://www.solutionware.co.kr/MyFirstWebService/MyFirstWebService.asmx?wsdl -o : 헤더 파일 이름을 지정하는 옵션 -c : 순수 C을 사용하는 헤드 파일을 만들겠다는 옵션 4. 헤더 파일을 가지고 스텁코드 생성하기 soapcpp2 -i -C -I<gSOAP의 import 폴더 위치> MyFirstWebService.h -i : C++ 베이스의 스텁코드를 생성하겠다는 옵션 -C : only generate client code -X : does not generate the xml -T typemap.dat : convert the data type dat rule typemap -I(대문자 i) : directly use C++ wrapper class 5. VS2010에서 Win32 콘솔 프로젝트를 생성 6. "추가 포함 디렉터리"에 gsoap이 있는 위치를 추가합니다. 7. 위에서 생성한 파일들을 프로젝트 폴더에 복사 *.nsmap *.cpp , *.h 8. 프로젝트에 복사한 파일들을 추가 이때 gsoap 폴더에 있는 stdsoap2.cpp 파일도 프로젝트에 추가합니다. 9. 클라이언트 코드를 구현 #include "stdafx.h" #include "soapMyFirstWebServiceSoapProxy.h" #include "MyFirstWebServiceSoap.nsmap" int _tmain(int argc, _TCHAR* argv[]) { MyFirstWebServiceSoapProxy soapProxy; _ns1__HelloWo...