XML Data Bindings {#mainpage}
=================
[TOC]
Introduction {#intro}
============
This is a detailed overview of the gSOAP XML data bindings concepts, usage, and
implementation. At the end of this document two examples are given to
illustrate the application of XML data bindings.
The first simple example `address.cpp` shows how to use wsdl2h to bind an XML
schema to C++. The C++ application reads and writes an XML file into and from
a C++ "address book" data structure. The C++ data structure is an STL vector
of address objects.
The second example `graph.cpp` shows how XML is serialized as a tree, digraph,
and cyclic graph. The digraph and cyclic graph serialization rules are similar
to SOAP 1.1/1.2 encoded multi-ref elements with id-ref attributes to link
elements through IDREF XML references, creating a an XML graph with pointers to
XML nodes.
These examples demonstrate XML data bindings only for relatively simple data
structures and types. The gSOAP tools support more than just these type of
structures to serialize in XML. There are practically no limits to
enable XML serialization of C and C++ types.
Support for XML schema components is unlimited. The wsdl2h tool maps schemas
to C and C++ using built-in intuitive mapping rules, while allowing the
mappings to be customized using a `typemap.dat` file with mapping instructions
for wsdl2h.
The information in this document is applicable to gSOAP 2.8.26 and higher, which
supports C++11 features. However, C++11 is not required to use this material
and the examples included, unless we need smart pointers and scoped
enumerations. While most of the examples in this document are given in C++,
the concepts also apply to C with the exception of containers, smart pointers,
classes and their methods. None of these exceptions limit the use of the
gSOAP tools for C in any way.
The data binding concepts described in this document were first envisioned in
1999 by Prof. Robert van Engelen at the Florida State University. An
implementation was created in 2000, named "stub/skeleton compiler". The first
articles on its successor version "gSOAP" appeared in 2002. The principle of
mapping XSD components to C/C++ types and vice versa is now widely adopted in
systems and programming languages, including Java web services and by C# WCF.
We continue to be committed to our goal to empower C/C++ developers with
powerful autocoding tools for XML. Our commitment started in the very early
days of SOAP by actively participating in
[SOAP interoperability testing](http://www.whitemesa.com/interop.htm),
participating in the development and testing of the
[W3C XML Schema Patterns for Databinding Interoperability](http://www.w3.org/2002/ws/databinding),
and continues by contributing to the development of
[OASIS open standards](https://www.oasis-open.org) in partnership with leading
IT companies.
Mapping WSDL and XML schemas to C/C++ {#tocpp}
=====================================
To convert WSDL and XML schemas (XSD files) to code, use the wsdl2h command to
generate the data binding interface code that is saved to a special gSOAP
header file with WSDL service declarations and the data binding interface:
wsdl2h [options] -o file.h ... XSD and WSDL files ...
This command converts WSDL and XSD files to C++ (or pure C with wsdl2h option
`-c`) and saves the data binding interface to a gSOAP header file `file.h` that
uses familiar C/C++ syntax extended with `//gsoap` [directives](#directives)
and annotations. Notational conventions are used in the data binding interface
to declare serializable C/C++ types and functions for Web service operations.
The WSDL 1.1/2.0, SOAP 1.1/1.2, and XSD 1.0/1.1 standards are supported by the
gSOAP tools. In addition, the most popular WS specifications are also
supported, including WS-Addressing, WS-ReliableMessaging, WS-Discovery,
WS-Security, WS-Policy, WS-SecurityPolicy, and WS-SecureConversation.
This document focusses on XML data bindings. XML data bindings for C/C++ bind
XML schema types to C/C++ types. So integers in XML are bound to C integers,
strings in XML are bound to C or C++ strings, complex types in XML are bound to
C structs or C++ classes, and so on.
A data binding is dual. Either you start with WSDLs and/or XML schemas that
are mapped to equivalent C/C++ types, or you start with C/C++ types that are
mapped to XSD types. Either way, the end result is that you can serialize
C/C++ types in XML such that your XML is an instance of XML schema(s) and is
validated against these schema(s).
This covers all of the following standard XSD components with their optional
attributes and properties:
| XSD Component | Attributes and Properties |
| -------------- | ------------------------------------------------------------------------------------------------------------------- |
| schema | targetNamespace, version, elementFormDefault, attributeFormDefault, defaultAttributes |
| attribute | name, ref, type, use, default, fixed, form, targetNamespace, wsdl:arrayType |
| element | name, ref, type, default, fixed, form, nillable, abstract, substitutionGroup, minOccurs, maxOccurs, targetNamespace |
| simpleType | name |
| complexType | name, abstract, mixed, defaultAttributesApply |
| all | |
| choice | minOccurs, maxOccurs |
| sequence | minOccurs, maxOccurs |
| group | name, ref, minOccurs, maxOccurs |
| attributeGroup | name, ref |
| any | minOccurs, maxOccurs |
| anyAttribute | |
And also the following standard XSD directives are covered:
| Directive | Description |
| ---------- | ---------------------------------------------------------- |
| import | Imports a schema into the importing schema for referencing |
| include | Include schema component definitions into a schema |
| override | Override by replacing schema component definitions |
| redefine | Extend or restrict schema component definitions |
| annotation | Annotates a component |
The XSD facets and their mappings to C/C++ are:
| XSD Facet | Maps to |
| -------------- | ------------------------------------------------------------------------------------------- |
| enumeration | `enum` |
| simpleContent | class/struct wrapper with `__item` member |
| complexContent | class/struct |
| list | `enum*` bitmask (`enum*` enumerate
没有合适的资源?快使用搜索试试~ 我知道了~
gsoap开发包 C/C++开发webservice用到的gsoap开发包
共6044个文件
xml:2287个
html:1169个
png:813个
5星 · 超过95%的资源 需积分: 5 54 下载量 48 浏览量
2016-03-17
09:34:15
上传
评论
收藏 22.89MB ZIP 举报
温馨提示
C/C++开发webservice用到的gsoap开发包
资源推荐
资源详情
资源评论
收起资源包目录
gsoap开发包 C/C++开发webservice用到的gsoap开发包 (6044个子文件)
output.0 225KB
traces.0 48KB
output.1 225KB
traces.1 49KB
calc_xcode.1 3KB
output.2 225KB
traces.2 48KB
output.3 225KB
traces.3 50KB
_Makefile_ 11KB
configure.ac 11KB
Makefile.am 3KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 935B
Makefile.am 843B
Makefile.am 780B
Makefile.am 779B
Makefile.am 764B
Makefile.am 738B
Makefile.am 719B
Makefile.am 687B
Makefile.am 687B
Makefile.am 654B
Makefile.am 654B
Makefile.am 652B
Makefile.am 646B
Makefile.am 637B
Makefile.am 633B
Makefile.am 628B
Makefile.am 623B
Makefile.am 613B
Makefile.am 610B
Makefile.am 609B
Makefile.am 589B
Makefile.am 584B
Makefile.am 580B
Makefile.am 551B
Makefile.am 532B
Makefile.am 520B
Makefile.am 510B
Makefile.am 504B
Makefile.am 504B
Makefile.am 503B
Makefile.am 493B
Makefile.am 487B
Makefile.am 472B
Makefile.am 466B
Makefile.am 466B
Makefile.am 415B
Makefile.am 333B
Makefile.am 272B
Makefile.am 261B
Makefile.am 211B
ABLD.BAT 324B
symbol2.c 827KB
symbol2.c 827KB
stdsoap2.c 529KB
stdsoap2.c 466KB
cacerts.c 254KB
wsseapi.c 225KB
soapcpp2_yacc.tab.c 224KB
soapcpp2_yacc.tab.c 224KB
wsrmapi.c 179KB
dom.c 166KB
wsse2api.c 152KB
lex.soapcpp2_lex.c 85KB
lex.yy.c 85KB
soapC.c 73KB
wsaapi.c 58KB
wsddapi.c 55KB
mecevp.c 49KB
mod_gsoap.c 49KB
httpda.c 47KB
mod_gsoap.c 47KB
webserver.c 46KB
wsrmdemo.c 29KB
wsseapi-lite.c 29KB
router.c 27KB
wssedemo.c 27KB
smdevp.c 25KB
json.c 24KB
mtom-stream-test.c 20KB
mq.c 15KB
options.c 14KB
xml-rpc.c 14KB
tandemnw.c 13KB
mtom-test.c 13KB
rss.c 13KB
soapcpp2.c 12KB
soapcpp2.c 12KB
httppost.c 11KB
soapClient.c 10KB
httpget.c 10KB
httpmd5.c 9KB
共 6044 条
- 1
- 2
- 3
- 4
- 5
- 6
- 61
资源评论
- 上海量化交易龙哥2018-03-20好 可以用
LeavesInTheSky
- 粉丝: 11
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 51单片机学习(1)-软件keil下载
- 历届(第1-21届)希望杯数学竞赛初一试题及答案(最新整理).doc全国数学邀请赛(264页资料)
- 水滴.psd
- TokenPocket_V2.1.2_release.apk
- Apache-druid-kafka-rce.yaml
- 基于C#的ASP.NET数据库原理及应用技术课程指导平台的开发
- 基于ROS的智能车轨迹跟踪算法的仿真与设计源码运用PID跟踪算法.zip.zip
- Bug Bounty Tip - i春秋Self-XSS变废为宝的奇思妙想
- 1991-2015年全国初中化学竞赛复赛试题汇编(212页)(24年竞赛复赛真题).docx天原杯
- Apache Flink 未授权访问+远程代码执行.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功