gsoap, Pthreads-Win32, OpenSSL SOAP C/S Developer Tools Group 1973 TurboC++2nd JBuilder ML,C++Builder ML,Delphi ML,C# ML,CORBA ML http://mixi.jp/show_friend.pl?id=208738 Java http://www.javareading.com/bof/ 2
SOAP, WSDL, / IDL2WSDL IDL WSDL gsoap + Web CGI SOAP gsoap + Pthreads-Win32 CGI gsoap + Pthreads-Win32 + OpenSSL SOAP over SSL Delphi SSL 3 SOAP
C/S 1 BDE etc GUI TCP/IP RDBMS 2 - SOAP TCP/IP GUI SOAP over SOAP RDBMS HTTP TCP/IP 5 SOAP XML HTTP Y = obj.foo(x); X HTTP return Y; SOAP Y HTTP SOAP 6
WSDL Web Services Description Language Web WSDL / /.. WSDL Y = obj.foo(x); SOAP (A) SOAP (B) return Y; SOAP (A) SOAP (B) 7 SOAP Apache + CGI CGI Apache Tomcat + Apache Axis( ) + Tomcat xxx.class Axis IIS + ASP.NET + IIS ASP.NET.NET8
IDL2WSDL WSDL WSDL XML WSDL WSDL WSDL Demo.wsdl <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions targetnamespace="http://tempuri.org" xmlns:impl="http://tempuri.org" xmlns:intf="http://tempuri.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:tns1="http://corba.omg.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <schema xmlns="http://www.w3.org/2001/xmlschema" targetnamespace="http://tempuri.org"> <import namespace="http://corba.omg.org"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complextype name="employee"> <sequence> <element name="id" type="xsd:int"/> <element name="data" nillable="true" type="soapenc:string"/> </sequence> </complextype> <complextype name="nosuchemployee"> <complexcontent> <extension base="tns1:userexception"> <sequence> <element name="reason" nillable="true" type="soapenc:string"/> </sequence> </extension> </complexcontent> </complextype> </schema> <schema xmlns="http://www.w3.org/2001/xmlschema" targetnamespace="http://corba.omg.org"> <import namespace="http://tempuri.org"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complextype abstract="true" name="userexception"> <sequence/> </complextype> </schema> </wsdl:types> <wsdl:message name="findbyprimarykeyrequest"> <wsdl:part name="in0" type="xsd:int"/> </wsdl:message> <wsdl:message name="findbyprimarykeyresponse"> <wsdl:part name="findbyprimarykeyreturn" type="impl:employee"/> </wsdl:message> <wsdl:message name="nosuchemployee"> <wsdl:part name="fault" type="impl:nosuchemployee"/> </wsdl:message> <wsdl:porttype name="employeemanager"> <wsdl:operation name="findbyprimarykey" parameterorder="in0"> 10
IDL IDL Interface Definition Language ( ) IDL WSDL module Demo { struct Employee { Demo.idl long id; wstring data; }; exception NoSuchEmployee { wstring reason; }; interface EmployeeManager { : Employee findbyprimarykey(in long id) raises(nosuchemployee); }; }; : 11 IDL WSDL Borland VisiBroker 7.0 IDL WSDL JDK Java Development Kit Apache Axis Java2WSDL Web Services Description Language for Java Toolkit WSDL4J JavaMail API Apache Axis JavaBeans Activation Framework JAF Apache Axis 12
IDL WSDL IDL idlj.java javac.class Java2WSDL WSDL 13 IDL WSDL JDK http://java.sun.com/j2se/1.4.2/download.html idlj, javac, java Apache Axis 1.4 http://ftp.kddilabs.jp/infosystems/apache/ws/axis/1_4/axis-bin-1_4.zip lib.jar JavaMail API 1.4 http://java.sun.com/products/javamail/downloads/index.html mail.jar JavaBeans Activation Framework 1.0.2 http://java.sun.com/products/archive/javabeans/jaf102.html activation.jar 14
IDL WSDL JDKbin PATH IDL Demo.idl idlj Demo.idl Java c: >idlj Demo.idl findbyprimarykey(int id) Demo.EmployeeManagerOperations Demo EmployeeManagerOperations.java c: >javac Demo EmployeeManagerOperations.java Demo EmployeeManagerOperations.class 15 IDL WSDL Apache Axis Java2WSDL CLASSPATH + Axis lib jar + JavaMail API + JAF c: >set CLASSPATH=.;C: axis-1_4 lib axis.jar;c: axis-1_4 lib axis- ant.jar;c: axis-1_4 lib commons-discovery-0.2.jar;c: axis- 1_4 lib commons-logging-1.0.4.jar;c: axis-1_4 lib jaxrpc.jar;c: axis- 1_4 lib log4j-1.2.8.jar;c: axis-1_4 lib saaj.jar;c: axis-1_4 lib wsdl4j- 1.5.1.jar;C: axis-1_4 lib mail.jar;c: axis-1_4 lib activation.jar Java2WSDL Java WSDL c: >java org.apache.axis.wsdl.java2wsdl -o Demo.wsdl -n http://tempuri.org -l https://localhost:18081 -s EmployeeManager -b EmployeeManagerSoapBinding -P EmployeeManager Demo.EmployeeManagerOperations 16
IDL WSDL Java2WSDL -o WSDL : Demo.wsdl -n WSDL XMLnamespace : http://tempuri.org -l Web URL : https://localhost:18081 WSDL Java : Demo.EmployeeManagerOperations 17 gsoap CGI + Web
gsoap WSDL Web gsoap 5 C/C++ SOAP MPL1.1 Windows, UNIX,MacOSX stdsoap2.cpp,stdsoap2.h!! URL: http://www.cs.fsu.edu/~engelen/soap.html WSDL C/C++ / CGI SSL OpenSSL 19 gsoap C++ SourceForge gsoap 2.7.9 http://jaist.dl.sourceforge.net/sourceforge/gsoap2/gsoap_ win32_2.7.9.zip char* std::wstring <gsoap_dir> typemap.dat # xsd string = char* char* xsd string = std::wstring std::wstring SOAP_ENC string = std::wstring std::wstring Turbo C++ Explorer http://www.borland.com/downloads/download_turbo.html 20
CGI VCL gsoap wsdl2h WSDL Demo.wsdl C Demo.h c: >wsdl2h -t <gsoap_dir> typemap.dat -o Demo.h Demo.wsdl gsoap soapcpp2 Demo.h.cpp,.h c: >soapcpp2 -S -L -I <gsoap_dir> import Demo.h WSDL soapc.cpp wsdl2h ( ) soapserver.cpp soaph.h EmployeeManagerSoapBinding.nsmap soapcpp2 SOAP soapc.cpp soapserver.cpp stdsoap2.cpp gsoap SOAP CGI(.EXE) 21 CGI main Web CGI gsoap : : new delete 22
CGI Apache2.0.x CGI CGI CPPServer.exe <Apache_Dir> cgi-bin C cc3270mt.dll IE Web Web SOAP 23 SOAP gsoap
VCL gsoap wsdl2h WSDL Demo.wsdl C Demo.h c: >wsdl2h -t <gsoap_dir> typemap.dat -o Demo.h Demo.wsdl gsoap soapcpp2 Demo.h.cpp,.h c: >soapcpp2 -C -L -I <gsoap_dir> import Demo.h soapc.cpp WSDL soapclient.cpp soapemployeemanagersoapbindingproxy.h wsdl2h ( ) EmployeeManagerSoapBinding.nsmap soapcpp2 soapc.cpp soapclient.cpp SOAP stdsoap2.cpp gsoap SOAP 25 main Web Web : Web : (99) 26
Web WSDL soapemployeemanagersoapbindingproxy.h Web : service->endpoint = "http://localhost/cgi-bin/cppserver.exe"; (ns1 Employee) std::wstring (int) Delphi/BCBGUI WideString 27 POSIX Threads
gsoap SOAP gsoapcgi SOAP Apache Web gsoap.exe SOAP 1 Windows Win32 API CreateThread_beginthread UNIX POSIX Threads Pthreads pthread_create 29 WindowsPOSIX Threads Pthreads Win32 API gsoap C/C++ Win32 API POSIX Threads Win32 API Pthreads-Win32 http://sourceware.org/pthreads-win32/ LGPL 30
Pthreads-Win32 2.7.0 ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-2-7-0-release.exe c: pthreads2.7.0 TASM32 c: pthreads2.7.0 pthreads.2 config.h c: pthreads2.7.0 pthreads.2 c: >make -fbmakefile Bmakefile c: pthreads2.7.0 pthreads.2 DLL pthreadbc2.dll pthreadbc2.lib 31 CGI SOAP main localhost80 SOAP SOAP 32
CGI SOAP ns1 findbyprimarykey SOAP c: pthreads2.7.0 pthreads.2 pthreadbc2.lib 33 SOAP SOAP SOAP CPPServer.exe C cc3270mt.dll Pthreads-Win32DLL pthreadbc2.dll Web URL : service->endpoint = "http://localhost/"; gsoap SOAP soap_bind 34
SSL OpenSSL SOAP gsoap SSL OpenSSL gsoap stdsoap2.cpp, stdsoap2.h SSL OpenSSL SOAP #ifdef WITH_OPENSSL #endif WITH_OPENSSL define OpenSSL OpenSSL http://www.openssl.org/ Apache BSD 36
OpenSSL OpenSSL http://www.openssl.org/source/openssl-0.9.8d.tar.gz make Perl OpenSSL make c: >ms bcb4.bat c: >make fbcb.mak (.h) <OpenSSL_dir> inc32 (.exe) (.lib) <OpenSSL_dir> out32 37 SOAP main OpenSSL OpenSSL SSL SSL18081 38
SOAP main SSL OpenSSL 39 SOAP OpenSSL OpenSSL OpenSSL gsoap Windows Win32 API Win32 UNIX PThreads PThreads PThreads 40
SOAP OpenSSL 41 SOAP OpenSSL Win32PThreads pthead_self Win32 API 42
SSL server.pem openssl PEM 43 SSL dh512.pem gsoapsoap_ssl_server_context dh512.pem NULL DHE RSA 44
SOAP WITH_OPENSSL <OpenSSL> inc32 OpenSSL libeay32.lib ssleay32.lib SOAP.exe server.pem dh512.pem DHE 45 SOAP SSL SOAP CPPServer.exe C cc3270mt.dll Pthreads-Win32DLL pthreadbc2.dll OpenSSL.EXE IE Web Web URL https://localhost:18081/ SOAP SOAP 46
SSL OpenSSL SOAP SOAP main OpenSSL SSL OpenSSL 48
SOAP OpenSSL SOAP Web URL SSL : service->endpoint = "https://localhost:18081/"; WITH_OPENSSL <OpenSSL> inc32 OpenSSL libeay32.lib ssleay32.lib SOAP SOAP cacert.pem SOAP.exe 49 SOAP OpenSSL.EXE Ethereal SSL TLS_DHE_RSA_WITH_AES_256_CBC_SHA 50
gsoapopenssl gsoapsoapcpp2 / soapc.cpp Web C++ 1 2 51 gsoapopenssl gsoap stdsoap2.cpp OpenSSL OpenSSL 52
DelphiVCLSOAP gsoap SSL SOAP Delphi VCL SOAP QualityCentral#10823 http://qc.borland.com/wc/qcmain.aspx?d=10823 IE cacert.pem OK 54
Thank you