You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2004/10/19 03:47:03 UTC
cvs commit: ws-axis/c/src/server/simple_axis_server SimpleAxisTransport.cpp SimpleAxisTransport.h Makefile.am Makefile.in SimpleAxisServer.cpp HTTP_KeyWords.h ServerHelper.cpp ServerHelper.h
samisa 2004/10/18 18:47:03
Modified: c/src/server/simple_axis_server Makefile.am Makefile.in
SimpleAxisServer.cpp
Added: c/src/server/simple_axis_server SimpleAxisTransport.cpp
SimpleAxisTransport.h
Removed: c/src/server/simple_axis_server HTTP_KeyWords.h
ServerHelper.cpp ServerHelper.h
Log:
Updated to get the SimpleAxisServer working with transport abstraction layer.
Revision Changes Path
1.4 +1 -1 ws-axis/c/src/server/simple_axis_server/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/simple_axis_server/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile.am 27 Jul 2004 03:31:17 -0000 1.3
+++ Makefile.am 19 Oct 2004 01:47:03 -0000 1.4
@@ -1,7 +1,7 @@
bin_PROGRAMS = simple_axis_server
SUBDIRS =
AM_CPPFLAGS = $(CPPFLAGS)
-simple_axis_server_SOURCES = ServerHelper.cpp SimpleAxisServer.cpp
+simple_axis_server_SOURCES = SimpleAxisTransport.cpp SimpleAxisServer.cpp
simple_axis_server_LDADD = $(LDFLAGS) -L$(AXISCPP_HOME)/src/engine/server -lserver_engine -ldl
INCLUDES = -I../../../include
1.8 +254 -149 ws-axis/c/src/server/simple_axis_server/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/simple_axis_server/Makefile.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.in 16 Aug 2004 04:48:45 -0000 1.7
+++ Makefile.in 19 Oct 2004 01:47:03 -0000 1.8
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.6.3 from Makefile.am.
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -13,160 +13,230 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
-SHELL = @SHELL@
+
+SOURCES = $(simple_axis_server_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
-transform = @program_transform_name@
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
host_triplet = @host@
-
-EXEEXT = @EXEEXT@
-OBJEXT = @OBJEXT@
-PATH_SEPARATOR = @PATH_SEPARATOR@
+bin_PROGRAMS = simple_axis_server$(EXEEXT)
+subdir = src/server/simple_axis_server
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_simple_axis_server_OBJECTS = SimpleAxisTransport.$(OBJEXT) \
+ SimpleAxisServer.$(OBJEXT)
+simple_axis_server_OBJECTS = $(am_simple_axis_server_OBJECTS)
+am__DEPENDENCIES_1 =
+simple_axis_server_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/SimpleAxisServer.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/SimpleAxisTransport.Po
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(simple_axis_server_SOURCES)
+DIST_SOURCES = $(simple_axis_server_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
APACHE2BUILD = @APACHE2BUILD@
APACHE2INC = @APACHE2INC@
APACHEBUILD = @APACHEBUILD@
APACHEINC = @APACHEINC@
-AS = @AS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
EXPATBUILD = @EXPATBUILD@
EXPATINC = @EXPATINC@
EXPATLIB = @EXPATLIB@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBWWWBUILD = @LIBWWWBUILD@
LINKCLIENTLIB = @LINKCLIENTLIB@
LN_S = @LN_S@
-OBJDUMP = @OBJDUMP@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SAMPLESBUILD = @SAMPLESBUILD@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
TESTCASESBUILD = @TESTCASESBUILD@
VERSION = @VERSION@
XERCESCBUILD = @XERCESCBUILD@
XERCESCINC = @XERCESCINC@
XERCESCLIB = @XERCESCLIB@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
+am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
install_sh = @install_sh@
-bin_PROGRAMS = simple_axis_server
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
SUBDIRS =
AM_CPPFLAGS = $(CPPFLAGS)
-simple_axis_server_SOURCES = ServerHelper.cpp SimpleAxisServer.cpp
-
+simple_axis_server_SOURCES = SimpleAxisTransport.cpp SimpleAxisServer.cpp
simple_axis_server_LDADD = $(LDFLAGS) -L$(AXISCPP_HOME)/src/engine/server -lserver_engine -ldl
INCLUDES = -I../../../include
-subdir = src/server/simple_axis_server
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-bin_PROGRAMS = simple_axis_server$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS)
-
-am_simple_axis_server_OBJECTS = ServerHelper.$(OBJEXT) \
- SimpleAxisServer.$(OBJEXT)
-simple_axis_server_OBJECTS = $(am_simple_axis_server_OBJECTS)
-simple_axis_server_DEPENDENCIES =
-simple_axis_server_LDFLAGS =
-
-DEFS = @DEFS@
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ServerHelper.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/SimpleAxisServer.Po
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CXXFLAGS = @CXXFLAGS@
-DIST_SOURCES = $(simple_axis_server_SOURCES)
-
-RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
- uninstall-info-recursive all-recursive install-data-recursive \
- install-exec-recursive installdirs-recursive install-recursive \
- uninstall-recursive check-recursive installcheck-recursive
-DIST_COMMON = Makefile.am Makefile.in
-DIST_SUBDIRS = $(SUBDIRS)
-SOURCES = $(simple_axis_server_SOURCES)
-
all: all-recursive
.SUFFIXES:
.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/server/simple_axis_server/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/server/simple_axis_server/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -174,8 +244,8 @@
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@@ -189,35 +259,37 @@
$(CXXLINK) $(simple_axis_server_LDFLAGS) $(simple_axis_server_OBJECTS) $(simple_axis_server_LDADD) $(LIBS)
mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
+ -rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ServerHelper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SimpleAxisServer.Po@am__quote@
-
-distclean-depend:
- -rm -rf ./$(DEPDIR)
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SimpleAxisTransport.Po@am__quote@
.cpp.o:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(CXXCOMPILE) -c -o $@ `cygpath -w $<`
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cpp.lo:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-CXXDEPMODE = @CXXDEPMODE@
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -283,11 +355,10 @@
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-tags: TAGS
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -297,14 +368,21 @@
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
+tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
+ if (etags --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ else \
+ include_option=--include; \
+ fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ test -f $$subdir/TAGS && \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -316,6 +394,20 @@
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
@@ -323,19 +415,21 @@
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ../../..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @list='$(DISTFILES)'; for file in $$list; do \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
@@ -352,13 +446,13 @@
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
+ test -d "$(distdir)/$$subdir" \
+ || mkdir "$(distdir)/$$subdir" \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" \
- distdir=../$(distdir)/$$subdir \
+ top_distdir="../$(top_distdir)" \
+ distdir="../$(distdir)/$$subdir" \
distdir) \
|| exit 1; \
fi; \
@@ -368,8 +462,9 @@
all-am: Makefile $(PROGRAMS)
installdirs: installdirs-recursive
installdirs-am:
- $(mkinstalldirs) $(DESTDIR)$(bindir)
-
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
@@ -381,7 +476,7 @@
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -389,7 +484,7 @@
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -399,14 +494,17 @@
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-
-distclean-am: clean-am distclean-compile distclean-depend \
- distclean-generic distclean-libtool distclean-tags
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
+html: html-recursive
+
info: info-recursive
info-am:
@@ -422,7 +520,8 @@
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
@@ -430,26 +529,32 @@
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
- clean-binPROGRAMS clean-generic clean-libtool clean-recursive \
- distclean distclean-compile distclean-depend distclean-generic \
- distclean-libtool distclean-recursive distclean-tags distdir \
- dvi dvi-am dvi-recursive info info-am info-recursive install \
- install-am install-binPROGRAMS install-data install-data-am \
- install-data-recursive install-exec install-exec-am \
- install-exec-recursive install-info install-info-am \
- install-info-recursive install-man install-recursive \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am installdirs-recursive maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- mostlyclean-recursive tags tags-recursive uninstall \
- uninstall-am uninstall-binPROGRAMS uninstall-info-am \
- uninstall-info-recursive uninstall-recursive
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-binPROGRAMS clean-generic clean-libtool \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
1.22 +93 -453 ws-axis/c/src/server/simple_axis_server/SimpleAxisServer.cpp
Index: SimpleAxisServer.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/simple_axis_server/SimpleAxisServer.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- SimpleAxisServer.cpp 4 Jul 2004 12:49:16 -0000 1.21
+++ SimpleAxisServer.cpp 19 Oct 2004 01:47:03 -0000 1.22
@@ -16,15 +16,13 @@
*
*
* @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
+ * @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*
*/
-/*
- * Currently supports Windows only.
- */
#ifdef WIN32
-#include <winsock.h> /* for socket(),... */
+#include <winsock.h> // for socket(),...
#else //Linux
#include <sys/socket.h>
#include <arpa/inet.h>
@@ -32,32 +30,23 @@
#include <unistd.h>
#endif
+#include <axis/server/GDefine.h>
#include <axis/server/Packet.h>
-#include <axis/server/AxisConfig.h>
+#include <axis/Axis.h>
+#include "../../common/AxisConfig.h"
#include "../../common/AxisSocketUtils.h"
-#include "ServerHelper.h"
-#include <axis/server/GDefine.h>
+#include "SimpleAxisTransport.h"
+
+extern int process_request (SOAPTransport * str);
-//extern AxisTrace* g_pAT;
-#define MAXPENDING 5 /* Maximum outstanding connection requests */
-#define RCVBUFSIZE 1000 /* Size of receive buffer */
+#define MAXPENDING 5 // Maximum outstanding connection requests
#ifdef WIN32
#define AXIS_SOCKET_ERROR SOCKET_ERROR
#else //Linux
#define AXIS_SOCKET_ERROR 1
#endif
-char echoBuffer[RCVBUFSIZE]; /* Buffer for echo string */
-const char* pcHttpBody;
-int iClntSocket;
-map <HTTP_MAP_KEYWORDS, HTTP_MAP_TYPE*> map_HTTP_Headers;
-const int HEADER_ARRAY_SIZE = 10;
-HttpHeaders g_pHttpHeaders[HEADER_ARRAY_SIZE];
-int iHeaderCount = 0;
-bool g_blnBodySizeAvailable = false;
-int g_iBodySize = 0;
-
#define AXIS_URI_EXTENSION "/axis"
/* Following is the character that should be used to separate the method name
@@ -65,231 +54,54 @@
*/
#define SOAPACTION_METHODNAME_SEPARATOR "#"
-AXIS_TRANSPORT_STATUS AXISCALL send_response_bytes (const char* buffer,
- const void* bufferid, const void*pStream)
-{
- /*
- * TODO:
- * //--------------Change this, sending of transport related info has to be
- * done in "set_transport_information" method.
- */
- //AXISTRACE3("sending trasport info");
-
- int iMsgSize = strlen (buffer);
- char pchContentLength[4];
- sprintf (pchContentLength, "%d", iMsgSize);
-
- char* res = (char *) malloc (iMsgSize + 200);
- res[0] = 0;
- strcpy (res,
- "HTTP/1.1 200 OK\nDate: Wed, 03 Sep 2003 09:23:06 GMT\nContent-Length: ");
- strcat (res, pchContentLength);
- strcat (res, "\nContent-Type: text/xml\r\n\r\n");
- //--------------END OF Change this, sending of transport related info has to be done in "set_transport_information" method.
-
- strcat (res, buffer);
-
- //AXISTRACE3(res);
-
- if (send (iClntSocket, res, strlen (res), 0) == AXIS_SOCKET_ERROR)
- {
- free (res);
- printf ("%s\n", "send() failed");
- return TRANSPORT_FAILED;
- }
- else
- {
- free (res);
- return TRANSPORT_FINISHED;
- }
-
-}
-
-AXIS_TRANSPORT_STATUS AXISCALL get_request_bytes (const char** req,
- int* retsize, const void* stream)
-{
- req[0] = '\0';
- *req = pcHttpBody;
- *retsize = strlen (pcHttpBody);
-
- return TRANSPORT_FINISHED;
-}
-
-void AXISCALL set_transport_information (AXIS_TRANSPORT_INFORMATION_TYPE type,
- const char* value, const void* stream)
-{
- //AXISTRACE3("sending trasport info.......");
-
- char* res =
- "HTTP/1.1 200 OK\nContent-Type: text/xml; charset=utf-8\nDate: Wed, 03 Sep 2003 09:23:06 GMT\nConnection: close\n\n";
- // AXISTRACE3(res);
-
- int iMsgSize = strlen (res);
-
- if (send (iClntSocket, res, iMsgSize, 0) == AXIS_SOCKET_ERROR)
- printf ("%s\n", "send() failed");
-}
-
-const char* AXISCALL get_transport_information
- (AXIS_TRANSPORT_INFORMATION_TYPE type, const void* pStream)
-{
- const Ax_soapstream* stream = (Ax_soapstream*) pStream;
- const char* ptemp;
- switch (type)
- {
- case SOAPACTION_HEADER:
- return get_property (stream, "SOAPAction");
- /* TODO */
- // return "abc";
- /*-------------------*/
- case SERVICE_URI:
- if (strstr (stream->so.http->uri_path, AXIS_URI_EXTENSION))
- {
- return strstr (stream->so.http->uri_path, AXIS_URI_EXTENSION) +
- strlen (AXIS_URI_EXTENSION) + 1;
- }
- else
- {
- return stream->so.http->uri_path;
- }
- case OPERATION_NAME:
- ptemp = get_property (stream, "SOAPAction");
- /* TODO */
- /*-------------------*/
- if (ptemp)
- {
- if (strstr (ptemp, SOAPACTION_METHODNAME_SEPARATOR))
- {
- return strstr (ptemp, SOAPACTION_METHODNAME_SEPARATOR) +
- strlen (SOAPACTION_METHODNAME_SEPARATOR);
- }
- else
- {
- return ptemp;
- }
- }
- case SOAP_MESSAGE_LENGTH:
- return get_property (stream, "Content-Length");
- /* This is apache module and transport is http so the key */
- /* TODO */
- return 0;
- /*-------------------*/
- default:;
- }
- return NULL;
-}
-
-void AXISCALL release_receive_buffer (const char* buffer, const void* stream)
-{
-
-}
-
-int executeWork (Ax_soapstream* pStr)
-{
-
- Ax_soapstream* str = pStr;
-
- process_request (str);
-
- // free(str->so.http->ip_headers);
- // free(str);
-
- return 0;
-}
-
-int initializeStuff ()
-{
-
- for (int i = 0; i < RCVBUFSIZE; i++)
- {
- echoBuffer[i] = '\0';
- }
-
- memset (&g_pHttpHeaders, 0, sizeof(HttpHeaders)* HEADER_ARRAY_SIZE);
-
- iHeaderCount = 0;
- g_blnBodySizeAvailable = false;
- g_iBodySize = 0;
-
- return AXIS_SUCCESS;
-}
-
-int releaseStuff ()
-{
- /*
- * release the map_HTTP_Headers
- */
- map < HTTP_MAP_KEYWORDS, HTTP_MAP_TYPE * >::iterator ite_map_HTTP_Headers =
- map_HTTP_Headers.begin ();
-
- while (ite_map_HTTP_Headers != map_HTTP_Headers.end ())
- {
- free (((*ite_map_HTTP_Headers).second)->objuHttpMapContent);
- free (((*ite_map_HTTP_Headers).second));
-
- ite_map_HTTP_Headers++;
- }
-
- map_HTTP_Headers.clear ();
-
- /*
- * release the g_pHttpHeaders
- */
- for (int i = 0; i < iHeaderCount; i++)
- {
- free (g_pHttpHeaders[i].header_name);
- free (g_pHttpHeaders[i].header_value);
- }
-
- return AXIS_SUCCESS;
-}
-
-int createTCPServerSocket (unsigned short port)
+int
+createTCPServerSocket (unsigned short port)
{
- int sock; /* socket to create */
- struct sockaddr_in echoServAddr; /* Local address */
+ int sock; /* socket to create */
+ struct sockaddr_in echoServAddr; /* Local address */
/* Create socket for incoming connections */
if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
- printf ("%s\n", "socket() failed");
+ printf ("%s\n", "socket() failed");
/* Construct local address structure */
- memset (&echoServAddr, 0, sizeof (echoServAddr)); /* Zero out structure */
- echoServAddr.sin_family = AF_INET; /* Internet address family */
- echoServAddr.sin_addr.s_addr = htonl (INADDR_ANY); /* Any incoming interface */
- echoServAddr.sin_port = htons (port); /* Local port */
+ memset (&echoServAddr, 0, sizeof (echoServAddr)); /* Zero out structure */
+ echoServAddr.sin_family = AF_INET; /* Internet address family */
+ echoServAddr.sin_addr.s_addr = htonl (INADDR_ANY); /* Any incoming interface */
+ echoServAddr.sin_port = htons (port); /* Local port */
/* Bind to the local address */
- if (bind (sock, (struct sockaddr *) &echoServAddr,
- sizeof (echoServAddr)) < 0)
- printf ("%s\n", "bind() failed");
+ if (bind (sock, (struct sockaddr *) &echoServAddr,
+ sizeof (echoServAddr)) < 0)
+ printf ("%s\n", "bind() failed");
/* Mark the socket so it will listen for incoming connections */
- if (listen (sock, MAXPENDING) < 0)
- printf ("%s\n", "listen() failed");
+ if (listen (sock, MAXPENDING) < 0)
+ printf ("%s\n", "listen() failed");
return sock;
}
-int acceptTCPConnection (int servSock)
+int
+acceptTCPConnection (int servSock)
{
- int clntSock; /* Socket descriptor for client */
- struct sockaddr_in echoClntAddr; /* Client address */
+ int clntSock; /* Socket descriptor for client */
+ struct sockaddr_in echoClntAddr; /* Client address */
#ifdef WIN32
- int clntLen; /* Length of client address data structure */
+ int clntLen; /* Length of client address data structure */
#else //Linux
- unsigned int clntLen; /* Length of client address data structure */
+ unsigned int clntLen; /* Length of client address data structure */
#endif
/* Set the size of the in-out parameter */
clntLen = sizeof (echoClntAddr);
/* Wait for a client to connect */
- if ((clntSock = accept (servSock, (struct sockaddr *) &echoClntAddr,
- &clntLen)) < 0)
+ if ((clntSock = accept (servSock, (struct sockaddr *) &echoClntAddr,
+ &clntLen)) < 0)
{
- printf ("%s\n", "accept() failed");
- AxisSocketUtils::printSocketErrorDescription ();
+ printf ("%s\n", "accept() failed");
+ AxisSocketUtils::printSocketErrorDescription ();
}
/* clntSock is connected to a client! */
@@ -300,229 +112,56 @@
return clntSock;
}
-int getHttpBodySize (string & sStream)
+void
+handleTCPClient (int clntSocket)
{
+ SimpleAxisTransport *pTransport = new SimpleAxisTransport (clntSocket);
- //AXISTRACE3("In the NEW CODE getHttpBodySize():-------------------\n");
-
- int iBodySize = 0;
- bool blnContinue = true;
- string strTmpLine = "";
- int iTmpPos = 0;
- bool blnFullHeaderAvailable = false;
- int iFindStartLocation = 0;
- string sTmpStream = sStream;
-
- iTmpPos = sTmpStream.find ("\r\n\r\n");
- if (iTmpPos != string::npos)
+ printf ("Calling process_request \n");
+ if (0 != process_request (pTransport))
{
- sTmpStream = sTmpStream.substr (iFindStartLocation, iTmpPos + 2);
- blnFullHeaderAvailable = true;
+ printf ("process_request FAILED\n");
}
+ delete pTransport;
- iTmpPos = 0;
-
- while (blnContinue)
- {
- iTmpPos = sTmpStream.find ("\n", iFindStartLocation);
- if ((iTmpPos == string::npos) && (blnFullHeaderAvailable))
- {
- iBodySize = -1; //To indicate an error
- blnContinue = false;
- }
- else if ((iTmpPos == string::npos) && (blnFullHeaderAvailable == false))
- {
- blnContinue = false; //Not a error, but can't procede
- }
- else
- {
- strTmpLine = sTmpStream.substr (iFindStartLocation,
- (iTmpPos - iFindStartLocation));
-
- int iTmpLoc = strTmpLine.find ("Content-Length");
- if (iTmpLoc != string::npos)
- {
- iTmpLoc = strTmpLine.find (":");
- string sTmpLen = strTmpLine.substr (iTmpLoc + 1);
- iBodySize = atoi (sTmpLen.c_str ());
- g_blnBodySizeAvailable = true;
- blnContinue = false;
- break;
- }
-
- iFindStartLocation = iTmpPos + 1;
- }
- }
-
- return iBodySize;
-}
-
-bool checkStreamIsFullyRead (string &sStream)
-{
-
- // AXISTRACE3("In the NEW CODE checkStreamIsFullyRead():---------------\n");
- int iTmpPos = 0;
- string strTmpBody = "";
-
- iTmpPos = sStream.find ("\r\n\r\n");
-
- if (iTmpPos != string::npos)
- {
- iTmpPos += 4;
- }
-
- strTmpBody = sStream.substr (iTmpPos);
-
- if (strTmpBody.length () < g_iBodySize)
- {
- return false;
- }
- else
- {
- return true;
- }
-}
-
-void handleTCPClient (int clntSocket)
-{
- Ax_soapstream* str = (Ax_soapstream*) malloc (sizeof (Ax_soapstream));
-
- /*populate Ax_soapstream struct with relevant transport function pointers */
- str->transport.pSendFunct = send_response_bytes;
- str->transport.pGetFunct = get_request_bytes;
- str->transport.pSetTrtFunct = set_transport_information;
- str->transport.pGetTrtFunct = (AXIS_MODULE_CALLBACK_GET_TRANSPORT_INFORMATION)get_transport_information;
- str->transport.pRelBufFunct = release_receive_buffer;
-
- str->trtype = APTHTTP;
- str->so.http = (Ax_stream_http *) malloc (sizeof (Ax_stream_http));
- str->sessionid = "this is temporary session id";
- str->str.ip_stream = "";
- str->str.op_stream = "";
-
- int recvMsgSize; /* Size of received message */
-
- /* Receive message from client */
-
- string sClientReqStream;
- bool blnContinue = true;
-
- while (blnContinue)
- {
- if ((recvMsgSize = recv (clntSocket, echoBuffer, RCVBUFSIZE, 0)) < 0)
- {
- printf ("%s\n", "recv() failed");
- }
- else
- {
- sClientReqStream += echoBuffer;
- // AXISTRACE3("recd sClientReqStream:-------------------\n%s\n");
- // AXISTRACE3(sClientReqStream.c_str());
-
- if (g_blnBodySizeAvailable == false)
- {
- g_iBodySize = getHttpBodySize (sClientReqStream);
- }
-
- if (g_iBodySize > 0)
- {
- if (checkStreamIsFullyRead (sClientReqStream))
- {
- blnContinue = false;
- }
- }
- }
- }
-
- string sHTTPHeaders = "";
- string sHTTPBody = "";
-
- getSeperatedHTTPParts (sClientReqStream, sHTTPHeaders, sHTTPBody,
- &map_HTTP_Headers, str, g_pHttpHeaders, HEADER_ARRAY_SIZE,
- &iHeaderCount);
-
- // AXISTRACE3("----------START extracted HTTP Headers------------");
- // AXISTRACE3(sHTTPHeaders.c_str());
- // AXISTRACE3("----------END extracted HTTP Headers--------------");
-
- // AXISTRACE3("----------START extracted HTTP Body---------------");
- // AXISTRACE3(sHTTPBody.c_str());
- // AXISTRACE3("----------END extracted HTTP Body-----------------");
-
- str->so.http->uri_path =
- strdup (map_HTTP_Headers[HMK_URI]->objuHttpMapContent->msValue);
-
- str->so.http->ip_headercount = iHeaderCount;
-
- str->so.http->ip_headers = (Ax_header*) malloc (sizeof (Ax_header));
- str->so.http->ip_headers = (Ax_header*) (g_pHttpHeaders);
-
- switch (map_HTTP_Headers[HMK_METHOD]->objuHttpMapContent->eHTTP_KEYWORD)
- {
- case HK_GET:
- str->so.http->ip_method = AXIS_HTTP_GET;
- break;
- case HK_POST:
- str->so.http->ip_method = AXIS_HTTP_POST;
- break;
- default:
- str->so.http->ip_method = AXIS_HTTP_UNSUPPORTED;
- }
-
- pcHttpBody = sHTTPBody.c_str ();
- iClntSocket = clntSocket;
-
- executeWork (str);
- /* De-allocate the memory */
- free (str->so.http->ip_headers);
- free (str->so.http->uri_path);
- free (str->so.http);
- free (str);
-
- releaseStuff ();
-
-#ifdef WIN32
- closesocket (clntSocket); /* Close client socket */
-#else //Linux
- close (clntSocket);
-#endif
}
-int main (int argc, char* argv[])
+int
+main (int argc, char *argv[])
{
- int* servSock; /* Socket descriptors for server */
+ int *servSock; /* Socket descriptors for server */
#ifdef WIN32
- WSADATA wsaData; /* Structure for WinSock setup communication */
+ WSADATA wsaData; /* Structure for WinSock setup communication */
#else //Linux
#endif
- fd_set sockSet; /* Set of socket descriptors for select() */
- int maxDescriptor; /* Maximum socket descriptor value */
- struct timeval selTimeout; /* Timeout for select() */
- long timeout = 1000; /* Timeout value given on command-line */
+ fd_set sockSet; /* Set of socket descriptors for select() */
+ int maxDescriptor; /* Maximum socket descriptor value */
+ struct timeval selTimeout; /* Timeout for select() */
+ long timeout = 1000; /* Timeout value given on command-line */
int running = 1;
int iServerPort;
int iPort;
- int noPorts = 1; /* Number of ports is argument count minus 2 */
- servSock = (int*) malloc (noPorts* sizeof (int));
+ int noPorts = 1; /* Number of ports is argument count minus 2 */
+ servSock = (int *) malloc (noPorts * sizeof (int));
/* Initialize maxDescriptor for use by select() */
maxDescriptor = -1;
if (argc < 2)
{
- printf ("Problem occured.\nUsage: %s <Server Port>", argv[0]);
- exit (1);
+ printf ("Problem occured.\nUsage: %s <Server Port>", argv[0]);
+ exit (1);
}
#ifdef WIN32
- if (WSAStartup (MAKEWORD (2, 0), &wsaData) != 0) /* Load Winsock 2.0 DLL */
+ if (WSAStartup (MAKEWORD (2, 0), &wsaData) != 0) /* Load Winsock 2.0 DLL */
{
- fprintf (stderr, "WSAStartup() failed");
- exit (1);
+ fprintf (stderr, "WSAStartup() failed");
+ exit (1);
}
#else //Linux
#endif
@@ -531,17 +170,17 @@
iServerPort = atoi (argv[1]);
if (iServerPort == 0)
{
- printf ("Problem occured. Error in specified server port");
- exit (1);
+ printf ("Problem occured. Error in specified server port");
+ exit (1);
}
else
{
- servSock[0] = createTCPServerSocket (iServerPort);
- /* Determine if new descriptor is the largest */
- if (servSock[0] > maxDescriptor)
- {
- maxDescriptor = servSock[0];
- }
+ servSock[0] = createTCPServerSocket (iServerPort);
+ /* Determine if new descriptor is the largest */
+ if (servSock[0] > maxDescriptor)
+ {
+ maxDescriptor = servSock[0];
+ }
}
///////////////
@@ -551,37 +190,38 @@
while (running)
{
- FD_ZERO (&sockSet);
- FD_SET (servSock[0], &sockSet);
+ FD_ZERO (&sockSet);
+ FD_SET (servSock[0], &sockSet);
- /* Timeout specification */
- /* This must be reset every time select() is called */
- selTimeout.tv_sec = timeout; /* timeout (secs.) */
- selTimeout.tv_usec = 0; /* 0 microseconds */
-
- if (select (maxDescriptor + 1, &sockSet, NULL, NULL, &selTimeout) == 0)
- {
- /*
- * DEBUG line
- * printf("No echo requests for %ld secs...Server still alive\n",
+ /* Timeout specification */
+ /* This must be reset every time select() is called */
+ selTimeout.tv_sec = timeout; /* timeout (secs.) */
+ selTimeout.tv_usec = 0; /* 0 microseconds */
+
+ if (select (maxDescriptor + 1, &sockSet, NULL, NULL, &selTimeout) ==
+ 0)
+ {
+ /*
+ * DEBUG line
+ * printf("No echo requests for %ld secs...Server still alive\n",
* timeout);
*/
- }
- else
- {
- if (FD_ISSET (servSock[0], &sockSet))
- {
- initializeStuff ();
- /*
- * DEBUG line
- * printf("Request on port %d (cmd-line position): \n", 0);
- */
- handleTCPClient (acceptTCPConnection (servSock[0]));
- }
- }
+ }
+ else
+ {
+ if (FD_ISSET (servSock[0], &sockSet))
+ {
+ //initializeStuff ();
+ /*
+ * DEBUG line
+ * printf("Request on port %d (cmd-line position): \n", 0);
+ */
+ handleTCPClient (acceptTCPConnection (servSock[0]));
+ }
+ }
- // AXISTRACE3("end of main while");
+ // AXISTRACE3("end of main while");
}
//uninitializing Axis
@@ -591,9 +231,9 @@
for (iPort = 0; iPort < noPorts; iPort++)
{
#ifdef WIN32
- closesocket (servSock[iPort]);
+ closesocket (servSock[iPort]);
#else //Linux
- close (servSock[iPort]);
+ close (servSock[iPort]);
#endif
}
@@ -601,7 +241,7 @@
free (servSock);
#ifdef WIN32
- WSACleanup (); /* Cleanup Winsock */
+ WSACleanup (); /* Cleanup Winsock */
#else //Linux
#endif
1.1 ws-axis/c/src/server/simple_axis_server/SimpleAxisTransport.cpp
Index: SimpleAxisTransport.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*
*/
#include "SimpleAxisTransport.h"
#define AXIS_URI_EXTENSION "/axis"
/* Following is the character that should be used to separate the method name in
* the SOAPAction header value. Ex: "http://localhost:80/axis/Calculator#Add"
*/
#define SOAPACTION_METHODNAME_SEPARATOR "#"
SimpleAxisTransport::SimpleAxisTransport (int iSocket)
{
m_iSocket = iSocket;
m_bReadPastHeaders = false;
m_strPayloadToSend = "";
m_strServiceURI = "base";
m_strReceived = "";
m_strSOAPAction = "";
}
SimpleAxisTransport::~SimpleAxisTransport ()
{
}
AXIS_TRANSPORT_STATUS
SimpleAxisTransport::sendBytes (const char *pcSendBuffer,
const void *pBufferId)
{
m_strPayloadToSend += pcSendBuffer;
return TRANSPORT_FINISHED;
if (!pBufferId) // temporary buffers should always sent immediately
{
if ((send (m_iSocket, pcSendBuffer, strlen (pcSendBuffer), MSG_DONTROUTE)) == -1)
return TRANSPORT_FAILED;
return TRANSPORT_FINISHED;
}
for (int index = 0; index < NO_OF_SERIALIZE_BUFFERS; index++)
{
if (!m_pBuffers[index].pcBuffer)
{
m_pBuffers[index].pcBuffer = pcSendBuffer;
m_pBuffers[index].pBufferId = pBufferId;
break;
}
}
return TRANSPORT_IN_PROGRESS;
}
void
SimpleAxisTransport::
setTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE type, const char *value)
{
const char *key = NULL;
switch (type)
{
case SOAPACTION_HEADER: /* needed only in the client side ? */
break;
case SERVICE_URI: /* need to set ? */
break;
case OPERATION_NAME: /* need to set ? */
break;
case SOAP_MESSAGE_LENGTH:
/* This is apache module and transport is http so the key */
key = "Content-Length";
break;
default:;
}
if (key)
{
setTransportProperty (key, value);
}
}
AXIS_TRANSPORT_STATUS
SimpleAxisTransport::flushOutput ()
{
int contentLength = 0;
char strtonum[8];
contentLength = m_strPayloadToSend.length ();
if (contentLength != 0) // do only if the http body is not empty.
{
sprintf (strtonum, "%d", contentLength);
setTransportProperty (SOAP_MESSAGE_LENGTH, strtonum);
m_strHTTPHeaders = std::string ("HTTP/1.1 200 OK\r\n") +
std::string ("Server: Apache Axis C++/1.3\r\n") +
m_strHTTPHeaders + std::string ("Content-Type: text/xml\r\n\r\n");
if ((send
(m_iSocket, m_strHTTPHeaders.c_str (), m_strHTTPHeaders.size (),
MSG_DONTROUTE)) == -1)
return TRANSPORT_FAILED;
if ((send
(m_iSocket, m_strPayloadToSend.c_str (),
m_strPayloadToSend.length (), MSG_DONTROUTE)) == -1)
return TRANSPORT_FAILED;
}
return TRANSPORT_FINISHED;
}
AXIS_TRANSPORT_STATUS
SimpleAxisTransport::getBytes (char *pBuffer, int *piSize)
{
if (m_strReceived.length () <= 0)
{
pBuffer[0] = '\0';
(*piSize) = 0;
return TRANSPORT_FINISHED;
}
if (m_strReceived.length () < (*piSize))
{
pBuffer[0] = '\0';
strcat (pBuffer, m_strReceived.c_str ());
(*piSize) = m_strReceived.length ();
m_strReceived = "";
return TRANSPORT_FINISHED;
}
else
{
pBuffer[0] = '\0';
std::string strToSend = m_strReceived.substr ((*piSize) - 1);
strcat (pBuffer, strToSend.c_str ());
(*piSize) = strToSend.length ();
m_strReceived =
m_strReceived.substr ((*piSize),
m_strReceived.length () - (*piSize));
return TRANSPORT_IN_PROGRESS;
}
}
void
SimpleAxisTransport::readFromClient ()
{
int len_read = 0;
const unsigned int BUF_SIZE = 48000;
char arr[BUF_SIZE];
std::string strReceived = "";
unsigned int iStartPos = std::string::npos;
do
{
len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
if (len_read < 0)
return;
arr[len_read] = '\0';
strReceived = arr;
iStartPos = strReceived.find ("\r\n\r\n");
}
while (iStartPos == std::string::npos);
iStartPos += 4;
unsigned int uiServiceStartPos =
strReceived.find ("POST ") + strlen ("POST ");
unsigned int uiServiceEndPos = strReceived.find (" ", uiServiceStartPos);
m_strServiceURI =
strReceived.substr (uiServiceStartPos,
uiServiceEndPos - uiServiceStartPos);
unsigned int uiActionStartPos =
strReceived.find ("SOAPAction: \"") + strlen ("SOAPAction: \"");
unsigned int uiActionEndPos = strReceived.find ("\"", uiActionStartPos);
m_strSOAPAction =
strReceived.substr (uiActionStartPos,
uiActionEndPos - uiActionStartPos);
unsigned int uiEnvelopePos = strReceived.find ("Envelope");
while (uiEnvelopePos == std::string::npos)
{
len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
arr[len_read] = '\0';
strReceived += arr;
uiEnvelopePos = strReceived.find ("Envelope");
}
uiEnvelopePos += strlen ("Envelope");
unsigned int uiEnvelopeEndPos =
strReceived.find ("Envelope", uiEnvelopePos);
while (uiEnvelopeEndPos == std::string::npos)
{
len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
arr[len_read] = '\0';
strReceived += arr;
uiEnvelopeEndPos = strReceived.find ("Envelope", uiEnvelopePos);
}
m_strReceived =
strReceived.substr (iStartPos, strReceived.length () - iStartPos);
}
const char *
SimpleAxisTransport::
getTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE eType)
{
switch (eType)
{
case SOAPACTION_HEADER:
return getTransportProperty ("SOAPAction");
case SERVICE_URI:
readFromClient ();
if (m_strServiceURI.find (AXIS_URI_EXTENSION) != std::string::npos)
{
unsigned int uiStartPos =
m_strServiceURI.find (AXIS_URI_EXTENSION) +
strlen (AXIS_URI_EXTENSION) + 1;
const char *uri =
m_strServiceURI.substr (uiStartPos,
m_strServiceURI.length () -
uiStartPos).c_str ();
return uri;
}
else
{
return m_strServiceURI.c_str ();
}
case OPERATION_NAME:
{
unsigned int uiOpStart =
m_strSOAPAction.find (SOAPACTION_METHODNAME_SEPARATOR);
if (uiOpStart != std::string::npos)
{
uiOpStart += strlen (SOAPACTION_METHODNAME_SEPARATOR);
return m_strSOAPAction.substr (uiOpStart,
m_strSOAPAction.length () -
uiOpStart).c_str ();
}
else
{
return m_strSOAPAction.c_str ();
}
}
case SOAP_MESSAGE_LENGTH:
return getTransportProperty ("Content-Length");
default:;
}
return NULL;
}
void
SimpleAxisTransport::setTransportProperty (const char *pcKey,
const char *pcValue)
{
m_strHTTPHeaders +=
std::string (pcKey) + std::string (": ") + std::string (pcValue) +
std::string ("\r\n");
}
const char *
SimpleAxisTransport::getTransportProperty (const char *pcKey)
{
return 0;
}
void
SimpleAxisTransport::setSessionId (const char *pcSessionId)
{
}
const char *
SimpleAxisTransport::getSessionId ()
{
return "this is temporary session id"; //TODO
}
const char *
SimpleAxisTransport::getServiceName ()
{
return 0; //TODO
}
AXIS_PROTOCOL_TYPE
SimpleAxisTransport::getProtocol ()
{
return APTHTTP;
}
int
SimpleAxisTransport::getSubProtocol ()
{
return AXIS_HTTP_POST;
}
1.1 ws-axis/c/src/server/simple_axis_server/SimpleAxisTransport.h
Index: SimpleAxisTransport.h
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*/
#if !defined(SIMPLE_AXIS_TRANSPORT_H__OF_AXIS_INCLUDED_)
#define SIMPLE_AXIS_TRANSPORT_H__OF_AXIS_INCLUDED_
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#include <sys/types.h>
#endif
#include <string.h>
#include "../../transport/SOAPTransport.h"
#include <string>
AXIS_CPP_NAMESPACE_USE class SimpleAxisTransport:public SOAPTransport
{
public:
SimpleAxisTransport (int iSocket);
virtual ~ SimpleAxisTransport ();
int openConnection ()
{
return AXIS_SUCCESS;
};
void closeConnection ()
{
};
AXIS_TRANSPORT_STATUS sendBytes (const char *pcSendBuffer,
const void *pBufferId);
void registerReleaseBufferCallback
(AXIS_ENGINE_CALLBACK_RELEASE_SEND_BUFFER pFunct)
{
m_pReleaseBufferCallback = pFunct;
};
AXIS_TRANSPORT_STATUS getBytes (char *pBuffer, int *piSize);
void releaseBuffer (const char *pBuffer);
void setTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE type,
const char *value);
const char *getTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE eType);
void setTransportProperty (const char *pcKey, const char *pcValue);
const char *getTransportProperty (const char *pcKey);
void setAttachment (const char *pcAttachmentid, const char *pcAttachment)
{
};
const char *getAttachment (const char *pcAttachmentid)
{
return "value";
};
void setEndpointUri (const char *pcEndpointUri)
{
m_pcEndpointUri = strdup (pcEndpointUri);
};
void setSessionId (const char *pcSessionId);
const char *getSessionId ();
const char *getServiceName ();
AXIS_PROTOCOL_TYPE getProtocol ();
int getSubProtocol ();
AXIS_TRANSPORT_STATUS flushOutput ();
/**
* Set transport timeout.
* TODO: need to implement
*
* @param lSeconds Timeout in seconds
*/
void setTimeout (const long lSeconds)
{
};
private:
int m_iSocket;
BufferInfo *m_pBuffers;
std::string m_strHTTPHeaders;
bool m_bReadPastHeaders;
std::string m_strPayloadToSend;
std::string m_strServiceURI;
std::string m_strReceived;
std::string m_strSOAPAction;
void readFromClient ();
};
#endif //SIMPLE_AXIS_TRANSPORT_H__OF_AXIS_INCLUDED_