OVERVIEW
--------
This directory contains custom serializers for common data types.
CONTENTS
--------
Custom serializers augment the soapcpp2-generated serialization routines with
serializers for additional C and C++ types.
See the notes in the source files on specific usage.
The following custom serializers are available:
long_double.* Serializes long double (extended double) type as xsd:decimal
float128.* Serializes __float128 <quadmath.h> type as xsd:decimal
int128.* Serializes __int128_t as xsd:integer
struct_tm.* Serializes struct tm as xsd:dateTime
struct_timeval.* Serializes struct timeval as xsd:dateTime
duration.* Serializes LONG64 milliseconds as xsd:duration
struct_tm_date.* Serializes struct tm as xsd:date
long_time.* Serializes LONG64 milliseconds as xsd:time
chrono_duration.* Serializes C++11 std::chrono::nanoseconds as xsd:duration
chrono_time_point.* Serializes C++11 std::chrono::system_clock as xsd:dateTime
qbytearray_base64.* Serializes Qt QByteArray as xsd:base64Binary
qbytearray_hex.* Serializes Qt QByteArray as xsd:hexBinary
qdate.* Serializes Qt QDate to xsd:date
qdatetime.* Serializes Qt QDateTime to xsd:dateTime
qstring.* Serializes Qt QString to xsd:string (and other XSD)
qtime.* Serializes Qt QTime to xsd:time
The xsd:dateTime parsers are more permissive to accept alternative ISO8601
formats. To restrict xsd:dateTime formats to the XSD standard, use the
SOAP_XML_STRICT flag.
C VERSUS C++
------------
Only .c files are included here for the custom serializers that work both in C
and in C++. Copy the .c files that you need to .cpp for compiling and linking
in C++.
THE 2038 PROBLEM
----------------
Because time_t is limited to dates between 1970 and 2038 (on 32 bit systems),
struct tm should be used for wider date ranges.
USAGE
-----
To use a custom serializer, add an import statement to your gSOAP header file.
For example:
#import "struct_tm.h"
This replaces time_t for xsd__dateTime by struct tm to support a wider date
range. You can then use xsd__dateTime as XML elements and attributes:
struct ns__example
{
@xsd__dateTime start; // attribute
xsd__dateTime end; // element
};
Then run soapcpp2 on this .h file. Compile and link custom/struct_tm.c with
your project code.
When using soapcpp2 option -q<name>, -q<name>, or -p<name>, you must change
struct_tm.c (and other custom serializer .c/.cpp files that you are using) by
changing #include "soapH.h" as follows:
#include "soapH.h" -> #include "nameH.h"
HOW TO USE TYPEMAP.DAT TO AUTOMATE THE MAPPING TO A CUSTOM TYPE WITH WSDL2H
---------------------------------------------------------------------------
A mapping is specified in typemap.dat as follows:
xsd__dateTime = #import "custom/struct_tm.h"
which maps xsd:dateTime to struct tm when wsdl2h is applied to a WSDL.
xsd__decimal = #import "custom/long_double.h" | long double
This maps xsd:decimal to long double (the column after | specifies usage).
To map xsd:string and other XSD string-like types to a Qt QString:
xsd__string = #import "custom/qstring.h"
IMPLEMENTING YOUR OWN CUSTOM SERIALIZERS
----------------------------------------
To build your own custom serializers: a custom serializer is typically declared
in the imported file as follows
extern typedef Type X;
To implement custom serializers you should implement the following routines:
void soap_default_X(struct soap*, X*);
sets default values for X
void soap_serialize_X(struct soap*, X const*);
analyzes X for id-ref serialization (maybe empty)
int soap_out_X(struct soap*, const char *tag, int id, X const*, const char *type);
emits X in XML as <tag xsi:type=type> (type is optional)
X *soap_in_X(struct soap*, const char *tag, X*, const char *type);
parses X from XML as <tag xsi:type=type>
To support XML attribute serialization, you should also define:
int soap_s2X(struct soap*, const char *value, X*);
converts string to X and returns SOAP_OK
const char *soap_X2s(struct soap*, X);
converts X to string (or NULL when error)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
用gsoap wsdl离线生成的onvif.h和方法,之所以用离线生成,是因为在线的onvif都是需要ssl,作为新手,编了很久查了很久,都不行,然后想下载现成的又没有够分。所以自己搞了一个离线,其实比起在线的也不是很复杂。里面有readme文档说明怎么弄的。本来想不要分的,但是最少一分,没有0分。也不知道别人是怎么设置成0分的。供大家互相学习
资源推荐
资源详情
资源评论
收起资源包目录
用gsoap wsdl离线生成的onvif和方法 (124个子文件)
soapC.c 11.29MB
soapClient.c 672KB
soapServer.c 593KB
struct_timeval.c 8KB
struct_tm.c 7KB
duration.c 7KB
struct_tm_date.c 6KB
long_time.c 6KB
int128.c 6KB
long_double.c 6KB
float128.c 5KB
WS-example.c 2KB
chrono_duration.cpp 9KB
qdatetime.cpp 9KB
qtime.cpp 8KB
qdate.cpp 7KB
chrono_time_point.cpp 7KB
qbytearray_base64.cpp 6KB
qstring.cpp 6KB
qbytearray_hex.cpp 6KB
typemap.dat 14KB
wsdl2h.exe 1.12MB
soapcpp2.exe 775KB
soapH.h 6.23MB
onvif.h 4.17MB
soapStub.h 1.71MB
wst2.h 116KB
wst.h 116KB
saml2.h 95KB
saml1.h 77KB
wsdd10.h 50KB
wsdd5.h 50KB
wsdd.h 50KB
wsrm5.h 33KB
wsrm.h 33KB
xenc2.h 21KB
xenc.h 21KB
wsrm4.h 20KB
ds2.h 19KB
ds.h 19KB
wsc.h 15KB
wsa5.h 15KB
wsse.h 14KB
wsc2.h 14KB
wsa.h 14KB
wsse2.h 14KB
wsse11.h 13KB
wsa4.h 11KB
wsrp.h 11KB
wsa3.h 10KB
wsrx5.h 10KB
wsrx.h 9KB
wsp.h 9KB
wstx.h 6KB
wstx2.h 6KB
wsdx.h 6KB
wsu.h 6KB
struct_tm.h 4KB
duration.h 4KB
chrono_duration.h 4KB
xsd.h 4KB
long_time.h 3KB
qstring.h 3KB
struct_timeval.h 3KB
struct_tm_date.h 3KB
qbytearray_hex.h 3KB
qdate.h 3KB
qbytearray_base64.h 3KB
WS-Header.h 3KB
long_double.h 3KB
qdatetime.h 3KB
dom.h 3KB
chrono_time_point.h 3KB
xmime5.h 3KB
qtime.h 3KB
xop.h 3KB
float128.h 3KB
ref.h 3KB
xml.h 3KB
soap12.h 3KB
xmlmime5.h 3KB
xmlmime.h 3KB
int128.h 3KB
xmime4.h 3KB
xmime.h 3KB
stl.h 3KB
stdstring.h 2KB
xlink.h 2KB
stlvector.h 2KB
stldeque.h 2KB
stllist.h 2KB
stlset.h 2KB
vprop.h 2KB
WS-example.h 2KB
plnk.h 2KB
c14n.h 1KB
ser.h 402B
wsp_appliesto.h 277B
wsdd.nsmap 2KB
DeviceIOBinding.nsmap 2KB
共 124 条
- 1
- 2
资源评论
小乙同学
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功