通过gsoap实现高效MTOM协议的数据传输,适合linux操作系统(包括嵌入式linux)下通过MTOM协议实现XML数据包及二进制数据同时传输的应用场景,比普通soap+base64方式发送数据更加高效。
调试mtom经验:
这次调试的一点经验供参考:
1)可以根据附件的yoyo.h文件生成代码,参考以下命令:
soapcpp2 -L -C -I/home/dongruijie/workspace/gsoap-2.8/gsoap/import yoyo.h
2)最好显式设置一下命名空间,客户端代码:
struct soap *soap = soap_new1(SOAP_ENC_MTOM)
soap_set_namespaces(soap, namespaces) //namespaces定义在.nsmap中,直接调用即可
运行Demo例子时:
1)修改mtom_client.cpp中的服务端URL
2)编译
make cl
make
3)运行
./mtom_client-By gsoap MTOM efficient data transmission protocol for linux operating systems (including embedded linux) By implementing XML and binary data packets transmitted simultaneously through MTOM protocol scenarios than ordinary soap+ base64 way to send data more efficiently.
Commissioning mtom Experience:
The commissioning of a little experience for reference:
1) You can generate code based on attachment yoyo.h file, refer to the following command:
soapcpp2-L-C-I/home/dongruijie/workspace/gsoap-2.8/gsoap/import yoyo.h
2) The best look explicitly set the namespace, the client code:
struct soap* soap = soap_new1 (SOAP_ENC_MTOM)
soap_set_namespaces (soap, namespaces) // namespaces defined in .nsmap, a direct call to
When running Demo examples:
1) Modify the server URL mtom_client.cpp
2) compilation
make cl
make
3)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
mtom_xop/
mtom_xop/Makefile
mtom_xop/YoyoWebServiceSOAP11Binding.nsmap
mtom_xop/YoyoWebServiceSOAP11Binding.yoyoInDeviceStatus.req.xml
mtom_xop/YoyoWebServiceSOAP11Binding.yoyoInDeviceStatus.res.xml
mtom_xop/YoyoWebServiceSOAP11Binding.yoyoInPassCarInfo.req.xml
mtom_xop/YoyoWebServiceSOAP11Binding.yoyoInPassCarInfo.res.xml
mtom_xop/mtom_client
mtom_xop/mtom_client.cpp
mtom_xop/mtom_client.o
mtom_xop/soapC.cpp
mtom_xop/soapC.o
mtom_xop/soapClient.cpp
mtom_xop/soapClient.o
mtom_xop/soapH.h
mtom_xop/soapStub.h
mtom_xop/stdsoap2.c
mtom_xop/stdsoap2.cpp
mtom_xop/stdsoap2.h
mtom_xop/stdsoap2.o
mtom_xop/yoyo.h