commit 99bb3abd3d0f4bfc2702a6056fadefaa5ea4150f Author: xiongcz Date: Fri Jun 6 11:48:03 2025 +0800 first commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..1c956aa --- /dev/null +++ b/README.MD @@ -0,0 +1,454 @@ +# PLM与E10接口 + +物料接口 Action Handler: QF_ERP_wl + +BOM接口 Action Handler: QF_ERP_BOM + +日志位置:`%TEMP%/tc_用户id/QF_ERP_wl_20210525.txt` 和 `%TEMP%/tc_用户id/QF_ERP_BOM_20210525.txt` + +### 参数: + +```text +-bypass: 配置后开启旁路执行 +``` + +### 首选项: + +全部首选项都是多值、站点 + +#### 1. 物料接口 + +> Connor_ERP_wl: +> +> ```text +> 配置host, service, parameter标签信息 +> ``` +> +> Connor_ERP_wl_gi: +> +> ```text +> 配置下的field标签信息 +> ``` +> +> Connor_ERP_wl_pli +> +> ```text +> 配置下的field标签信息 +> ``` + +#### 2. BOM接口 + +> Connor_ERP_BOM: +> +> ```text +> 配置host, service, parameter标签信息 +> ``` +> +> Connor_ERP_BOM_parent: +> +> ```text +> 配置下的field标签信息,导出对象是BOM父行 +> ``` +> +> Connor_ERP_BOM_child +> +> ```text +> 配置下的field标签信息,导出对象是BOM子行 +> ``` +> +> Connor_ERP_BOM_parent_zizhi: +> +> ```text +> 配置下的field标签信息,导出对象是底层自制件 +> ``` +> +> Connor_ERP_BOM_child_zizhi +> +> ```text +> 配置下的field标签信息,导出对象是自制件下的原材料 +> ``` +> + +### 首选项格式: + +首选项格式分两类,一种是host,、service、parameter标签的信息;另一种是field标签的信息 + +#### 1. host、service和parameter配置 + +**相关首选项** + +> Connor_ERP_wl +> +> Connor_ERP_BOM + +**格式** + +```text +首选项共13行 +第1行为调用的webservice地址 +第2行是host标签中prod属性的值 +第3行是host标签中ver属性的值 +第4行是host标签中ip属性的值 +第5行是host标签中lang属性的值 +第6行是host标签中acct属性的值 +第7行是service标签中prod属性的值 +第8行是service标签中name属性的值 +第9行是service标签中ip属性的值 +第10行是key为productName的parameter标签的值 +第11行是key为templateName的parameter标签的值 +第12行是host标签中id属性的值 +第13行是service标签中id属性的值 +``` + +**示例** + +```text +http://192.168.8.115:9999/IntegrationEntry +XThirdParty +1.0 +127.0.0.1 +zh_CN +dcms +E10 +GROUP_ITEM.ImportData +192.168.11.17 +XThirdParty +GROUP_ITEM.I01 +``` + +#### 2. field配置 + +**相关首选项** + +> Connor_ERP_wl_gi +> +> Connor_ERP_wl_pli +> +> Connor_ERP_BOM_parent +> +> Connor_ERP_BOM_child + +**格式** + +```text +总体格式为“ERP字段名称=ERP字段类型=属性提取配置” +写入到xml中后的结果为“属性提取配置获得的值” +``` + +**属性提取配置** + +属性提取配置分为三种类型:固定值,非引用属性,引用属性 + +2.1 固定值 + +```text +格式:直接配置需要填写的值,注意不能包含点“.” +示例:itemcode=string=零组件ID +``` + +2.2 非引用属性 + +``` +格式:属性位置.属性名称 +属性位置:包含bom、item、rev、form,分别对应bom行、对象、版本、版本表单 +特殊属性位置:pbom、prev,对部分BOM子行配置适用,用于提取父项信息,如Connor_ERP_BOM_child、Connor_ERP_BOM_child_zizhi +属性名称:属性真实名称 +示例:ITEM_CODE=string=item.item_id + +工艺属性位置增加:rawitem、rawrev、rawform,分别对应原材料的对象、版本、版本表单 +原材料提取逻辑:获取自制零件的原材料信息;如果工艺的关联(IMAN_METarget) +目标类型为QF8PartRevision且表单属性qf8laiyuan为自制,则获取其QF8SCXXrelation关系下QF8RawMaterialsRevision类型对象的信息 +``` + +2.3 引用属性 + +```text +格式:属性位置.引用属性名称.非引用属性名称 +通过引用属性名称获取到引用的对象,再通过非引用属性名称提取引用对象的属性 +示例:Datasets=string=rev.IMAN_specification.object_name +``` + +**特殊配置** + +2.4 替换通过属性提取配置获取的值 + +```text +在以上配置行的后面添加内容:“:属性值1=替换值1;属性值2=替换值2” +如果需要配置默认值,可以配置“default=默认值”,当属性值获取为空时,将数据替换成默认值 +如果需要把所有值替换,可以配置“*=替换值”,当属性值获取不为空时,将数据进行替换 +``` + +2.5 分割属性值 + +```text +对获取并替换后的值进行分割,在erp字段名称后追加配置 +格式:“erp字段名称@@分割字符@@数据索引”,数据索引从零开始 +示例:“分母@@/@@1=string=item.object_desc”,取对象描述的值用“/”分割后的第二个值 +``` + +2.6 特殊属性名称 + +```text +ICS: (大写)填写当前提取位置的分类id,示例:ERP字段=string=rev.ICS +ICSORTYPE: (大写)填写当前提取位置的分类id,如果未分类则取其类型名称,示例:ERP字段=string=rev.ICSORTYPE +UID: (大写)填写当前提取位置的uid,示例:ERP字段=string=item.UID +``` + +2.7 提取字符串属性的显示值 + +```text +字符串类型的属性默认提取真实值,如果需要提取显示值,在erp字段名称前加“$” +示例:$对象显示类型=string=item.object_type +``` + +2.8 属性拼接配置 + +```text +连续配置的ERP字段名称会被自动拼接 +``` + +**示例** + +```text +$ERP字段=ERP类型=ITEM.object_type +ITEM_CODE=string=item.item_id +ITEM_NAME=string=item.object_name +ITEM_SPECIFICATION=string=form.qf8xhgg +FEATURE_GROUP_CODE=string=rev.ICS +UNIT_CODE=string=form.qf8mrdw +UDF021=string=rev.item_revision_id +DRAWING_NO=string=form.qf8th +UDF022=string=拼接到前面 +UDF022=string=form.qf8ywmc +UDF022=string=拼接到后面 +SHORTCUT=string=form.qf8jbm +UDF023=string=form.qf8cl +LIFECYCLE_CODE=string=form.qf8cpjd +UDF024=string=form.qf8gzjsx +UDF025=string=form.qf8sfbj +UDF026=string=rev.release_status_list.object_string:TCM 已发布=通用 +PLM_DATAKEY=string=rev.UID +分子@@/@@0=string=item.object_desc +分母@@/@@1=string=item.object_desc +``` + + + +# PLM与MES接口 + +接口 Action Handler: QF_ERP_BOP + +日志位置:`%TEMP%/tc_用户id/QF_ERP_BOP_20210525.txt` + +### 参数: + +```text +-bypass: 配置后开启旁路执行 +``` + +### 首选项: + +全部首选项都是多值、站点 + +#### 1. 物料接口 + +> Connor_MES_wl: +> +> ```text +> 配置host, service等标签信息 +> ``` +> +> Connor_MES_wl_data: +> +> ```text +> 配置下的field标签信息 +> ``` + +#### 2. BOP接口 + +> Connor_MES_BOP: +> +> ```text +> 配置host, service等标签信息 +> ``` +> +> Connor_MES_BOP_parent: +> +> ```text +> 配置下的field标签信息,导出对象是BOM父行 +> ``` +> +> Connor_MES_BOP_opstaiton_detail +> +> ```text +> 配置下的field标签信息,导出对象是工序行 +> ``` +> +> Connor_MES_BOP_opresource_detail +> +> ```text +> 配置下的field标签信息,导出对象是工艺资源行 +> ``` +> +> Connor_MES_BOP_opsup_detail +> +> ```text +> 配置下的field标签信息,导出对象是工艺辅料行 +> ``` +> +> Connor_MES_BOP_material_detail +> +> ```text +> 配置下的field标签信息,导出对象是材料行 +> +> 20220304:修改为原材料,只有一个,提取逻辑见属性位置 +> ``` + +#### 3. 文件 + +> 首选项:QF_PLM_MES_FILE +> +> 需要两行数据 +> +> 第一行:传到接口中的地址前缀 +> +> 第二行:本地文件夹路径 +> +> 注意路径后需要添加“\” +> +> 示例: +> +> ```text +> \\192.168.1.106\autocode\ +> C:\autocode\ +> ``` + +### 首选项格式: + +首选项格式分两类,一种是host,、service等标签的信息;另一种是field标签的信息 + +#### 1. host、service配置 + +**相关首选项** + +> Connor_MES_wl +> +> Connor_MES_BOP + +**格式** + +```text +物料首选项共10行,bom首选项共13行 +第1行为调用的webservice地址 +第2行是host标签中prod属性的值 +第3行是host标签中ver属性的值 +第4行是host标签中ip属性的值 +第5行是host标签中id属性的值 +第6行是host标签中acct属性的值 +第7行是service标签中prod属性的值 +第8行是service标签中ip属性的值 +第9行是service标签中id属性的值 +第10行是service标签中name属性的值 + +以下是Connor_MES_wl首选项需要额外添加的配置 + +第11行是name为EntId的datakey标签的值 +第12行是name为CompanyId的datakey标签的值 +第13行是name为item_no的datakey标签的值 +``` + +**示例** + +```text +http://192.168.8.115:9999/IntegrationEntry +OTHER +1.0 +127.0.0.1 +TEST +user01 +MES +192.168.11.17 +sMESPROD +item.create +01 +01 +MO-21030404-4 +``` + +#### 2. field配置 + +**相关首选项** + +> Connor_MES_wl_data +> +> Connor_MES_BOP_opstaiton_detail +> +> Connor_MES_BOP_opresource_detail +> +> Connor_MES_BOP_opsup_detail +> +> Connor_MES_BOP_material_detail + +**格式** + +```text +总体格式为“ERP字段名称=ERP字段类型=属性提取配置” +写入到xml中后的结果为“属性提取配置获得的值” +``` + +**属性提取配置** + +属性提取配置分为三种类型:固定值,非引用属性,引用属性 + +2.1 固定值 + +```text +格式:直接配置需要填写的值,注意不能包含点“.” +示例:itemcode=string=零组件ID +``` + +2.2 非引用属性 + +``` +格式:属性位置.属性名称 +属性位置:包含bom、item、rev、form,分别对应bom行、对象、版本、版本表单 +属性名称:属性真实名称 +示例:ITEM_CODE=string=item.item_id +``` + +2.3 引用属性 + +```text +格式:属性位置.引用属性名称.非引用属性名称通过引用属性名称获取到引用的对象,再通过非引用属性名称提取引用对象的属性示例:Datasets=string=rev.IMAN_specification.object_name +``` + +**特殊配置** + +2.4 替换通过属性提取配置获取的值 + +```text +在以上配置行的后面添加内容:“:属性值1=替换值1;属性值2=替换值2”如果需要配置默认值,可以配置“default=默认值”,当属性值获取为空时,将数据替换成默认值如果需要把所有值替换,可以配置“*=替换值”,当属性值获取不为空时,将数据进行替换 +``` + +2.5 分割属性值 + +```text +对获取并替换后的值进行分割,在erp字段名称后追加配置格式:“erp字段名称@@分割字符@@数据索引”,数据索引从零开始示例:“分母@@/@@1=string=item.object_desc”,取对象描述的值用“/”分割后的第二个值 +``` + +2.6 特殊属性名称 + +```text +ICS: (大写)填写当前提取位置的分类id,示例:ERP字段=string=rev.ICSUID: (大写)填写当前提取位置的uid,示例:ERP字段=string=item.UID +ICSNAME:(大写)填写当前提取位置的分类名称 +GCBH:(大写)从当前提取位置的IMAN_MEWorkArea关系查找工厂编号 +本站工艺和下站工艺在代码中处理,但仍需要进行配置 +GWBM:(大写)从当前提取位置的子行查找工位编码,即需要配置为 ERP字段名称=string=bom.GWBM +GWMC:(大写)从当前提取位置的子行查找工位名称,即需要配置为 ERP字段名称=string=bom.GWMC +``` + +2.7 提取字符串属性的显示值 + +```text +字符串类型的属性默认提取真实值,如果需要提取显示值,在erp字段名称前加“$”示例:$对象显示类型=string=item.object_type +``` \ No newline at end of file diff --git a/connor_erp_mes.sln b/connor_erp_mes.sln new file mode 100644 index 0000000..02af0e4 --- /dev/null +++ b/connor_erp_mes.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30804.86 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "connor_erp_mes", "connor_erp_mes\connor_erp_mes.vcxproj", "{FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Debug|x64.ActiveCfg = Release|x64 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Debug|x64.Build.0 = Release|x64 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Debug|x86.ActiveCfg = Release|x64 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Debug|x86.Build.0 = Release|x64 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Release|x64.ActiveCfg = Release|x64 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Release|x64.Build.0 = Release|x64 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Release|x86.ActiveCfg = Release|Win32 + {FDAD31DA-C4B8-4B1E-AB61-4F2F37E068CF}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {175C518A-4D6B-4BE4-A07D-F7B6FF607A66} + EndGlobalSection +EndGlobal diff --git a/connor_erp_mes/IntegrationEntrySoapBinding.nsmap b/connor_erp_mes/IntegrationEntrySoapBinding.nsmap new file mode 100644 index 0000000..7a1035f --- /dev/null +++ b/connor_erp_mes/IntegrationEntrySoapBinding.nsmap @@ -0,0 +1,11 @@ + +#include "stdsoap2.h" +/* This defines the global XML namespaces[] table to #include and compile */ +SOAP_NMAC struct Namespace namespaces[] = { + { "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL }, + { "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL }, + { "xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL }, + { "xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL }, + { "WS1", "http://entry.serviceengine.cross.digiwin.com", NULL, NULL }, + { NULL, NULL, NULL, NULL} + }; diff --git a/connor_erp_mes/QF_Delete_TCM.cpp b/connor_erp_mes/QF_Delete_TCM.cpp new file mode 100644 index 0000000..b4b5b2f --- /dev/null +++ b/connor_erp_mes/QF_Delete_TCM.cpp @@ -0,0 +1,46 @@ +#include "connor_erp_mes.h" +#include +#include + +int QF_Delete_TCM(EPM_action_message_t msg) { + ResultStatus s; + int ifail = ITK_ok, attachment_cnt = 0; + tag_t root_task = NULLTAG, * attachment_tags = NULL; + char* object_string = NULL, * object_type = NULL; + if (msg.task == NULLTAG) { + goto end; + } + printf("QF_Delete_TCM\n"); + try { + set_bypass(true); + s = EPM_ask_root_task(msg.task, &root_task); + s = EPM_ask_attachments(root_task, EPM_target_attachment, &attachment_cnt, &attachment_tags); + printf("Target Count: %d\n", attachment_cnt); + for (int i = 0; i < attachment_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t target = attachment_tags[i]; + int releaseFlag = 0; + s = AOM_ask_value_string(target, "object_string", &object_string); + s = WSOM_ask_object_type2(target, &object_type); + s = EPM_ask_if_released(target, &releaseFlag); + printf("%d. %s [%s] > %d\n", i + 1, object_string, object_type, releaseFlag); + if (releaseFlag == 1) { + printf(">> Remove\n"); + s = EPM_remove_attachments(root_task, 1, &target); + } + } + } + catch (const IFail& ex) { + ifail = ex.ifail(); + cout << ex.getMessage() << endl; + cout << "error " << ex.ifail() << endl; + } +end: + DOFREE(object_string); + DOFREE(object_type); + DOFREE(attachment_tags); + set_bypass(false); + printf("Finish [%d]\n", ifail); + return ifail; +} \ No newline at end of file diff --git a/connor_erp_mes/QF_ERP_wl.cpp b/connor_erp_mes/QF_ERP_wl.cpp new file mode 100644 index 0000000..7a06d16 --- /dev/null +++ b/connor_erp_mes/QF_ERP_wl.cpp @@ -0,0 +1,4203 @@ +#pragma warning (disable: 4996) +/** +=============================================================================== +Copyright (c) 2012-2024 CONNOR Ltd. +Unpublished - All Rights Reserved +=============================================================================== +File description: + + +Ҫܣ + +=============================================================================== +DATE Name Description of Change + +2024-01-16 Ȫ modify ܹʱֶΣ޸Ĵݲֿ߼޸IJȡֵ + +=============================================================================== +*/ +#include "connor_erp_mes.h" +#include "tinyxml.h" +#include "tinystr.h" +#include "ics/ics.h" +#include "libxl.h" +#include +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +#include + +#define ITK_err 919031 +#define TYPE_REV "ItemRevision" + +#define PREF_ERP_WL "Connor_ERP_wl" +#define PREF_ERP_WL_GI "Connor_ERP_wl_gi" +#define PREF_ERP_WL_PLI "Connor_ERP_wl_pli" + +#define PREF_ERP_BOM "Connor_ERP_BOM" +#define PREF_ERP_BOM_PARENT "Connor_ERP_BOM_parent" +#define PREF_ERP_BOM_CHILD "Connor_ERP_BOM_child" +#define PREF_ERP_BOM_PARENT_ZZ "Connor_ERP_BOM_parent_zizhi" +#define PREF_ERP_BOM_CHILD_ZZ "Connor_ERP_BOM_child_zizhi" + +#define PREF_MES_WL "Connor_MES_wl" +#define PREF_MES_WL_DATA "Connor_MES_wl_data" + +#define PREF_MES_BOM "Connor_MES_BOP" +#define PREF_MES_BOM_PARENT "Connor_MES_BOP_parent" +#define PREF_MES_BOM_CHILD1 "Connor_MES_BOP_opstaiton_detail" +#define PREF_MES_BOM_CHILD2 "Connor_MES_BOP_opresource_detail" +#define PREF_MES_BOM_CHILD3 "Connor_MES_BOP_opsup_detail" +#define PREF_MES_BOM_CHILD4 "Connor_MES_BOP_material_detail" +#define IMAN_MASTER_FORM_REV "IMAN_master_form_rev" +#define IMAN_SPECIFICATION "IMAN_specification" +#define PDF_REFERENCE "PDF_Reference" +#define JTPART "JTPART" +#define MESTATIONREVISION "MEStationRevision" +#define OBJECT_NAME "object_name" +#define BL_REVISION "bl_revision" +#define QF8SFWW "QF8sfww" +#define ITEM_ID "item_id" +#define QF8CLYL "qf8clyl" +#define QF8GXBM "qf8gxbm" +#define QF8LAIYUAN "qf8laiyuan" +#define ZIZHI "" +#define XUSHE "" +#define CK1001 "1001" +#define CK1002 "1002" +#define CK1003 "1003" +#define WAIGOU "⹺" +#define QF8JGGS "qf8jggs" +#define QF8ZBGS "qf8zbgs" +#define QF8ZGS "qf8zgs" +#define OBJECT_TYPE "object_type" +#define BL_LINE_OBJECT "bl_line_object" +#define STRUCTURE_REVISIONS "structure_revisions" +#define QF8GXREVISION "QF8gxRevision" +#define QF8GYREVISION "QF8gyRevision" + +#define QF8BOPRELATION "QF8BOPrelation" +#define STANDARD_MACHINE_HOUR "STANDARD_MACHINE_HOUR" +#define FIXED_LEAD_TIME_M "FIXED_LEAD_TIME_M" +#define INBOUND_WAREHOUSE_CODE "INBOUND_WAREHOUSE_CODE" +#define OUTBOUND_WAREHOUSE_CODE "OUTBOUND_WAREHOUSE_CODE" + +#define PREF_FTP_PATH "QF_PLM_MES_FILE" +#include +#include "crossStub.h" +#include "IntegrationEntrySoapBinding.nsmap" +#include "plugin.h" +#include "md5.h" +#include "crossH.h" + +#include +#include +#include +#include + +using namespace libxl; +string ftp_dir; +string local_dir; + +string str2md5(string str) { + return MD5(str).toStr(); +} + + +typedef struct { + bool isDisplayValue; + string type; + string erp; + //string child_line_type; + string prop_loc; + string prop_name; + string sub_prop_name; + string text_value; + string splitter; + int split_index; + map replace_map; +} ERP_Config; + +int get_child_line(tag_t pline, string cline_types, vector& cline) { + int ifail = ITK_ok, child_cnt = 0; + tag_t* child_lines = NULL; + bool is_exclude = false; + vector types; + char* object_type = NULL, * object_string = NULL; + if (cline_types.find('!') == 0) { + is_exclude = true; + Split(cline_types.substr(1), ";", types); + } + else { + Split(cline_types, ";", types); + } + if (types.size() == 0 || pline == NULLTAG) { + goto end; + } + ITKCALL(ifail = BOM_line_ask_child_lines(pline, &child_cnt, &child_lines)); + ITKCALL(ifail = AOM_ask_value_string(pline, "object_string", &object_string)); + //WriteLog(debug, "ȡ[%d]%s [%s]",child_cnt, object_string, cline_types.c_str()); + if (child_cnt == 0) { + goto end; + } + for (int i = 0; i < child_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t cline_tag = child_lines[i], citem_tag = NULLTAG; + ITKCALL(ifail = AOM_ask_value_tag(cline_tag, "bl_item", &citem_tag)); + if (ifail != ITK_ok) { + continue; + } + ITKCALL(ifail = AOM_ask_value_string(citem_tag, "object_string", &object_string)); + ITKCALL(ifail = WSOM_ask_object_type2(citem_tag, &object_type)); + //WriteLog(debug, "%d. %s [%s]", i+1, object_string, object_type); + if (inArray(types, object_type)) { + if (!is_exclude) { + cline.push_back(cline_tag); + } + } + else { + if (is_exclude) { + cline.push_back(cline_tag); + } + } + } + //WriteLog(debug, "ȡ"); +end: + DOFREE(object_string); + DOFREE(object_type); + DOFREE(child_lines); + return ifail; +} +int set_xml_value(TiXmlElement* node, const char* value) { + TiXmlText* txt = new TiXmlText(G2U(value)); + node->LinkEndChild(txt); + return ITK_ok; +} + +/* +*ȡǰʱ +*/ +void get_current_time(char *date_time) +{ + time_t the_time; + struct tm *time_ptr; + char *time_format = "%Y-%m-%d-%H-%M-%S"; + + the_time = time((time_t *)0); + time_ptr = localtime(&the_time); + strftime(date_time, 128, time_format, time_ptr); +} +void WcharToString(string& szDst, const wchar_t* wchar) +{ + DWORD dwNum = WideCharToMultiByte(CP_OEMCP, NULL, wchar, -1, NULL, 0, NULL, FALSE); + char* psText; + psText = new char[dwNum]; + WideCharToMultiByte(CP_OEMCP, NULL, wchar, -1, psText, dwNum, NULL, FALSE); + szDst = psText; + delete[]psText; +} +//Ҫʹwchar_t*delete[]ͷڴ +wchar_t* StringToWchar(const string& pKey) +{ + const char* pCStrKey = pKey.c_str(); + //һε÷תַȣȷΪwchar_t*ٶڴռ + int pSize = MultiByteToWideChar(CP_OEMCP, 0, pCStrKey, strlen(pCStrKey) + 1, NULL, 0); + wchar_t* pWCStrKey = new wchar_t[pSize]; + //ڶεýַֽת˫ַֽ + MultiByteToWideChar(CP_OEMCP, 0, pCStrKey, strlen(pCStrKey) + 1, pWCStrKey, pSize); + return pWCStrKey; +} +/* +*ȡexcel +*/ +void readExcel(TiXmlElement* qcitem_detail, int &seqNum, tag_t excelTag, string ext) { + cout << "ʼȡexcel" << endl; + char current_date_time_str[128 + 1] = { "\0" }; + get_current_time(current_date_time_str); + string time_now = current_date_time_str; + int ifail = 0; + //ȡϵͳtempĿ¼ + char *temp_dir = getenv("temp");//û· + char output_file_pdf1_temp[SS_MAXPATHLEN] = ""; + strcpy(output_file_pdf1_temp, temp_dir); + strcat(output_file_pdf1_temp, "\\jyxxb"); + strcat(output_file_pdf1_temp, time_now.c_str()); + strcat(output_file_pdf1_temp, ".xlsx"); + //cout << "ļ·----------" << time_now << endl; + if (access(output_file_pdf1_temp, 0) == 0) {// + + remove(output_file_pdf1_temp); + } + ifail = AE_export_named_ref(excelTag, "excel", output_file_pdf1_temp); + wstringstream excel_path; + // excel_path<<"C:\\TEMP\\export_text.xls"; + cout << "ʼȡ" << endl; + excel_path << output_file_pdf1_temp; + cout << "ʼȡ2" << endl; + Sheet* sheet0 = NULL;//Դ + Sheet* sheet = NULL;//ڶյϢ + Book* book = nullptr; + if (strcmp(ext.c_str(), "xlsx") == 0) + { + book = xlCreateXMLBook(); + } + book->setKey(L"Halil Kural", L"windows-2723210a07c4e90162b26966a8jcdboe");//˸ÿ⣬Ӧkeyûй + if (book->load(excel_path.str().c_str())) + { + sheet0 = book->getSheet(0);//õ1sheetҳ + sheet = book->getSheet(1);//õ2sheetҳ + int firstRow = sheet->firstRow(); + int lastRow = sheet->lastRow(); + int firstCol = sheet->firstCol(); + int lastCol = sheet->lastCol(); + map ChecktypeMap;//żĿƺͼmap + map Qcitem_noMap;//żĿƺͼĿŵmap + if (sheet) + { + + cout << "ʼȡοҳ" << endl; + cout <<"firstRow"<< firstRow << endl; + cout <<"lastRow"<< lastRow << endl; + cout <<"firstCol"<< firstCol << endl; + cout <<"lastCol"<< lastCol<< endl; + for (int row = 2; row < lastRow; row++) + { + string Qcitem_name = "";//A+B Ŀ + string Checktype = "";//E + string Qcitem_no = "";//D Ŀ + for (int c = firstCol; c < lastCol; c++) + { + if (c != 1 && c != 2 && c != 4 && c != 5) { + continue; + } + double db = 0; + const wchar_t* wstr ; + CellType t = sheet->cellType(row, c); + string value = ""; + switch (t) + { + case libxl::CELLTYPE_EMPTY: + break; + case libxl::CELLTYPE_NUMBER: + db = sheet->readNum(row, c); + break; + case libxl::CELLTYPE_STRING: + wstr = sheet->readStr(row, c); + if (wstr != NULL) { + WcharToString(value, wstr); + + std::cout << value << "\n"; + + if (c == 1 || c == 2) { + Qcitem_name = Qcitem_name + value; + } + else if (c == 4) { + Qcitem_no = value; + } + else if (c == 5) { + Checktype = value; + } + + } + break; + /* case libxl::CELLTYPE_BOOLEAN: + string s2 = ""; + break; + case libxl::CELLTYPE_BLANK: + + string s3 = ""; + break; + case libxl::CELLTYPE_ERROR: + + string s4 = ""; + break;*/ + default: + break; + } + } + // + if (tc_strcmp(Qcitem_name.c_str(),"")==0) { + continue; + } + ChecktypeMap[Qcitem_name] = Checktype; + Qcitem_noMap[Qcitem_name] = Qcitem_no; + } + } + if (sheet0) { + cout << "ʼȡҳ" << endl; + firstRow = sheet0->firstRow(); + lastRow = sheet0->lastRow(); + firstCol = sheet0->firstCol(); + lastCol = sheet0->lastCol(); + for (int row = 3; row < lastRow; row++) + { + string seq = "";//A + string category = "";//C + string type = "";//D + string Standard_value = "";//E + string max_value = "";//1F + string min_value = "";//2G + string QcDescription = "";//3H + for (int c = firstCol; c < lastCol; c++) + { + if (c == 1) { + continue; + } + if (c > 7) { + break; + } + + double db = 0; + const wchar_t* wstr ; + char* s = NULL; + CellType t = sheet0->cellType(row, c); + string value = ""; + switch (t) + { + case libxl::CELLTYPE_EMPTY: + break; + case libxl::CELLTYPE_NUMBER: + db = sheet0->readNum(row, c); + std::cout << db << "\n"; + char str[20]; + + sprintf(str, "%f", db); // ʹ%fռλdoubleת + if (c == 0) { + seq = str; + } + else if (c == 2) { + category = str; + } + else if (c == 3) { + type = str; + } + else if (c == 4) { + Standard_value = str; + } + else if (c == 5) { + max_value = str; + } + else if (c == 6) { + min_value = str; + } + else if (c == 7) { + QcDescription = str; + } + + break; + case libxl::CELLTYPE_STRING: + wstr = sheet0->readStr(row, c); + if (wstr != NULL) { + WcharToString(value, wstr); + std::cout << value << "\n"; + } + if (c == 0) { + seq = value; + } + else if (c == 2) { + category = value; + } + else if (c == 3) { + type = value; + } + else if (c == 4) { + Standard_value = value; + } + else if (c == 5) { + max_value = value; + } + else if (c == 6) { + min_value = value; + } + else if (c == 7) { + QcDescription = value; + } + break; + /* case libxl::CELLTYPE_BOOLEAN: + break; + case libxl::CELLTYPE_BLANK: + break; + case libxl::CELLTYPE_ERROR: + break;*/ + default: + break; + } + } + cout << "seq" <SetAttribute("seq", seqNum); + qcitem_detail->LinkEndChild(childGxRow); + TiXmlElement* seqField = new TiXmlElement("field"); + seqField->SetAttribute("name", "seq"); + seqField->SetAttribute("type", "string"); + set_xml_value(seqField, numStr); + childGxRow->LinkEndChild(seqField); + TiXmlElement* Qcitem_noField = new TiXmlElement("field"); + Qcitem_noField->SetAttribute("name", "Qcitem_no"); + Qcitem_noField->SetAttribute("type", "string"); + set_xml_value(Qcitem_noField, Qcitem_no.c_str()); + childGxRow->LinkEndChild(Qcitem_noField); + TiXmlElement* Qcitem_nameField = new TiXmlElement("field"); + Qcitem_nameField->SetAttribute("name", "Qcitem_name"); + Qcitem_nameField->SetAttribute("type", "string"); + set_xml_value(Qcitem_nameField, Qcitem_name.c_str()); + childGxRow->LinkEndChild(Qcitem_nameField); + TiXmlElement* ChecktypeField = new TiXmlElement("field"); + ChecktypeField->SetAttribute("name", "Checktype"); + ChecktypeField->SetAttribute("type", "numeric"); + set_xml_value(ChecktypeField, Checktype.c_str()); + childGxRow->LinkEndChild(ChecktypeField); + TiXmlElement* Standard_valueField = new TiXmlElement("field"); + Standard_valueField->SetAttribute("name", "Standard_value"); + Standard_valueField->SetAttribute("type", "string"); + set_xml_value(Standard_valueField, Standard_value.c_str()); + childGxRow->LinkEndChild(Standard_valueField); + TiXmlElement* max_valueField = new TiXmlElement("field"); + max_valueField->SetAttribute("name", "max_value"); + max_valueField->SetAttribute("type", "string"); + set_xml_value(max_valueField, max_value.c_str()); + childGxRow->LinkEndChild(max_valueField); + TiXmlElement* min_valueField = new TiXmlElement("field"); + min_valueField->SetAttribute("name", "min_value"); + min_valueField->SetAttribute("type", "string"); + set_xml_value(min_valueField, min_value.c_str()); + childGxRow->LinkEndChild(min_valueField); + TiXmlElement* QcDescriptionField = new TiXmlElement("field"); + QcDescriptionField->SetAttribute("name", "QcDescription"); + QcDescriptionField->SetAttribute("type", "string"); + set_xml_value(QcDescriptionField, QcDescription.c_str()); + childGxRow->LinkEndChild(QcDescriptionField); + } + + } + } + book->release();//ͷŶ󣡣 + cout << "رexcel" <> WorkArea: %s [%s]", object_string, object_type); + if (strcmp("MEPlant", object_type) == 0) { + //if (strcmp("QF8gc", object_type) == 0) { + tag_t rev_tag = NULLTAG; + int form_cnt = 0; + tag_t* form_tags = NULL; + ITKCALL(ifail = ITEM_ask_latest_rev(child_tag, &rev_tag)); + if (rev_tag == NULLTAG) { + WriteLog(debug, ">> No Latest Rev"); + continue; + } + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &form_cnt, &form_tags)); + if (form_cnt > 0) { + char* value = NULL; + tag_t form_tag = form_tags[0]; + ITKCALL(ifail = AOM_ask_value_string(form_tag, "qf8gcbh", &value)); + if (ifail == ITK_ok) { + WriteLog(debug, "qf8gcbh = [%s]", value); + if (addSp) { + propValue.append(";"); + } + else { + addSp = true; + } + propValue.append(value); + } + DOFREE(value); + } + DOFREE(form_tags); + }else if (strcmp("MEPlantRevision", object_type) == 0) { + //if (strcmp("QF8gc", object_type) == 0) { + tag_t rev_tag = child_tag; + int form_cnt = 0; + tag_t* form_tags = NULL; + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &form_cnt, &form_tags)); + if (form_cnt > 0) { + char* value = NULL; + tag_t form_tag = form_tags[0]; + ITKCALL(ifail = AOM_ask_value_string(form_tag, "qf8gcbh", &value)); + if (ifail == ITK_ok) { + WriteLog(debug, "qf8gcbh = [%s]", value); + if (addSp) { + propValue.append(";"); + } + else { + addSp = true; + } + propValue.append(value); + } + DOFREE(value); + } + DOFREE(form_tags); + } + } + DOFREE(object_string); + DOFREE(object_type); + DOFREE(child_tags); + } + else if (strcmp("GWBM", propName) == 0) { // λ + int child_cnt = 0; + char* object_type = NULL, * object_string = NULL; + bool addSp = false; + vector targetline_tags; + get_child_line(objectTag, "MEStation", targetline_tags); + child_cnt = targetline_tags.size(); + ITKCALL(ifail = AOM_ask_value_string(objectTag, "object_string", &object_string)); + WriteLog(debug, "Check MEStation: %s [%d]", object_string, child_cnt); + for (int i = 0; i < child_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t child_line_tag = targetline_tags[i]; + tag_t rev_tag = NULLTAG; + int form_cnt = 0; + tag_t* form_tags = NULL; + ITKCALL(ifail = AOM_ask_value_string(child_line_tag, "object_string", &object_string)); + WriteLog(debug, ">> MEStation: %s", object_string); + ITKCALL(ifail = AOM_ask_value_tag(child_line_tag, "bl_revision", &rev_tag)); + if (rev_tag == NULLTAG) { + WriteLog(debug, ">> revision not found"); + continue; + } + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &form_cnt, &form_tags)); + if (form_cnt > 0) { + char* value = NULL; + tag_t form_tag = form_tags[0]; + ITKCALL(ifail = AOM_ask_value_string(form_tag, "qf8gwbm", &value)); + if (ifail == ITK_ok) { + WriteLog(debug, "qf8gwbm = [%s]", value); + if (addSp) { + propValue.append(";"); + } + else { + addSp = true; + } + propValue.append(value); + } + DOFREE(value); + } + DOFREE(form_tags); + } + DOFREE(object_string); + DOFREE(object_type); + targetline_tags.clear(); + } + else if (strcmp("GWID", propName) == 0) { // λID + int child_cnt = 0; + char* object_type = NULL, * object_string = NULL; + bool addSp = false; + vector targetline_tags; + get_child_line(objectTag, "MEStation", targetline_tags); + child_cnt = targetline_tags.size(); + ITKCALL(ifail = AOM_ask_value_string(objectTag, "object_string", &object_string)); + WriteLog(debug, "Check MEStation: %s [%d]", object_string, child_cnt); + for (int i = 0; i < child_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t child_line_tag = targetline_tags[i]; + tag_t item_tag = NULLTAG; + char* item_id = NULL; + ITKCALL(ifail = AOM_ask_value_string(child_line_tag, "object_string", &object_string)); + WriteLog(debug, ">> MEStation: %s", object_string); + ITKCALL(ifail = AOM_ask_value_tag(child_line_tag, "bl_item", &item_tag)); + if (item_tag == NULLTAG) { + WriteLog(debug, ">> item not found"); + continue; + } + ITKCALL(ifail = AOM_ask_value_string(item_tag, "item_id", &item_id)); + if (ifail == ITK_ok) { + WriteLog(debug, "object_name = [%s]", item_id); + if (addSp) { + propValue.append(";"); + } + else { + addSp = true; + } + propValue.append(item_id); + } + DOFREE(item_id); + } + DOFREE(object_string); + DOFREE(object_type); + targetline_tags.clear(); + } + else if (strcmp("GWMC", propName) == 0) { // λ + int child_cnt = 0; + char* object_type = NULL, * object_string = NULL; + bool addSp = false; + vector targetline_tags; + get_child_line(objectTag, "MEStation", targetline_tags); + child_cnt = targetline_tags.size(); + ITKCALL(ifail = AOM_ask_value_string(objectTag, "object_string", &object_string)); + WriteLog(debug, "Check MEStation: %s [%d]", object_string, child_cnt); + for (int i = 0; i < child_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t child_line_tag = targetline_tags[i]; + tag_t item_tag = NULLTAG; + char* object_name = NULL; + ITKCALL(ifail = AOM_ask_value_string(child_line_tag, "object_string", &object_string)); + WriteLog(debug, ">> MEStation: %s", object_string); + ITKCALL(ifail = AOM_ask_value_tag(child_line_tag, "bl_item", &item_tag)); + if (item_tag == NULLTAG) { + WriteLog(debug, ">> item not found"); + continue; + } + ITKCALL(ifail = AOM_ask_value_string(item_tag, "object_name", &object_name)); + if (ifail == ITK_ok) { + WriteLog(debug, "object_name = [%s]", object_name); + if (addSp) { + propValue.append(";"); + } + else { + addSp = true; + } + propValue.append(object_name); + } + DOFREE(object_name); + } + DOFREE(object_string); + DOFREE(object_type); + targetline_tags.clear(); + } + else { + ITKCALL(ifail = AOM_ask_value_type(objectTag, propName, &propertyType, &propertyTypeName)); + if (ifail != ITK_ok) { + return ifail; + } + switch (propertyType) { + case PROP_string: + if (isDisplayValue) { + ITKCALL(ifail = AOM_UIF_ask_value(objectTag, propName, &cValue)); + } + else { + ITKCALL(ifail = AOM_ask_value_string(objectTag, propName, &cValue)); + } + propValue.append(cValue); + break; + case PROP_date: + date_t date_value; + ITKCALL(ifail = AOM_ask_value_date(objectTag, propName, &date_value)); + ITKCALL(ifail = DATE_date_to_string(date_value, "%Y%m%d%H%M%S000", &cValue)); + propValue.append(cValue); + break; + case PROP_typed_reference://last_mod_user + case PROP_typed_relation: + case PROP_untyped_relation: + case PROP_untyped_reference: + { + int attCnt = 0; + tag_t* attTags = NULL; + const char* subPropNameC = subPropName.size() <= 0 ? "object_string" : subPropName.c_str(); + WriteLog(debug, "ԣ%s-%s", propName, subPropNameC); + ITKCALL(ifail = AOM_ask_value_tags(objectTag, propName, &attCnt, &attTags)); + for (int i = 0; i < attCnt; i++) { + string subPropValue; + ifail = getPropertyStringValue(attTags[i], subPropNameC, "", subPropValue, isDisplayValue, splitter, -1); + if (ifail != ITK_ok) { + goto end; + } + if (subPropValue.size() > 0) { + if (propValue.size() > 0) { + propValue.append(";"); + } + propValue.append(subPropValue); + } + } + DOFREE(attTags); + } + break; + default: + ITKCALL(ifail = AOM_UIF_ask_value(objectTag, propName, &cValue)); + propValue.append(cValue); + break; + } + } + if (splitter.size() > 0 && split_index >= 0 && propValue.size() > 0) { + vector vec; + Split(propValue, splitter, vec); + if (split_index < vec.size()) { + propValue.assign(vec[split_index]); + } + else { + propValue.assign(""); + } + vec.clear(); + } +end: + DOFREE(propertyTypeName); + return ifail; +} + +int getAllTargetRevs(tag_t task_tag, vector &target_tags, vector &target_types) { + int ifail = ITK_ok, att_cnt = 0; + tag_t rootTask_tag = NULLTAG, rev_type=NULLTAG; + tag_t* attachments = NULL; + char* objectstring = NULL, *objecttype=NULL; + ITKCALL(ifail = TCTYPE_ask_type(TYPE_REV, &rev_type)); + if (rev_type == NULLTAG) { + EMH_store_error_s2(EMH_severity_error, ITK_err, ("δҵ汾"), TYPE_REV); + return ITK_err; + } + ITKCALL(ifail = EPM_ask_root_task(task_tag, &rootTask_tag)); + ITKCALL(ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments)); + if (att_cnt == 0) { + return ITK_ok; + } + for (int i = 0; i < att_cnt; i++) { + tag_t attachment = attachments[i]; + tag_t type = NULLTAG; + bool isForm = false; + DOFREE(objectstring); + DOFREE(objecttype); + ITKCALL(ifail = TCTYPE_ask_object_type(attachment, &type)); + ITKCALL(ifail = AOM_ask_value_string(attachment, "object_string", &objectstring)); + if (ifail != ITK_ok) { + continue; + } + ITKCALL(ifail = WSOM_ask_object_type2(attachment, &objecttype)); + WriteLog(debug, "%d. ݶ %s [%s]", i + 1, objectstring, objecttype); + ITKCALL(ifail = TCTYPE_is_type_of(type, rev_type, &isForm)); + if (!isForm) { + WriteLog(debug, ">> ǰ汾"); + continue; + } + if (target_types.size() > 0) { + if (!inArray(target_types, objecttype)) { + WriteLog(debug, ">> Ŀ"); + continue; + } + } + target_tags.push_back(attachment); + } + DOFREE(attachments); + DOFREE(objecttype); + DOFREE(objectstring); + return ifail; +} + +int parseErpConfigs(vector pref_values, int start_index, vector &erp_configs) { + for (int i = start_index; i < pref_values.size(); i++) { + string prop_config; + vector replace_configs; + string type; + string erp; + string child_line_type; + string prop_loc; + string prop_name; + string sub_prop_name; + string text_value; + string splitter; + int split_index = -1; + bool isDisplay = false; + prop_config.assign(pref_values[i]); + map replace_map; + int ind = prop_config.find_first_of(':'); + if (ind != string::npos) { + Split(prop_config.substr(ind + 1), ";", replace_configs); + prop_config = prop_config.substr(0, ind); + } + ind = prop_config.find('='); + if (ind != string::npos) { + erp = prop_config.substr(0, ind); + prop_config = prop_config.substr(ind + 1); + } + ind = prop_config.find('='); + if (ind != string::npos) { + type = prop_config.substr(0, ind); + prop_config = prop_config.substr(ind + 1); + } + ind = prop_config.find('='); + if (ind != string::npos) { + child_line_type = prop_config.substr(0, ind); + prop_config = prop_config.substr(ind + 1); + } + ind = prop_config.find_first_of('.'); + if (ind != string::npos) { + prop_loc = prop_config.substr(0, ind); + prop_name = prop_config.substr(ind+1); + transform(prop_loc.begin(), prop_loc.end(), prop_loc.begin(), ::toupper); + } + else { + text_value = prop_config; + } + ind = prop_name.find_first_of('.'); + if (ind != string::npos) { + sub_prop_name = prop_name.substr(ind+1); + prop_name = prop_name.substr(0, ind); + } + if (erp.size()>0&&strcmp("$", erp.substr(0, 1).c_str()) == 0) { + isDisplay = true; + erp = erp.substr(1); + } + ind = erp.find("@@"); + if (ind != string::npos) { + string split_config = erp.substr(ind+2); + erp = erp.substr(0, ind); + ind = split_config.find("@@"); + if (ind != string::npos) { + splitter = split_config.substr(0, ind); + split_index = atoi(split_config.substr(ind+2).c_str()); + } + } + if (erp.size() == 0) { + WriteLog(debug, "Чã%s", pref_values[i].c_str()); + continue; + } + for (int j = 0; j < replace_configs.size(); j++) { + string replace_config = replace_configs[j]; + ind = replace_config.find_first_of('='); + if (ind == string::npos) { + WriteLog(debug, "Ч滻ã%s", replace_config.c_str()); + continue; + } + string replace_from = replace_config.substr(0, ind); + string replace_to = replace_config.substr(ind + 1); + if (replace_map.count(replace_from) > 0) { + WriteLog(debug, "ظ滻ã%s", replace_config.c_str()); + continue; + } + replace_map.insert(make_pair(replace_from, replace_to)); + } + ERP_Config erp_config; + erp_config.isDisplayValue = isDisplay; + erp_config.type = type; + erp_config.erp = erp; + // erp_config.child_line_type = child_line_type; + erp_config.prop_loc = prop_loc; + erp_config.prop_name = prop_name; + erp_config.sub_prop_name = sub_prop_name; + erp_config.text_value = text_value; + erp_config.replace_map = replace_map; + erp_config.splitter = splitter; + erp_config.split_index = split_index; + erp_configs.push_back(erp_config); + } + return ITK_ok; +} + + + +int read_data(tag_t bomline_tag, tag_t rev_tag, tag_t parent_bomline_tag, tag_t parent_rev_tag, vector erp_configs, TiXmlElement* p) { + int ifail = ITK_ok, att_cnt = 0; + tag_t item_tag = NULLTAG, form_tag = NULLTAG, * form_tags = NULL; + string combined_prop_value; + if (rev_tag == NULLTAG) { + if (bomline_tag != NULLTAG) { + ITKCALL(ifail = AOM_ask_value_tag(bomline_tag, "bl_revision", &rev_tag)); + } + } + if (parent_rev_tag == NULLTAG) { + if (parent_bomline_tag != NULLTAG) { + ITKCALL(ifail = AOM_ask_value_tag(parent_bomline_tag, "bl_revision", &parent_rev_tag)); + } + } + if (rev_tag == NULLTAG || erp_configs.size() == 0) { + return ifail; + } + ITKCALL(ITEM_ask_item_of_rev(rev_tag, &item_tag)); + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &att_cnt, &form_tags)); + if (att_cnt > 0) { + form_tag = form_tags[0]; + DOFREE(form_tags); + } + for (int i = 0; i < erp_configs.size(); i++) { + ERP_Config config = erp_configs[i]; + string prop_value; + bool combine = false; + if (i < erp_configs.size()-1) { + combine = config.erp == erp_configs[i + 1].erp; + } + if (config.prop_loc.size() == 0) { + prop_value = config.text_value; + } + else { + if (tc_strcmp("ITEM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(item_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("REV", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(rev_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("FORM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(form_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("BOM", config.prop_loc.c_str()) == 0) { + if (bomline_tag == NULLTAG) { + continue; + } + ifail = getPropertyStringValue(bomline_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + // 2Connor_ERP_BOM_childConnor_ERP_BOM_child_zizhiѡÿԻȡBOMϢID + else if (tc_strcmp("PREV", config.prop_loc.c_str()) == 0) { + if (parent_rev_tag == NULLTAG) { + continue; + } + ifail = getPropertyStringValue(parent_rev_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("PBOM", config.prop_loc.c_str()) == 0) { + tag_t parent_bomline = NULLTAG; + if (parent_bomline_tag == NULLTAG) { + continue; + } + ifail = getPropertyStringValue(parent_bomline_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else { + EMH_store_error_s2(EMH_severity_error, ITK_err, "δ֪ȡλãѡ", config.prop_loc.c_str()); + return ITK_err; + } + } + if (prop_value.size() == 0) { + if (config.replace_map.count("default") > 0) { + prop_value = config.replace_map["default"]; + } + } + else { + if (config.replace_map.count(prop_value) > 0) { + prop_value = config.replace_map[prop_value]; + } + else if (config.replace_map.count("*") > 0) { + prop_value = config.replace_map["*"]; + } + } + if (combine) { + combined_prop_value.append(prop_value); + WriteLog(debug, "[%s][%s] = [%s]", config.erp.c_str(), config.type.c_str(), prop_value.c_str()); + continue; + } + combined_prop_value.append(prop_value); + WriteLog(debug, "[%s][%s] = [%s]", config.erp.c_str(), config.type.c_str(), combined_prop_value.c_str()); + TiXmlElement* field = new TiXmlElement("field"); + field->SetAttribute("name", config.erp.c_str()); + field->SetAttribute("type", config.type.c_str()); + set_xml_value(field, combined_prop_value.c_str()); + p->LinkEndChild(field); + combined_prop_value.clear(); + } + return ifail; +} + + +int read_data_sp(tag_t bomline_tag, tag_t rev_tag, tag_t raw_material_rev_tag, vector erp_configs, TiXmlElement* p, map overwrite) { + int ifail = ITK_ok, att_cnt = 0; + tag_t item_tag = NULLTAG, form_tag = NULLTAG, * form_tags = NULL; + tag_t r_item_tag = NULLTAG, r_form_tag = NULLTAG; + string combined_prop_value; + if (rev_tag == NULLTAG) { + if (bomline_tag != NULLTAG) { + ITKCALL(ifail = AOM_ask_value_tag(bomline_tag, "bl_revision", &rev_tag)); + } + } + if (erp_configs.size() == 0) { + return ifail; + } + if (rev_tag != NULLTAG) { + ITKCALL(ITEM_ask_item_of_rev(rev_tag, &item_tag)); + ITKCALL(AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &att_cnt, &form_tags)); + if (att_cnt > 0) { + form_tag = form_tags[0]; + DOFREE(form_tags); + } + } + if (raw_material_rev_tag != NULLTAG) { + DOFREE(form_tags); + ITKCALL(ITEM_ask_item_of_rev(raw_material_rev_tag, &r_item_tag)); + ITKCALL(AOM_ask_value_tags(raw_material_rev_tag, "IMAN_master_form_rev", &att_cnt, &form_tags)); + if (att_cnt > 0) { + r_form_tag = form_tags[0]; + DOFREE(form_tags); + } + } + for (int i = 0; i < erp_configs.size(); i++) { + ERP_Config config = erp_configs[i]; + string prop_value; + bool combine = false; + if (i < erp_configs.size() - 1) { + combine = (config.erp == erp_configs[i + 1].erp); + } + if (overwrite.count(config.erp) > 0) { + prop_value = overwrite[config.erp]; + } + else if (config.prop_loc.size() == 0) { + prop_value = config.text_value; + } + else { + if (tc_strcmp("ITEM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(item_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("REV", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(rev_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("FORM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(form_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("BOM", config.prop_loc.c_str()) == 0) { + if (bomline_tag != NULLTAG) { + ifail = getPropertyStringValue(bomline_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + }else if (tc_strcmp("RAWITEM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(r_item_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("RAWREV", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(raw_material_rev_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("RAWFORM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(r_form_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else { + EMH_store_error_s2(EMH_severity_error, ITK_err, "δ֪ȡλãѡ", config.prop_loc.c_str()); + return ITK_err; + } + /*vector target_item_tags, target_rev_tags, target_form_tags, targetline_tags; + if (config.child_line_type.size() > 0 && bomline_tag != NULLTAG) { + get_child_line(bomline_tag, config.child_line_type, targetline_tags); + for (int k = 0; k < targetline_tags.size(); k++) { + tag_t cline_tag = targetline_tags[k], target_item_tag = NULLTAG, target_rev_tag = NULLTAG, target_form_tag = NULLTAG; + ITKCALL(ifail = AOM_ask_value_tag(cline_tag, "bl_revision", &target_rev_tag)); + ITKCALL(ITEM_ask_item_of_rev(target_rev_tag, &target_item_tag)); + ITKCALL(AOM_ask_value_tags(target_rev_tag, "IMAN_master_form_rev", &att_cnt, &form_tags)); + if (att_cnt > 0) { + target_form_tag = form_tags[0]; + DOFREE(form_tags); + } + target_item_tags.push_back(target_item_tag); + target_rev_tags.push_back(target_rev_tag); + target_form_tags.push_back(target_form_tag); + } + } + else { + target_item_tags.push_back(item_tag); + target_rev_tags.push_back(rev_tag); + target_form_tags.push_back(form_tag); + targetline_tags.push_back(bomline_tag); + } + for (int k = 0; k < targetline_tags.size(); k++) { + tag_t target_item_tag = target_item_tags[k]; + tag_t target_rev_tag = target_rev_tags[k]; + tag_t target_form_tag = target_form_tags[k]; + tag_t targetline_tag = targetline_tags[k]; + if (k != 0) { + prop_value.append(";"); + } + if (tc_strcmp("ITEM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(target_item_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("REV", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(target_rev_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("FORM", config.prop_loc.c_str()) == 0) { + ifail = getPropertyStringValue(target_form_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else if (tc_strcmp("BOM", config.prop_loc.c_str()) == 0) { + if (bomline_tag == NULLTAG) { + continue; + } + ifail = getPropertyStringValue(targetline_tag, config.prop_name.c_str(), config.sub_prop_name, prop_value, config.isDisplayValue, config.splitter, config.split_index); + } + else { + EMH_store_error_s2(EMH_severity_error, ITK_err, "δ֪ȡλãѡ", config.prop_loc.c_str()); + return ITK_err; + } + } + target_item_tags.clear(); + target_rev_tags.clear(); + target_form_tags.clear(); + targetline_tags.clear();*/ + } + if (prop_value.size() == 0) { + if (config.replace_map.count("default") > 0) { + prop_value = config.replace_map["default"]; + } + } + else { + if (config.replace_map.count(prop_value) > 0) { + prop_value = config.replace_map[prop_value]; + } + else if (config.replace_map.count("*") > 0) { + prop_value = config.replace_map["*"]; + } + } + if (combine) { + combined_prop_value.append(prop_value); + WriteLog(debug, "[%s][%s] = [%s]", config.erp.c_str(), config.type.c_str(), prop_value.c_str()); + continue; + } + combined_prop_value.append(prop_value); + WriteLog(debug, "[%s][%s] = [%s]", config.erp.c_str(), config.type.c_str(), combined_prop_value.c_str()); + TiXmlElement* field = new TiXmlElement("field"); + field->SetAttribute("name", config.erp.c_str()); + field->SetAttribute("type", config.type.c_str()); + set_xml_value(field, combined_prop_value.c_str()); + p->LinkEndChild(field); + combined_prop_value.clear(); + } + return ifail; +} + +int ask_zizhi(tag_t rev_tag, string& value) { + int ifail = ITK_ok, form_cnt = 0; + char* object_string = NULL, * prop_value = NULL; + tag_t form_tag = NULLTAG, * form_tags = NULL; + ITKCALL(ifail = AOM_ask_value_string(rev_tag, "object_string", &object_string)); + ITKCALL(ifail = AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &form_cnt, &form_tags)); + if (form_cnt == 0) { + goto end; + } + form_tag = form_tags[0]; + ITKCALL(ifail = AOM_UIF_ask_value(form_tag, "qf8laiyuan", &prop_value)); + if (ifail != ITK_ok) { + goto end; + } + WriteLog(debug, "Ƽ [%s][%s]", object_string, prop_value); + value.assign(prop_value); +end: + DOFREE(form_tags); + DOFREE(object_string); + DOFREE(prop_value); + return ifail; +} + +// ײƼչ +int write_zizhi(tag_t rev_tag, vector zz_parent_configs, vector zz_child_configs, int& bomSeq, TiXmlElement* bom_data) { + int ifail = ITK_ok, form_cnt = 0, child_cnt = 0; + char* object_string = NULL, * object_type = NULL, *prop_value = NULL; + tag_t* form_tags = NULL, form_tag = NULLTAG, *child_tags = NULL, relation_tag = NULLTAG; + vector child_revs; + string clyl; + ITKCALL(ifail = WSOM_ask_object_type2(rev_tag, &object_type)); + if (strcmp("QF8PartRevision", object_type) != 0) { + goto end; + } + ITKCALL(ifail = AOM_ask_value_string(rev_tag, "object_string", &object_string)); + ITKCALL(ifail = AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &form_cnt, &form_tags)); + if (form_cnt == 0) { + goto end; + } + form_tag = form_tags[0]; + ITKCALL(ifail = AOM_UIF_ask_value(form_tag, "qf8laiyuan", &prop_value)); + if (ifail != ITK_ok) { + goto end; + } + WriteLog(debug, "Ƽ [%s][%s]", object_string, prop_value); + if (strcmp("", prop_value) != 0) { + goto end; + } + ITKCALL(ifail = GRM_find_relation_type("QF8SCXXrelation", &relation_tag)); + if (relation_tag == NULLTAG) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δϵQF8SCXXrelation"); + ifail = ITK_err; + goto end; + } + ITKCALL(ifail = GRM_list_secondary_objects_only(rev_tag, relation_tag, &child_cnt, &child_tags)); + WriteLog(debug, ">> ҵӶ%d", child_cnt); + if (child_cnt == 0) { + goto end; + } + for (int i = 0; i < child_cnt; i++) { + tag_t child_tag = child_tags[i]; + DOFREE(object_string); + DOFREE(object_type); + ITKCALL(ifail = WSOM_ask_object_type2(child_tag, &object_type)); + ITKCALL(ifail = AOM_ask_value_string(child_tag, "object_string", &object_string)); + WriteLog(debug, ">> %d. [%s][%s]", i+1, object_string, object_type); + if (strcmp("QF8RawMaterialsRevision", object_type) == 0) { + child_revs.push_back(child_tag); + } + else if (strcmp("QF8SCXXBDRevision", object_type) == 0) { + //char* prop_value = NULL; + //ITKCALL(ifail = AOM_UIF_ask_value(child_tag, "qf8clyl", &prop_value)); + //if (ifail == ITK_ok) { + // WriteLog(debug, " >> [qf8clyl] = [%s]", prop_value); + // clyl.assign(prop_value); + //} + //DOFREE(prop_value); + + //TODO 20240116ԭĴӶϻȡijɴӰ汾ϻȡ°汾 + char* prop_value = NULL; + int form_cnt = 0; + tag_t *formTag = NULL; + AOM_ask_value_tags(child_tag,IMAN_MASTER_FORM_REV,&form_cnt,&formTag); + ITKCALL(ifail = AOM_UIF_ask_value(formTag[0],QF8CLYL, &prop_value)); + + if (ifail == ITK_ok) { + WriteLog(debug, " >> [%s] = [%s]", QF8CLYL, prop_value); + clyl.assign(prop_value); + } + DOFREE(prop_value); + DOFREE(formTag); + } + } + child_cnt = child_revs.size(); + WriteLog(debug, ">> ҵԭ%d", child_cnt); + if (child_cnt == 0) { + goto end; + } + // дBOM + { + TiXmlElement* data_row = new TiXmlElement("row"); + data_row->SetAttribute("seq", bomSeq); + bomSeq += 1; + bom_data->LinkEndChild(data_row); + read_data(NULLTAG, rev_tag, NULLTAG, NULLTAG, zz_parent_configs, data_row); + TiXmlElement* detail = new TiXmlElement("detail"); + detail->SetAttribute("name", "BOM_D"); + data_row->LinkEndChild(detail); + for (int i = 0; i < child_cnt; i++) { + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", i + 1); + detail->LinkEndChild(row); + read_data(NULLTAG, child_revs[i], NULLTAG, rev_tag, zz_child_configs, row); + // + { + TiXmlElement* field = new TiXmlElement("field"); + field->SetAttribute("name", "QTY_PER"); + field->SetAttribute("type", "numeric"); + set_xml_value(field, clyl.c_str()); + row->LinkEndChild(field); + } + } + } +end: + child_revs.clear(); + DOFREE(object_string); + DOFREE(object_type); + DOFREE(prop_value); + DOFREE(form_tags); + DOFREE(child_tags); + return ifail; +} + + +int cycle_bom(tag_t bomline_tag, vector parent_configs, vector child_configs, + vector zz_parent_configs, vector zz_child_configs, + vector pli_configs, vector gi_configs, + TiXmlElement* bom_data, TiXmlElement* wl_pli, TiXmlElement* wl_gi, + int &bomSeq, int &wlSeq, vector& added_lines) { + int ifail = ITK_ok, child_cnt = 0, att_cnt = 0; + tag_t* child_lines = NULL; + tag_t rev_tag = NULLTAG; + char* rev_uid = NULL; + string zizhi; + if (bomline_tag == NULLTAG || parent_configs.size() == 0 || child_configs.size() == 0) { + return ifail; + } + ITKCALL(ifail = AOM_ask_value_tag(bomline_tag, "bl_revision", &rev_tag)); + if (rev_tag == NULLTAG) { + return ifail; + } + ITK__convert_tag_to_uid(rev_tag, &rev_uid); + if (inArray(added_lines, rev_uid)) { + WriteLog(debug, ">> ȡظBOM - %s", rev_uid); + return ifail; + } + added_lines.push_back(rev_uid); + DOFREE(rev_uid); + // 20220328 BOMʱҪжÿϵ⹺ԣqf8laiyuanǷƣBOMݵ˲ֹͣ + ifail = ask_zizhi(rev_tag, zizhi); + if (ifail!=ITK_ok||zizhi != "") { + WriteLog(debug, ">> BOM"); + return ifail; + } + //д + { + TiXmlElement* row_gi = new TiXmlElement("row"); + row_gi->SetAttribute("seq", wlSeq); + wl_gi->LinkEndChild(row_gi); + read_data(bomline_tag, NULLTAG, NULLTAG, NULLTAG, gi_configs, row_gi); + TiXmlElement* row_pli = new TiXmlElement("row"); + row_pli->SetAttribute("seq", wlSeq); + wl_pli->LinkEndChild(row_pli); + read_data(bomline_tag, NULLTAG, NULLTAG, NULLTAG, pli_configs, row_pli); + wlSeq += 1; + } + ITKCALL(ifail = BOM_line_ask_child_lines(bomline_tag, &child_cnt, &child_lines)); + // ײƼը + if (child_cnt == 0) { + write_zizhi(rev_tag, zz_parent_configs, zz_child_configs, bomSeq, bom_data); + } + if (child_cnt == 0) { + DOFREE(child_lines); + return ifail; + } + // bom + for (int i = 0; i < child_cnt; i++) { + cycle_bom(child_lines[i], parent_configs, child_configs, zz_parent_configs, zz_child_configs, pli_configs, gi_configs, bom_data, wl_pli, wl_gi, bomSeq, wlSeq, added_lines); + } + // дBOM + { + TiXmlElement* data_row = new TiXmlElement("row"); + data_row->SetAttribute("seq", bomSeq); + bomSeq += 1; + bom_data->LinkEndChild(data_row); + read_data(bomline_tag, NULLTAG, NULLTAG, NULLTAG, parent_configs, data_row); + TiXmlElement* detail = new TiXmlElement("detail"); + detail->SetAttribute("name", "BOM_D"); + data_row->LinkEndChild(detail); + for (int i = 0; i < child_cnt; i++) { + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", i + 1); + detail->LinkEndChild(row); + read_data(child_lines[i], NULLTAG, bomline_tag, rev_tag, child_configs, row); + } + } + + DOFREE(child_lines); + return ifail; +} + +int read_bom_data(tag_t rev_tag, vector parent_configs, vector child_configs, + vector zz_parent_configs, vector zz_child_configs, + vector pli_configs, vector gi_configs, TiXmlElement* bom_data, TiXmlElement* wl_pli, TiXmlElement *wl_gi, int &bomSeq, int &wlSeq, vector &added_lines) { + int ifail = ITK_ok; + tag_t bom_view = NULLTAG, bvr_tag = NULLTAG, bom_window = NULLTAG, topBomLine = NULLTAG; + char* objectstring = NULL; + ITKCALL(ifail = AOM_ask_value_string(rev_tag, "object_string", &objectstring)); + WriteLog(debug, "ȡBOM - %s", objectstring); + ITKCALL(ifail = GetBomView(rev_tag, "view", &bom_view, &bvr_tag, debug)); + if (bom_view != NULLTAG) { + ITKCALL(ifail = BOM_create_window(&bom_window)); + ITKCALL(ifail = BOM_set_window_top_line_bvr(bom_window, bvr_tag, &topBomLine)); + ifail = cycle_bom(topBomLine, parent_configs, child_configs, zz_parent_configs, zz_child_configs, pli_configs, gi_configs, bom_data, wl_pli, wl_gi, bomSeq, wlSeq, added_lines); + ITKCALL(BOM_close_window(bom_window)); + } + else { + WriteLog(debug, "ûҵBOMͼ"); + char* rev_uid = NULL; + ITK__convert_tag_to_uid(rev_tag, &rev_uid); + if (!inArray(added_lines, rev_uid)) { + added_lines.push_back(rev_uid); + write_zizhi(rev_tag, zz_parent_configs, zz_child_configs, bomSeq, bom_data); + } + else { + WriteLog(debug, ">> ȡظƼ - %s", rev_uid); + } + DOFREE(rev_uid); + // return ITK_err; + } + DOFREE(objectstring); + return ifail; +} + +int add_bop_dataset(string &name_prefix, tag_t dataset_tag, TiXmlElement* detail, const char* type, int& sop_index, const char* ref_name) { + int ifail = ITK_ok; + char* object_name = NULL, * uid = NULL, * origin_file_name = NULL; + tag_t spec_dataset_rev = NULLTAG, *ref_objects = NULL, ref_object = NULLTAG; + AE_reference_type_t my_ref_type; + + ITKCALL(ifail = AOM_ask_value_string(dataset_tag, "object_name", &object_name)); + ITK__convert_tag_to_uid(dataset_tag, &uid); + WriteLog(debug, "ݼ[%s] [%s]", object_name, type); + string ds_dir; + ds_dir.assign(local_dir).append(uid).append("\\"); + WriteLog(debug, "========1======"); + + if (std::experimental::filesystem::is_directory(ds_dir)) { + + WriteLog(debug, "=========2====="); + std::experimental::filesystem::remove_all(ds_dir); + + WriteLog(debug, "======3========"); + } + if (!std::experimental::filesystem::is_directory(ds_dir)) { + WriteLog(debug, "=======4======="); + if (!std::experimental::filesystem::create_directories(ds_dir)) { + WriteLog(debug, "½Ŀ¼ʧܣ%s", ds_dir.c_str()); + ifail = ITK_err; + EMH_store_error_s2(EMH_severity_error, ITK_err, "ݼĿ¼ʧ", ds_dir.c_str()); + goto end; + } + } + ITKCALL(ifail = AE_ask_dataset_latest_rev(dataset_tag, &spec_dataset_rev)); + ITKCALL(ifail = AE_ask_dataset_named_ref2(spec_dataset_rev, ref_name, &my_ref_type, &ref_object)); + { + DOFREE(origin_file_name); + string temp_file, ftp_file; + //tag_t ref_object = ref_objects[i]; + WriteLog(debug, "=========6====="); + ITKCALL(ifail = IMF_ask_original_file_name2(ref_object, &origin_file_name)); + WriteLog(debug, "======7========"); + if (ifail != ITK_ok) { + goto end; + } + temp_file.assign(ds_dir).append(name_prefix).append(origin_file_name); + ftp_file.assign(ftp_dir).append(uid).append("\\").append(name_prefix).append(origin_file_name); + + WriteLog(debug, "=======8======="); + ITKCALL(ifail = IMF_export_file(ref_object, temp_file.c_str())); + + WriteLog(debug, "========9======"); + if (ifail != ITK_ok) { + goto end; + } + WriteLog(debug, "ļɣ%s", (temp_file.c_str())); + // дxml + { + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", sop_index++); + detail->LinkEndChild(row); + TiXmlElement* field1 = new TiXmlElement("field"); + field1->SetAttribute("name", "type"); + field1->SetAttribute("type", "string"); + row->LinkEndChild(field1); + set_xml_value(field1, type); + TiXmlElement* field2 = new TiXmlElement("field"); + field2->SetAttribute("name", "sop_no"); + field2->SetAttribute("type", "string"); + row->LinkEndChild(field2); + set_xml_value(field2, object_name); + TiXmlElement* field3 = new TiXmlElement("field"); + field3->SetAttribute("name", "sop_file"); + field3->SetAttribute("type", "string"); + set_xml_value(field3, ftp_file.c_str()); + row->LinkEndChild(field3); + } + } +end: + DOFREE(origin_file_name); + DOFREE(ref_objects); + DOFREE(uid); + DOFREE(object_name); + return ifail; +} +/* +*װ䣬PDF͵ݼ +*rev_tag汾 +*detailxml +*sop_indexţ +*/ +int add_bop_datasets_with11(tag_t rev_tag, TiXmlElement* detail, int& sop_index) { + int ifail = ITK_ok; + int ds_cnt = 0, metarget_cnt = 0; + tag_t* ds_tags = NULL, *metarget_tags = NULL; + char* object_string = NULL, * object_type = NULL; + string name_prefix; + ITKCALL(ifail = AOM_ask_value_string(rev_tag,ITEM_ID, &object_string)); + name_prefix.assign(object_string); + name_prefix.append("_"); + WriteLog(debug, "ļǰ׺%s", name_prefix.c_str()); + ITKCALL(ifail = AOM_ask_value_tags(rev_tag,IMAN_SPECIFICATION, &ds_cnt, &ds_tags)); + WriteLog(debug, "ݼ%d", ds_cnt); + for (int i = 0; i < ds_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t ds_tag = ds_tags[i]; + ITKCALL(ifail = AOM_ask_value_string(ds_tag, "object_string", &object_string)); + ITKCALL(ifail = WSOM_ask_object_type2(ds_tag, &object_type)); + WriteLog(debug, ">> %d. %s [%s]", i+1, object_string, object_type); + if (strcmp("PDF", object_type) == 0) { + ifail = add_bop_dataset(name_prefix, ds_tag, detail, "3", sop_index,PDF_REFERENCE); + if (ifail != ITK_ok) { + goto end; + } + } + } +end: + DOFREE(object_string); + DOFREE(object_type); + DOFREE(ds_tags); + DOFREE(metarget_tags); + return ifail; +} +/* +*ںӻPDF͵ݼ +*rev_tag汾 +*detailxml +*sop_indexţ +*/ +int add_bop_datasets_with12(tag_t rev_tag, TiXmlElement* detail, int& sop_index) { + int ifail = ITK_ok; + int ds_cnt = 0, metarget_cnt = 0; + tag_t* ds_tags = NULL, *metarget_tags = NULL; + char* object_string = NULL, *object_type = NULL; + string name_prefix; + ITKCALL(ifail = AOM_ask_value_string(rev_tag, "item_id", &object_string)); + name_prefix.assign(object_string); + name_prefix.append("_"); + WriteLog(debug, "ļǰ׺%s", name_prefix.c_str()); + ITKCALL(ifail = AOM_ask_value_tags(rev_tag,IMAN_SPECIFICATION, &ds_cnt, &ds_tags)); + WriteLog(debug, "ݼ%d", ds_cnt); + for (int i = 0; i < ds_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t ds_tag = ds_tags[i]; + ITKCALL(ifail = AOM_ask_value_string(ds_tag, "object_string", &object_string)); + ITKCALL(ifail = WSOM_ask_object_type2(ds_tag, &object_type)); + WriteLog(debug, ">> %d. %s [%s]", i + 1, object_string, object_type); + if (strcmp("DirectModel", object_type) == 0 || strcmp("ֱģ", object_type) == 0) { + ifail = add_bop_dataset(name_prefix, ds_tag, detail, "1", sop_index, JTPART); + if (ifail != ITK_ok) { + goto end; + } + } + + + } +end: + DOFREE(object_string); + DOFREE(object_type); + DOFREE(ds_tags); + DOFREE(metarget_tags); + return ifail; +} + + +int add_bop_datasets(tag_t gy_line, TiXmlElement* detail, int& sop_index) { + int ifail = ITK_ok; + int ds_cnt = 0, metarget_cnt = 0; + tag_t* ds_tags = NULL, rev_tag = NULLTAG, *metarget_tags = NULL; + char* object_string = NULL, * object_type = NULL; + string name_prefix; + ITKCALL(ifail = AOM_ask_value_tag(gy_line, "bl_revision", &rev_tag)); + if (ifail != ITK_ok) { + goto end; + } + ITKCALL(ifail = AOM_ask_value_string(rev_tag, "item_id", &object_string)); + name_prefix.assign(object_string); + name_prefix.append("_"); + WriteLog(debug, "ļǰ׺%s", name_prefix.c_str()); + ITKCALL(ifail = AOM_ask_value_tags(rev_tag, "IMAN_specification", &ds_cnt, &ds_tags)); + WriteLog(debug, "ݼ%d", ds_cnt); + for (int i = 0; i < ds_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t ds_tag = ds_tags[i]; + ITKCALL(ifail = AOM_ask_value_string(ds_tag, "object_string", &object_string)); + ITKCALL(ifail = WSOM_ask_object_type2(ds_tag, &object_type)); + WriteLog(debug, ">> %d. %s [%s]", i+1, object_string, object_type); + if (strcmp("UGMASTER", object_type) == 0) { + ifail = add_bop_dataset(name_prefix, ds_tag, detail, "1", sop_index, "UGPART"); + if (ifail != ITK_ok) { + goto end; + } + } + else if (strcmp("HTML", object_type) == 0) { + ifail = add_bop_dataset(name_prefix, ds_tag, detail, "2", sop_index, "HTML"); + if (ifail != ITK_ok) { + goto end; + } + } + } + ITKCALL(ifail = AOM_ask_value_tags(rev_tag, "IMAN_METarget", &metarget_cnt, &metarget_tags)); + WriteLog(debug, "Ŀ%d", metarget_cnt); + for (int i = 0; i < metarget_cnt; i++) { + DOFREE(object_string); + DOFREE(object_type); + DOFREE(ds_tags); + tag_t metarget_tag = metarget_tags[i]; + ITKCALL(ifail = AOM_ask_value_string(metarget_tag, "object_string", &object_string)); + ITKCALL(ifail = WSOM_ask_object_type2(metarget_tag, &object_type)); + WriteLog(debug, ">> %d. %s [%s]", i + 1, object_string, object_type); + ITKCALL(ifail = AOM_ask_value_tags(metarget_tag, "IMAN_Rendering", &ds_cnt, &ds_tags)); + WriteLog(debug, ">> ݼ%d", ds_cnt); + for (int j = 0; j < ds_cnt; j++) { + DOFREE(object_string); + DOFREE(object_type); + tag_t ds_tag = ds_tags[j]; + ITKCALL(ifail = AOM_ask_value_string(ds_tag, "object_string", &object_string)); + ITKCALL(ifail = WSOM_ask_object_type2(ds_tag, &object_type)); + WriteLog(debug, ">> %d.%d %s [%s]", i + 1, j + 1, object_string, object_type); + if (strcmp("DirectModel", object_type) == 0|| strcmp("ֱģ", object_type) == 0) { + ifail = add_bop_dataset(name_prefix, ds_tag, detail, "1", sop_index, "JTPART"); + if (ifail != ITK_ok) { + goto end; + } + } + } + } +end: + DOFREE(object_string); + DOFREE(object_type); + DOFREE(ds_tags); + DOFREE(metarget_tags); + return ifail; +} + +int add_bop_sublines(tag_t gx_line, tag_t raw_material_rev_tag, TiXmlElement *detail, const char* title, const char* subline_types, int &index, vector child_configs, map overwrite) { + int ifail = ITK_ok; + char* object_string = NULL; + vector resource_lines; + get_child_line(gx_line, subline_types, resource_lines); + int line_cnt = resource_lines.size(); + WriteLog(debug, "%s%d",title, line_cnt); + for (int j = 0; j < line_cnt; j++) { + DOFREE(object_string); + tag_t reource_line = resource_lines[j]; + ITKCALL(ifail = AOM_ask_value_string(reource_line, "object_string", &object_string)); + WriteLog(debug, ">> %d. %s [%s]", j + 1, title, object_string); + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", index++); + detail->LinkEndChild(row); + read_data_sp(reource_line, NULLTAG, raw_material_rev_tag, child_configs, row, overwrite); + } +end: + resource_lines.clear(); + return ifail; +} +/* +*mapҵֵ +*mapXmap +*elementmapļ +*/ +vector findElement(map> mapX, tag_t element) { + map>::iterator it; + it = mapX.find(element); + vector vec; + if (it != mapX.end()) { + return it->second; + } + else { + return vec; + } +} +/* +*mapҵֵ +*mapXmap +*elementmapļ +*/ +tag_t findElement(map mapX, tag_t element) { + map::iterator it; + it = mapX.find(element); + tag_t value = NULL; + if (it != mapX.end()) { + return it->second; + } + else { + return value; + } + + +} + +/* +*ͨԪжϸüǷڸԪ +*v: +*element:Ԫ +*1ʾԪ +*0ʾԪ +*/ +int hasElement(vector v, tag_t element) { + //vector::iterator it = find(v.begin(), v.end(), element); + //if (it != v.end()) { + // return 0;// + //} + //else { + // return 1;// + // + //} + if (count(v.begin(), v.end(), element)) + { + //cout << "Element"<< element<<" found" << endl; + return 0;// + } + else + { + //cout << "Element "<< element<<"NOT found" << endl; + return 1;// + } + +} +/* +*ѭBOMеĹգ򣬹λӵ +*topBomLinev:bomline +*gyVec: +*/ +void loopGy(tag_t topBomLine,vector &gyVec) { + int ifail = 0; + int wlCnt = 0; + tag_t *wlLines = NULL; + ITKCALL(ifail = BOM_line_ask_child_lines(topBomLine, &wlCnt, &wlLines)); + if (wlCnt>0) { + for (int n = 0; n < wlCnt; n++) { + tag_t childWlRev = NULL; + ITKCALL(ifail = AOM_ask_value_tag(wlLines[n],BL_REVISION, &childWlRev)); + char *childWlType = NULL; + AOM_ask_value_string(childWlRev,OBJECT_TYPE, &childWlType); + if (tc_strcmp(childWlType, QF8GYREVISION) == 0 || tc_strcmp(childWlType, QF8GXREVISION) == 0 || tc_strcmp(childWlType, MESTATIONREVISION) == 0) { + int exist = hasElement(gyVec, childWlRev); + if (exist == 1) { + gyVec.push_back(childWlRev); + } + } + DOFREE(childWlType); + loopGy(wlLines[n],gyVec); + } + } + DOFREE(wlLines); +} +/* +*ѭBOMеӵ +*topBomLinev:bomline +*gyVec: +*/ +void loopWl(tag_t topBomLine, vector &wlVec, vector &gyVec) { + int ifail = 0; + int wlCnt = 0; + tag_t *wlLines = NULL; + ITKCALL(ifail = BOM_line_ask_child_lines(topBomLine, &wlCnt, &wlLines)); + for (int i = 0; i < wlCnt; i++) { + tag_t childWl = wlLines[i]; + tag_t childRev = NULL; + ITKCALL(ifail = AOM_ask_value_tag(childWl,BL_REVISION, &childRev)); + tag_t* form_tags = NULL; + int form_cnt = 0; + ITKCALL(AOM_ask_value_tags(childRev,IMAN_MASTER_FORM_REV, &form_cnt, &form_tags)); + if (form_cnt > 0) { + char* value = NULL; + tag_t form_tag = form_tags[0]; + ITKCALL(ifail = AOM_UIF_ask_value(form_tag,QF8LAIYUAN, &value)); + if (ifail == ITK_ok) { + WriteLog(debug, ">> qf8laiyuan = [%s]", value); + if (strcmp("", value) == 0) { + int exist = hasElement(wlVec, childRev); + if (exist == 1) { + wlVec.push_back(childRev); + } + //ȡBOPϵµĹն + int BOPcnt = 0; + tag_t *BOPtags = NULL; + ITKCALL(AOM_ask_value_tags(childRev, QF8BOPRELATION, &BOPcnt, &BOPtags)); + char* gyType = NULL; + for (int j = 0; j < BOPcnt; j++) { + tag_t gyTag = BOPtags[j]; + AOM_ask_value_string(gyTag, OBJECT_TYPE, &gyType); + if (tc_strcmp(gyType, QF8GYREVISION) == 0) { + exist = hasElement(gyVec, gyTag); + if (exist == 1) { + + gyVec.push_back(gyTag); + } + int bom_num = 0; + tag_t * bom_tags = NULLTAG; + AOM_ask_value_tags(gyTag, STRUCTURE_REVISIONS, &bom_num, &bom_tags); + if (bom_num > 0) + { + tag_t only_bom = bom_tags[0]; + tag_t bom_window_tag = NULLTAG, top_bom_line_tag = NULLTAG, rev_tag = NULLTAG, item_tag = NULLTAG; + ITKCALL(ifail = BOM_create_window(&bom_window_tag)); + ITKCALL(ifail = BOM_set_window_top_line_bvr(bom_window_tag, only_bom, &top_bom_line_tag)); + //ѭв㼶ѹϵĹ͹λӵ + loopGy(top_bom_line_tag, gyVec); + ITKCALL(ifail = BOM_close_window(bom_window_tag));//пй + } + DOFREE(bom_tags); + } + } + DOFREE(BOPtags); + DOFREE(gyType); + } + } + DOFREE(value); + } + DOFREE(form_tags); + //TODO ѭв㼶 + loopWl(childWl, wlVec, gyVec); + } + DOFREE(wlLines); + +} +/* +*ΪÿλµĹ򼯺ӼϢ +*/ +void addInspectionInformationWithVec(TiXmlElement* row,vector gxVec) { + TiXmlElement* qcitem_detail = new TiXmlElement("detail"); + qcitem_detail->SetAttribute("name", "qcitem_detail"); + row->LinkEndChild(qcitem_detail); + int seq = 0; + for (int n = 0; n < gxVec.size(); n++) { + tag_t gxRev = gxVec[n]; + int attachCnt = 0; + tag_t *attachTags = NULL; + char *gxId = NULL; + char *gxRevisionId = NULL; + AOM_ask_value_string(gxRev, "item_id", &gxId); + AOM_ask_value_string(gxRev, "item_revision_id", &gxRevisionId); + string excelName = ""; + excelName = excelName.append(gxId).append("_").append(gxRevisionId).append("_JYX.xlsx"); + cout << "excelName" << excelName << endl; + AOM_ask_value_tags(gxRev,IMAN_SPECIFICATION, &attachCnt, &attachTags); + for (int x = 0; x < attachCnt; x++) { + tag_t excelTag = attachTags[x]; + char *excelType = NULL; + AOM_ask_value_string(excelTag, "object_type", &excelType); + cout << "excelType" << excelType << endl; + + if (tc_strcmp("MSExcelX", excelType) == 0) { + char *excelNameChar = NULL; + AOM_ask_value_string(excelTag, "object_name", &excelNameChar); + cout << "excelNameChar" << excelNameChar << endl; + + if (tc_strcmp(excelName.c_str(), excelNameChar) == 0) { + //ӼϢ + cout << "ҵexcel" << endl; + readExcel(qcitem_detail, seq, excelTag, "xlsx"); + } + } + DOFREE(excelType); + } + DOFREE(attachTags); + DOFREE(gxId); + DOFREE(gxRevisionId); + + } + + +} +/* +*ΪӼϢ +*/ +void addInspectionInformationWithGxLine(TiXmlElement* row, tag_t gxLine) { + tag_t rev_tag = NULL; + int ifail = 0; + if (gxLine != NULLTAG) { + ITKCALL(ifail = AOM_ask_value_tag(gxLine, BL_REVISION, &rev_tag)); + } + + TiXmlElement* qcitem_detail = new TiXmlElement("detail"); + qcitem_detail->SetAttribute("name", "qcitem_detail"); + row->LinkEndChild(qcitem_detail); + int seq = 0; + tag_t gxRev = rev_tag; + int attachCnt = 0; + tag_t *attachTags = NULL; + char *gxId = NULL; + char *gxRevisionId = NULL; + AOM_ask_value_string(gxRev, "item_id", &gxId); + AOM_ask_value_string(gxRev, "item_revision_id", &gxRevisionId); + string excelName = ""; + excelName = excelName.append(gxId).append("_").append(gxRevisionId).append("_JYX.xlsx"); + AOM_ask_value_tags(gxRev, "IMAN_specification", &attachCnt, &attachTags); + for (int x = 0; x < attachCnt; x++) { + tag_t excelTag = attachTags[x]; + char *excelType = NULL; + AOM_ask_value_string(excelTag, "object_type", &excelType); + if (tc_strcmp("MSExcelX", excelType) == 0) { + char *excelNameChar = NULL; + AOM_ask_value_string(excelTag, "object_name", &excelNameChar); + if (tc_strcmp(excelName.c_str(), excelNameChar) == 0) { + //ӼϢ + readExcel(qcitem_detail, seq, excelTag, "xlsx"); + } + } + DOFREE(excelType); + } + DOFREE(attachTags); + DOFREE(gxId); + DOFREE(gxRevisionId); + + + +} + + +int cycle_bop(tag_t bomline_tag, tag_t raw_material_rev_tag, vector parent_configs, vector child_configs1, vector child_configs2, vector child_configs3, vector child_configs4, TiXmlElement* bom_data, int& bomSeq, vector& added_lines,int wlType,tag_t wlRev) { + int ifail = ITK_ok, child_cnt = 0, att_cnt = 0; + + tag_t rev_tag = NULLTAG; + char* rev_uid = NULL, *object_string = NULL; + vector meop_lines; + if (bomline_tag == NULLTAG || parent_configs.size() == 0 || child_configs1.size() == 0 || child_configs2.size() == 0 || child_configs3.size() == 0 || child_configs4.size() == 0) { + return ifail; + } + ITKCALL(ifail = AOM_ask_value_tag(bomline_tag, "bl_revision", &rev_tag)); + if (rev_tag == NULLTAG) { + return ifail; + } + ITK__convert_tag_to_uid(rev_tag, &rev_uid); + if (inArray(added_lines, rev_uid)) { + return ifail; + } + added_lines.push_back(rev_uid); + DOFREE(rev_uid); + + // ȡй + { + tag_t* gx_lines = NULL; + ITKCALL(ifail = BOM_line_ask_child_lines(bomline_tag, &child_cnt, &gx_lines)); + for (int k = 0; k < child_cnt; k++) { + DOFREE(object_string); + tag_t gx_line = gx_lines[k], gx_rev = NULLTAG; + logical is_gy= false; + ITKCALL(ifail = AOM_ask_value_string(gx_line, "object_string", &object_string)); + // WriteLog(debug, ">> %d. ӹ [%s]", k + 1, object_string); + // ˷ǹ + { + ITKCALL(ifail = AOM_ask_value_tag(gx_line, "bl_revision", &gx_rev)); + if (gx_rev == NULLTAG) { + WriteLog(debug, ">> ȡbomа汾ʧ[%s]", object_string); + } + else { + tag_t rev_type = NULLTAG; + ITKCALL(ifail = TCTYPE_ask_object_type(gx_rev, &rev_type)); + ITKCALL(ifail = TCTYPE_is_type_of_as_str(rev_type, "MEProcessRevision", &is_gy)); + } + } + if (is_gy) { + int child_cnt2 = 0; + tag_t* gx_lines2 = NULL; + ITKCALL(ifail = BOM_line_ask_child_lines(gx_line, &child_cnt2, &gx_lines2)); + WriteLog(debug, ">> չм[%s] -> [%d]", object_string, child_cnt2); + for (int j = 0; j < child_cnt2; j++) { + meop_lines.push_back(gx_lines2[j]); + } + DOFREE(gx_lines2); + } + else { + meop_lines.push_back(gx_line); + } + } + DOFREE(gx_lines); + } + child_cnt = meop_lines.size(); + WriteLog(debug, " [%d]", child_cnt); + if (child_cnt == 0) { + goto end; + } + { + map overwrite1; + // д + TiXmlElement* data_row = new TiXmlElement("row"); + data_row->SetAttribute("seq", bomSeq); + bomSeq += 1; + bom_data->LinkEndChild(data_row); + int reource_index = 1, sup_index = 1, material_index = 1, sop_index = 1; + read_data_sp(bomline_tag, NULLTAG, raw_material_rev_tag, parent_configs, data_row, overwrite1); + TiXmlElement* gx_detail = new TiXmlElement("detail"); + gx_detail->SetAttribute("name", "opstaiton_detail"); + TiXmlElement* resource_detail = new TiXmlElement("detail"); + resource_detail->SetAttribute("name", "opresource_detail"); + TiXmlElement* sup_detail = new TiXmlElement("detail"); + sup_detail->SetAttribute("name", "opsup_detail"); + TiXmlElement* material_detail = new TiXmlElement("detail"); + material_detail->SetAttribute("name", "material_detail"); + TiXmlElement* sop_detail = new TiXmlElement("detail"); + sop_detail->SetAttribute("name", "sop_detail"); + data_row->LinkEndChild(gx_detail); + data_row->LinkEndChild(resource_detail); + data_row->LinkEndChild(sup_detail); + data_row->LinkEndChild(material_detail); + data_row->LinkEndChild(sop_detail); + // д + //TODO 20240123 Ҫװ + if (wlType==11) { + //ȱṹɹλvector,λ͹򼯺ϵmap + map> gwGxMap;//λ汾͹汾ϵmap + map gwFormMap;//λ汾͹λ汾map + map gxFormMap;//汾͹汾map + map gxlineMap;//汾͹汾bomlinemap + vector gwVec;//λ汾 + for (int k = 0; k < child_cnt; k++) { + DOFREE(object_string); + tag_t gx_line = meop_lines[k], gx_rev = NULLTAG; + ITKCALL(ifail = AOM_ask_value_string(gx_line, "object_string", &object_string)); + WriteLog(debug, ">> %d.Ϣ[%s]", k + 1, object_string); + ITKCALL(ifail = AOM_ask_value_tag(gx_line, "bl_revision", &gx_rev)); + int gxFormCnt = 0; + tag_t *gxFormTags = NULL; + ITKCALL(ifail = AOM_ask_value_tags(gx_rev, IMAN_MASTER_FORM_REV, &gxFormCnt, &gxFormTags)); + tag_t gxForm = findElement(gxFormMap, gx_rev); + if (gxForm == NULL) { + gxFormMap.insert(pair(gx_rev, gxFormTags[0])); + } + tag_t gxline= findElement(gxlineMap, gx_rev); + if (gxline== NULL) { + gxlineMap.insert(pair(gx_rev, gx_line)); + } + DOFREE(gxFormTags); + //ȡµĹλ + int gwCnt = 0; + tag_t* gwLines = NULL; + //vector gwFormVec;//λ汾 + ITKCALL(ifail = BOM_line_ask_child_lines(gx_line, &gwCnt, &gwLines)); + for (int j = 0; j < gwCnt; j++) { + tag_t gwRev = NULL; + char *gwType = NULL; + ITKCALL(ifail = AOM_ask_value_tag(gwLines[j],BL_REVISION, &gwRev)); + ITKCALL(ifail = AOM_ask_value_string(gwRev,OBJECT_TYPE, &gwType)); + WriteLog(debug, ">> ͡%s", gwType); + + if (strcmp(MESTATIONREVISION,gwType)==0) { + int exist = hasElement(gwVec, gwRev); + if (exist == 1) { + gwVec.push_back(gwRev); + } + int formCnt = 0; + tag_t *formTags = NULL; + ITKCALL(ifail = AOM_ask_value_tags(gwRev,IMAN_MASTER_FORM_REV,&formCnt, &formTags)); + tag_t gwForm = findElement(gwFormMap, gwRev); + if (gwForm == NULL) { + gwFormMap.insert(pair(gwRev, formTags[0])); + } + /* int exist = hasElement(gwFormVec,formTags[0]); + if (exist == 1) { + gwFormVec.push_back(formTags[0]); + }*/ + DOFREE(formTags); + vector gxVec;//汾 + gxVec = findElement(gwGxMap, gwRev); + exist = hasElement(gxVec, gx_rev); + if (exist == 1) { + WriteLog(debug, ">> û%s", object_string); + + gxVec.push_back(gx_rev); + } + else { + WriteLog(debug, ">> Ѿ%s", object_string); + } + //gwGxMap.insert(pair>(gwRev, gxVec)); + gwGxMap[gwRev] = gxVec; + } + DOFREE(gwType); + } + + DOFREE(gwLines); + + } + WriteLog(debug, ">> ʼйλ"); + + //ʼйλ + for (int k = 0; k < gwVec.size();k++) { + tag_t gw= gwVec[k]; + vector gxVec; + WriteLog(debug, ">> λ1"); + + gxVec = gwGxMap[gw]; + WriteLog(debug, ">> λ2"); + + string op_no, next_station,op_name; + map overwrite; + if (k == -1) { + op_no.assign("START"); + op_name.assign("ʼ"); + } + else { + char* gwId = NULL; + ITKCALL(ifail = AOM_ask_value_string(gw,ITEM_ID, &gwId)); + op_no.assign(gwId); + DOFREE(gwId); + char* gwName = NULL; + ITKCALL(ifail = AOM_ask_value_string(gw,OBJECT_NAME, &gwName)); + op_name.assign(gwName); + DOFREE(gwName); + } + if (k == gwVec.size() - 1) { + next_station.assign("END"); + } + else { + char* nextGwId = NULL; + ITKCALL(ifail = AOM_ask_value_string(gwVec[k+1],ITEM_ID, &nextGwId)); + next_station.assign(nextGwId); + DOFREE(nextGwId); + } + overwrite.insert(make_pair("op_no", op_no)); + overwrite.insert(make_pair("opno", op_no)); + overwrite.insert(make_pair("op_name", op_name));//20240123 ֶop_name + overwrite.insert(make_pair("next_station", next_station)); + + + + if (k==0) { + map overwrite0; + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", "1"); + gx_detail->LinkEndChild(row); + overwrite0.insert(make_pair("op_no", "START")); + //overwrite0.insert(make_pair("opno", "START")); + overwrite0.insert(make_pair("op_name", "ʼ"));//20240123 ֶop_name,ֵΪǰ + overwrite0.insert(make_pair("next_station", op_no)); + overwrite0.insert(make_pair("outsourcing_type", "")); + overwrite0.insert(make_pair("prepare_time", "0"));//20240315Ϊstartʱ׼ʱͼӹʱΪ0 + overwrite0.insert(make_pair("product_time", "0")); + map::iterator rev_it; + for (rev_it = overwrite0.begin(); rev_it != overwrite0.end(); rev_it++) + { + TiXmlElement* field = new TiXmlElement("field"); + string fieldName = rev_it->first; + string fieldValue = rev_it->second; + field->SetAttribute("name", fieldName.c_str()); + field->SetAttribute("type","string"); + set_xml_value(field, fieldValue.c_str()); + row->LinkEndChild(field); + } + + + } + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", k + 2); + //ʣֶ + TiXmlElement* fieldOpno = new TiXmlElement("field"); + fieldOpno->SetAttribute("name", "op_no"); + fieldOpno->SetAttribute("type", "string"); + set_xml_value(fieldOpno, op_no.c_str()); + row->LinkEndChild(fieldOpno); + + TiXmlElement* fieldOpname = new TiXmlElement("field"); + fieldOpname->SetAttribute("name", "op_name"); + fieldOpname->SetAttribute("type", "string"); + set_xml_value(fieldOpname, op_name.c_str()); + row->LinkEndChild(fieldOpname); + + TiXmlElement* fieldNextStation = new TiXmlElement("field"); + fieldNextStation->SetAttribute("name", "next_station"); + fieldNextStation->SetAttribute("type", "string"); + set_xml_value(fieldNextStation, next_station.c_str()); + row->LinkEndChild(fieldNextStation); + + //ǷίQF8sfww + WriteLog(debug, ">>Ƿί"); + + char *QF8sfww = NULL; + AOM_UIF_ask_value(gxlineMap[gxVec[0]],QF8SFWW, &QF8sfww); + TiXmlElement* fieldSfww = new TiXmlElement("field"); + fieldSfww->SetAttribute("name", "outsourcing_type"); + fieldSfww->SetAttribute("type", "string"); + set_xml_value(fieldSfww, QF8sfww); + row->LinkEndChild(fieldSfww); + WriteLog(debug, ">>Ƿί%s", QF8sfww); + + DOFREE(QF8sfww); + WriteLog(debug, ">>Ƿί"); + + //ۼӼӹʱ׼ʱ + double jggsTotal = 0; + double zbgsTotal = 0; + WriteLog(debug, ">>%d", gxVec.size()); + + + for (int n = 0; n < gxVec.size(); n++) { + tag_t gxRev = gxVec[n]; + tag_t gxForm = gxFormMap[gxRev]; + char *zbgs = NULL; + char *jggs = NULL; + double zbgsDouble = 0; + double jggsDouble = 0; + AOM_ask_value_string(gxForm, QF8ZBGS, &zbgs); + AOM_ask_value_string(gxForm, QF8JGGS, &jggs); + try + { + zbgsDouble = atof(zbgs); + } + catch (const std::exception&) + { + } + try + { + jggsDouble = atof(jggs); + } + catch (const std::exception&) + { + } + jggsTotal = jggsTotal + jggsDouble; + zbgsTotal = zbgsTotal + zbgsDouble; + DOFREE(zbgs); + DOFREE(jggs); + + } + WriteLog(debug, ">>ܹʱ"); + + char jggsStr[20]; + char zbgsStr[20]; + sprintf(jggsStr, "%f", jggsTotal); + sprintf(zbgsStr, "%f", zbgsTotal); + TiXmlElement* fieldJggs = new TiXmlElement("field"); + fieldJggs->SetAttribute("name", "product_time"); + fieldJggs->SetAttribute("type", "string"); + set_xml_value(fieldJggs, jggsStr); + row->LinkEndChild(fieldJggs); + + TiXmlElement* fieldZbgs = new TiXmlElement("field"); + fieldZbgs->SetAttribute("name", "prepare_time"); + fieldZbgs->SetAttribute("type", "string"); + set_xml_value(fieldZbgs, zbgsStr); + row->LinkEndChild(fieldZbgs); + + //ӹ + WriteLog(debug, ">>ӹ"); + + TiXmlElement* SubOP_item_detail = new TiXmlElement("detail"); + SubOP_item_detail->SetAttribute("name", "SubOP_item_detail"); + row->LinkEndChild(SubOP_item_detail); + + for (int n = 0; n < gxVec.size(); n++) { + tag_t gxRev = gxVec[n]; + char *gxId = NULL; + char *gxName=NULL; + AOM_ask_value_string(gxRev,"item_id",&gxId); + AOM_ask_value_string(gxRev,"object_name",&gxName); + TiXmlElement* childGxRow = new TiXmlElement("row"); + childGxRow->SetAttribute("seq", n+1); + SubOP_item_detail->LinkEndChild(childGxRow); + + TiXmlElement* childGxFieldNo = new TiXmlElement("field"); + childGxFieldNo->SetAttribute("name", "SubOPNo"); + childGxFieldNo->SetAttribute("type", "string"); + set_xml_value(childGxFieldNo, gxId); + childGxRow->LinkEndChild(childGxFieldNo); + + TiXmlElement* childGxFieldValue = new TiXmlElement("field"); + childGxFieldValue->SetAttribute("name", "SubOPName"); + childGxFieldValue->SetAttribute("type", "string"); + set_xml_value(childGxFieldValue, gxName); + childGxRow->LinkEndChild(childGxFieldValue); + DOFREE(gxName); + DOFREE(gxId); + } + //ӼϢ + WriteLog(debug, ">>ʼӹλļϢ"); + addInspectionInformationWithVec(row, gxVec); + gx_detail->LinkEndChild(row); + } + WriteLog(debug, ">> ԴϢ"); + + for (int k = 0; k < child_cnt; k++) { + DOFREE(object_string); + tag_t gx_line = meop_lines[k], gx_rev = NULLTAG; + map overwrite; + + // Դ + { + add_bop_sublines(gx_line, raw_material_rev_tag, resource_detail, "Դ", "QF8ProcessRES", reource_index, child_configs2, overwrite); + } + // + { + add_bop_sublines(gx_line, raw_material_rev_tag, sup_detail, "ո", "QF8Ingredients", sup_index, child_configs3, overwrite); + } + // + /*{ + add_bop_sublines(gx_line, raw_material_rev_tag, material_detail, "", "!QF8ProcessRES;QF8Ingredients", material_index, child_configs4, overwrite); + }*/ + overwrite.clear(); + + } + + + } + else { + for (int k = 0; k < child_cnt; k++) { + DOFREE(object_string); + tag_t gx_line = meop_lines[k], gx_rev = NULLTAG; + ITKCALL(ifail = AOM_ask_value_string(gx_line, "object_string", &object_string)); + ITKCALL(ifail = AOM_ask_value_tag(gx_line, BL_REVISION, &gx_rev)); + + WriteLog(debug, ">> %d. ӹ [%s]", k + 1, object_string); + map overwrite; + string op_no, next_station,op_no_new; + if (k == -1) { + op_no.assign("START"); + } + else { + char* object_name = NULL; + ITKCALL(ifail = AOM_ask_value_string(gx_line, "bl_item_object_name", &object_name)); + op_no.assign(object_name); + DOFREE(object_name); + } + if (k == child_cnt - 1) { + next_station.assign("END"); + } + else { + /*char* object_name = NULL; + ITKCALL(ifail = AOM_ask_value_string(meop_lines[k + 1], "bl_item_object_name", &object_name)); + next_station.assign(object_name); + DOFREE(object_name);*/ + //20240319޸ + tag_t next_gx_rev = NULLTAG; + ITKCALL(ifail = AOM_ask_value_tag(meop_lines[k + 1], BL_REVISION, &next_gx_rev)); + char* prop_value = NULL; + int form_cnt = 0; + tag_t *formTag = NULL; + AOM_ask_value_tags(next_gx_rev, IMAN_MASTER_FORM_REV, &form_cnt, &formTag); + ITKCALL(ifail = AOM_UIF_ask_value(formTag[0], QF8GXBM, &prop_value)); + + if (ifail == ITK_ok) { + WriteLog(debug, " >> [%s] = [%s]", QF8GXBM, prop_value); + next_station.assign(prop_value); + } + DOFREE(prop_value); + DOFREE(formTag); + + } + //20240318 Ӻͻ op_nonext_stationǰ汾qf8gxbm + char* prop_value = NULL; + int form_cnt = 0; + tag_t *formTag = NULL; + AOM_ask_value_tags(gx_rev, IMAN_MASTER_FORM_REV, &form_cnt, &formTag); + ITKCALL(ifail = AOM_UIF_ask_value(formTag[0], QF8GXBM, &prop_value)); + + if (ifail == ITK_ok) { + WriteLog(debug, " >> [%s] = [%s]", QF8GXBM, prop_value); + op_no_new.assign(prop_value); + } + DOFREE(prop_value); + DOFREE(formTag); + + + overwrite.insert(make_pair("op_no", op_no_new));//20240318 Ӻͻ op_noǰ汾qf8gxbm + overwrite.insert(make_pair("opno", op_no)); + overwrite.insert(make_pair("op_name", op_no));//20240123 ֶop_name,ֵΪǰ + overwrite.insert(make_pair("next_station", next_station)); + // + { + // ӵһ + if (k == 0) { + map overwrite0; + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", "1"); + gx_detail->LinkEndChild(row); + overwrite0.insert(make_pair("op_no", "START")); + overwrite0.insert(make_pair("opno", "START")); + overwrite0.insert(make_pair("prepare_time", "0"));//20240315Ϊstartʱ׼ʱͼӹʱΪ0 + overwrite0.insert(make_pair("product_time", "0")); + overwrite.insert(make_pair("op_name", "ʼ"));//20240123 ֶop_name,ֵΪǰ + overwrite0.insert(make_pair("next_station", op_no_new));//20240318 Ӻͻ op_nonext_stationǰ汾qf8gxbm + read_data_sp(NULLTAG, NULLTAG, NULLTAG, child_configs1, row, overwrite0); + } + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", k + 2); + gx_detail->LinkEndChild(row); + read_data_sp(gx_line, NULLTAG, raw_material_rev_tag, child_configs1, row, overwrite); + + WriteLog(debug, ">> ʼӹļϢ"); + //ӼϢ + addInspectionInformationWithGxLine(row, gx_line); + + } + // Դ + { + add_bop_sublines(gx_line, raw_material_rev_tag, resource_detail, "Դ", "QF8ProcessRES", reource_index, child_configs2, overwrite); + } + // + { + add_bop_sublines(gx_line, raw_material_rev_tag, sup_detail, "ո", "QF8Ingredients", sup_index, child_configs3, overwrite); + } + // + /*{ + add_bop_sublines(gx_line, raw_material_rev_tag, material_detail, "", "!QF8ProcessRES;QF8Ingredients", material_index, child_configs4, overwrite); + }*/ + overwrite.clear(); + } + + } + // ԭ + if(raw_material_rev_tag!=NULLTAG){ + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", 1); + material_detail->LinkEndChild(row); + read_data_sp(bomline_tag, NULLTAG, raw_material_rev_tag, child_configs4, row, overwrite1); + } + //20240125ж͵ݼ + //TODO BOMץȥеĹգ͹λŵvectorУ֮ǰǷѾ + vector gyVec;//Źգ򣬹λļ + vector wlVec;//ϵļ + gyVec.push_back(rev_tag); + int exist = 2; + for (int k = 0; k < child_cnt; k++) { + DOFREE(object_string); + tag_t gx_line = meop_lines[k], gx_rev = NULLTAG; + ITKCALL(ifail = AOM_ask_value_tag(gx_line,BL_REVISION, &gx_rev)); + int gwCnt = 0; + tag_t* gwLines = NULL; + exist = hasElement(gyVec,gx_rev ); + if (exist==1) { + gyVec.push_back(gx_rev); + } + ITKCALL(ifail = BOM_line_ask_child_lines(gx_line, &gwCnt, &gwLines)); + for (int j = 0; j < gwCnt; j++) { + tag_t gwRev = NULL; + char *gwType = NULL; + ITKCALL(ifail = AOM_ask_value_tag(gwLines[j],BL_REVISION, &gwRev)); + ITKCALL(ifail = AOM_ask_value_string(gwRev,OBJECT_TYPE, &gwType)); + WriteLog(debug, ">> ͡%s", gwType); + + if (strcmp(MESTATIONREVISION, gwType) == 0) { + exist = hasElement(gyVec, gwRev); + if (exist == 1) { + gyVec.push_back(gwRev); + } + + } + } + } + //չĶwlRev + exist = hasElement(wlVec, wlRev); + if (exist == 1) { + wlVec.push_back(wlRev); + } + + tag_t bom_view = NULL; + tag_t bvr_tag = NULL; + tag_t bom_window = NULL; + tag_t topBomLine = NULL; + ITKCALL(ifail = GetBomView(wlRev, "view", &bom_view, &bvr_tag, debug)); + if (bom_view != NULLTAG) { + ITKCALL(ifail = BOM_create_window(&bom_window)); + ITKCALL(ifail = BOM_set_window_top_line_bvr(bom_window, bvr_tag, &topBomLine)); + loopWl(topBomLine, wlVec, gyVec); + ITKCALL(BOM_close_window(bom_window)); + } + else { + WriteLog(debug, "ûҵBOMͼ"); + // return ITK_err; + } + //ͣѡϴʲô͵ݼ + if (wlType == 11) { + for (int i = 0; i < gyVec.size(); i++) { + tag_t rev_tag = gyVec[i]; + ifail = add_bop_datasets_with11(rev_tag, sop_detail, sop_index); + if (ifail != ITK_ok) { + goto end; + } + + } + for (int i = 0; i < wlVec.size(); i++) { + tag_t rev_tag = wlVec[i]; + ifail = add_bop_datasets_with11(rev_tag, sop_detail, sop_index); + if (ifail != ITK_ok) { + goto end; + } + + } + + } + else if (wlType == 12 || wlType == 13) { + for (int i = 0; i < gyVec.size(); i++) { + tag_t rev_tag = gyVec[i]; + ifail = add_bop_datasets_with12(rev_tag, sop_detail, sop_index); + if (ifail != ITK_ok) { + goto end; + } + + } + for (int i = 0; i < wlVec.size(); i++) { + tag_t rev_tag = wlVec[i]; + ifail = add_bop_datasets_with12(rev_tag, sop_detail, sop_index); + if (ifail != ITK_ok) { + goto end; + } + + } + + } + else + // ļ + { + ifail = add_bop_datasets(bomline_tag, sop_detail, sop_index); + if (ifail != ITK_ok) { + goto end; + } + } + } +end: + meop_lines.clear(); + DOFREE(object_string); + return ifail; +} + +int add_map(map &map, string key, string value) { + int ifail = ITK_ok; + if (key.size() > 0 && map.count(key) == 0) { + map.insert(make_pair(key, value)); + } + return ifail; +} + +int read_bop_data(tag_t rev_tag, vector parent_configs, vector child_configs1, vector child_configs2, vector child_configs3, vector child_configs4, vector wl_data_configs, TiXmlElement* bom_data, TiXmlElement* wl_data, int& bomSeq, int& wlSeq, vector& added_wl, vector &added_lines) { + int ifail = ITK_ok, wl_cnt = 0; + tag_t bom_view = NULLTAG, bvr_tag = NULLTAG, bom_window = NULLTAG, topBomLine = NULLTAG, *wl_tags = NULL; + char* objectstring = NULL, *rev_uid = NULL, *object_type = NULL; + tag_t raw_material_rev_tag = NULLTAG; + ITKCALL(ifail = AOM_ask_value_string(rev_tag, "object_string", &objectstring)); + //д + ITKCALL(ifail = AOM_ask_value_tags(rev_tag, "IMAN_METarget", &wl_cnt, &wl_tags));//TODO 20240123 BOPϵ + int wlType = 0; + //20240123 жϹչװ䣨11ӣ12ӣ13 + tag_t wlRev = NULL; + char *objectId = NULL; + WriteLog(debug, "ȡBOP - %s", objectstring); + for(int i=0; i> ȡظ"); + continue; + } + added_wl.push_back(rev_uid); + TiXmlElement* row_gi = new TiXmlElement("row"); + row_gi->SetAttribute("seq", wlSeq); + wl_data->LinkEndChild(row_gi); + read_data(NULLTAG, wl_tag, NULLTAG, NULLTAG, wl_data_configs, row_gi); + wlSeq += 1; + // յĹIMAN_METargetĿΪQF8PartRevisionұqf8laiyuanΪƣȡQF8SCXXrelationϵQF8RawMaterialsRevisionͶϢ + if (strcmp("QF8PartRevision", object_type) == 0) { + tag_t* form_tags = NULL; + int form_cnt = 0; + ITKCALL(AOM_ask_value_tags(wl_tag, "IMAN_master_form_rev", &form_cnt, &form_tags)); + if (form_cnt > 0) { + char* value = NULL; + tag_t form_tag = form_tags[0]; + ITKCALL(ifail = AOM_UIF_ask_value(form_tag, "qf8laiyuan", &value)); + if (ifail == ITK_ok) { + WriteLog(debug, ">> qf8laiyuan = [%s]", value); + if (strcmp("", value) == 0) { + tag_t relation_tag = NULLTAG; + int child_cnt = 0; + tag_t* child_tags = NULL; + ITKCALL(ifail = GRM_find_relation_type("QF8SCXXrelation", &relation_tag)); + if (relation_tag == NULLTAG) { + EMH_store_error_s1(EMH_severity_error, ITK_err, "δϵQF8SCXXrelation"); + ifail = ITK_err; + goto end; + } + ITKCALL(ifail = GRM_list_secondary_objects_only(wl_tag, relation_tag, &child_cnt, &child_tags)); + WriteLog(debug, ">> ҵQF8SCXXrelationӶ%d", child_cnt); + for (int k = 0; k < child_cnt; k++) { + DOFREE(objectstring); + DOFREE(object_type); + tag_t child_tag = child_tags[k]; + ITKCALL(ifail = AOM_ask_value_string(child_tag, "object_string", &objectstring)); + ITKCALL(ifail = WSOM_ask_object_type2(child_tag, &object_type)); + WriteLog(debug, ">> %d. %s [%s]", k + 1, objectstring, object_type); + if (strcmp("QF8RawMaterialsRevision", object_type) == 0) { + raw_material_rev_tag = child_tag; + break; + } + } + DOFREE(child_tags); + } + } + DOFREE(value); + } + DOFREE(form_tags); + } + } + ITKCALL(ifail = GetBomView(rev_tag, "view", &bom_view, &bvr_tag, debug)); + if (bom_view != NULLTAG) { + ITKCALL(ifail = BOM_create_window(&bom_window)); + ITKCALL(ifail = BOM_set_window_top_line_bvr(bom_window, bvr_tag, &topBomLine)); + ifail = cycle_bop(topBomLine, raw_material_rev_tag, parent_configs, child_configs1, child_configs2, child_configs3, child_configs4, bom_data, bomSeq, added_lines,wlType, wlRev); + ITKCALL(BOM_close_window(bom_window)); + } + else { + WriteLog(debug, "ûҵBOMͼ"); + // return ITK_err; + } +end: + DOFREE(rev_uid); + DOFREE(wl_tags); + DOFREE(objectstring); + DOFREE(object_type); + return ifail; +} + +int getChildNodes(TiXmlNode* parent, const char* node_name, vector &children) { + TiXmlNode* cNode = NULL; + for (cNode = parent->FirstChildElement(); cNode; cNode = cNode->NextSiblingElement()) { + const char* cNodeName = cNode->ToElement()->Value(); + if (strcmp(node_name, cNodeName) != 0) { + continue; + } + children.push_back(cNode); + } + return ITK_ok; +} + +int parseResponse(string resp) { + int ifail = ITK_ok; + //string resp; + //resp.assign(U2G(respUTF.c_str())); + WriteLog(debug, "\nյݣ%s", resp.c_str()); + TiXmlDocument* doc = new TiXmlDocument(); + doc->Parse(resp.c_str(), 0, TIXML_DEFAULT_ENCODING); + TiXmlElement* response = doc->RootElement(); + if (!response) { + WriteLog(debug, "δҵڵ"); + EMH_store_error_s1(EMH_severity_error, ITK_err, "޷ERPӿڷϢ"); + return ITK_err; + } + vector payloads, params, data_responses, datainfos; + getChildNodes(response, "payload", payloads); + for (TiXmlNode * payload : payloads) + { + getChildNodes(payload, "param", params); + } + for (TiXmlNode* param : params) + { + getChildNodes(param, "data_response", data_responses); + } + for (TiXmlNode* data_response : data_responses) + { + getChildNodes(data_response, "datainfo", datainfos); + } + if (datainfos.size() <= 0) { + WriteLog(debug, "δҵdatainfoڵ"); + EMH_store_error_s1(EMH_severity_error, ITK_err, "޷ERPӿڷϢ"); + return ITK_err; + } + // WriteLog(debug, "XXXXXXXXXXXXXXXX"); + for (TiXmlNode* datainfo : datainfos) + { + string status; + string message; + TiXmlNode* cNode = NULL; + for (cNode = datainfo->FirstChildElement(); cNode; cNode = cNode->NextSiblingElement()) { + const char* cNodeName = cNode->ToElement()->Value(); + if (strcmp("parameter", cNodeName) != 0) { + continue; + } + const char* key = cNode->ToElement()->Attribute("key"); + const char* text = cNode->ToElement()->GetText(); + if (key == NULL || text == NULL) { + continue; + } + if (strcmp("Status", key) == 0) { + status.assign(text); + } + else if (strcmp("Message", key) == 0) { + message.assign(U2G(text)); + } + } + WriteLog(debug, "status [%s] message [%s]", status.c_str(), message.c_str()); + if (strcmp("0", status.c_str()) != 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ERPӿڷشϢ", message.size() > 0 ? message.c_str() : "޴"); + ifail = ITK_err; + } + } + return ifail; +} +/* +*ѭܹʱ +*top_bom_line_tag ѭIJ㼶 +*totalGs ܹʱ +*/ +int Loop_BOM_count_totalGs(tag_t top_bom_line_tag, double &totalGs) +{ + tag_t rev_tag; int ifail = 0; + int child_count = 0; tag_t *child_tags = NULLTAG; + ITKCALL(ifail = BOM_line_ask_all_child_lines(top_bom_line_tag, &child_count, &child_tags)); + int form_nums = 0; + tag_t *form_tags = NULLTAG; + for (int n = 0; n= 0; i--) { + if (str[i] == '\0') continue; + + if (i == 0) return; + //С˳ + if (str[i] == '.') { + return; + } + + if (str[i] != '0') return; + + //СһλҲ㣬0Ͳȥ + if (str[i] == '0' && str[i - 1] != '0') { + if (str[i - 1] == '.') { + return; + } + str[i] = '\0'; + //return; + } + // + if (str[i] == '0') { + str[i] = '\0'; + } + } +} +/* +*ܹʱ +*revTag ѭIJ㼶 +*fieldX xmlڵ +*/ +void addZgs(tag_t revTag, TiXmlElement* fieldX) { + int BOPcnt = 0; + tag_t *BOPtags = NULL; + ITKCALL(AOM_ask_value_tags(revTag, QF8BOPRELATION, &BOPcnt, &BOPtags)); + int formCnt = 0; + tag_t *formTags = NULL; + char* gxType = NULL; + char* gyType = NULL; + char *zbgs = NULL; + char *jggs = NULL; + double zbgsDouble = 0; + int ifail = 0; + double totalGs = 0; + double jggsDouble = 0; + //ѭв㼶Ϲϵ׼ʱͼӹʱۼΪܹʱ + for (int j = 0; j < BOPcnt; j++) { + zbgsDouble = 0; + jggsDouble = 0; + tag_t gyTag = BOPtags[j]; + AOM_ask_value_string(gyTag, OBJECT_TYPE, &gyType); + if (tc_strcmp(gyType, QF8GYREVISION) == 0) { + int bom_num = 0; + tag_t * bom_tags = NULLTAG; + AOM_ask_value_tags(gyTag, STRUCTURE_REVISIONS, &bom_num, &bom_tags); + if (bom_num>0) + { + tag_t only_bom = bom_tags[0]; + tag_t bom_window_tag = NULLTAG, top_bom_line_tag = NULLTAG, rev_tag = NULLTAG, item_tag = NULLTAG; + ITKCALL(ifail = BOM_create_window(&bom_window_tag)); + ITKCALL(ifail = BOM_set_window_top_line_bvr(bom_window_tag, only_bom, &top_bom_line_tag)); + //ѭ + Loop_BOM_count_totalGs(top_bom_line_tag, totalGs); + ITKCALL(ifail = BOM_close_window(bom_window_tag));//пй + } + DOFREE(bom_tags); + } + } + //õ汾 + cout << "ܹʱӣ"<SetAttribute("name", FIXED_LEAD_TIME_M);//ݵ׼ʱ + field->SetAttribute("type", "string"); + //20240307ʱȡܹʱ + set_xml_value(field, zgsStr); + //fieldX->LinkEndChild(field);//20241202ʱȡ + DOFREE(BOPtags); + DOFREE(formTags); + DOFREE(zbgs); + DOFREE(jggs); + DOFREE(gxType); +} +/* +*Ӳֶֿ +*revTag ϶ +*fieldX xmlڵ +*/ + +void addCk(tag_t revTag, TiXmlElement* fieldX) { + WriteLog(debug, "Ӳֶֿ"); + tag_t ico_tag = NULLTAG, cls_tag = NULLTAG; + long classId = 0;//id + string laiyuan = "";//Դ + int ifail = 0; + ITKCALL(ifail = ICS_ask_classification_object(revTag, &ico_tag)); + if (ico_tag != NULLTAG) { + ITKCALL(ifail = ICS_ask_class_of_classification_obj(ico_tag, &cls_tag)); + if (cls_tag != NULLTAG) { + char* cls_id = NULL, *cls_name = NULL; + ITKCALL(ifail = ICS_ask_id_name(cls_tag, &cls_id, &cls_name)); + if (ifail == ITK_ok) { + classId = atoll(cls_id); + } + DOFREE(cls_id); + DOFREE(cls_name); + } + } + //ȡ汾ϵԴqf8laiyuan + int formCnt = 0; tag_t *formTag = NULL; + AOM_ask_value_tags(revTag, IMAN_MASTER_FORM_REV, &formCnt, &formTag); + char *qf8laiyuan = NULL; + AOM_UIF_ask_value(formTag[0], QF8LAIYUAN, &qf8laiyuan); + laiyuan = qf8laiyuan; + DOFREE(formTag); + DOFREE(qf8laiyuan); + //۲ֿ + string ck = "";//ֿ + WriteLog(debug, "=Դ==%s==", laiyuan); + //20240328 ĬϲֿãID=111213 Դ=裬1002 + if (classId == 11 || classId == 12) { + if (tc_strcmp(laiyuan.c_str(), ZIZHI) == 0 || tc_strcmp(laiyuan.c_str(), WAIGOU) == 0|| tc_strcmp(laiyuan.c_str(), XUSHE) == 0) { + ck = CK1002; + } + } + else if (classId == 13) { + if (tc_strcmp(laiyuan.c_str(), ZIZHI) == 0 || tc_strcmp(laiyuan.c_str(), XUSHE) == 0) { + ck = CK1002; + } + else if (tc_strcmp(laiyuan.c_str(), WAIGOU) == 0) { + ck = CK1001; + } + } + else if (classId >= 100101 && classId <= 100999) { + if (tc_strcmp(laiyuan.c_str(), ZIZHI) == 0 || tc_strcmp(laiyuan.c_str(), WAIGOU) == 0) { + ck = CK1003; + } + } + else if ((classId >= 1501 && classId <= 2599) || (classId >= 150101 && classId <= 259999)) { + if (tc_strcmp(laiyuan.c_str(), WAIGOU) == 0) { + ck = CK1001; + } + } + TiXmlElement* field = new TiXmlElement("field"); + field->SetAttribute("name", INBOUND_WAREHOUSE_CODE); + field->SetAttribute("type", "string"); + set_xml_value(field, ck.c_str()); + TiXmlElement* field2 = new TiXmlElement("field"); + field2->SetAttribute("name", OUTBOUND_WAREHOUSE_CODE); + field2->SetAttribute("type", "string"); + set_xml_value(field2, ck.c_str()); + fieldX->LinkEndChild(field); + fieldX->LinkEndChild(field2); +} +int QF_ERP_wl(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, task_count = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL, * propvalue = NULL, * objectstring = NULL, * task_name = NULL, * task_type = NULL; + char* user_id = NULL, * user_name = NULL; + tag_t task_tag = NULLTAG, rootTask_tag = NULLTAG, user_tag = NULLTAG; + tag_t * task_tags = NULL; + bool bypass = false; + + vector target_tags; + char* log_file_path; + FILE* LOG; + vector gi_configs, pli_configs; + vector pref_values, target_types; + + /** + * 0=endpoint + * 1=host prod + * 2=host ver + * 3=host ip + * 4=host lang + * 5=host acct + * 6=service prod + * 7=service name + * 8=service ip + * 9=param product name + * 10=param template name + * ѡ11=host id + * ѡ12=service id + */ + string end_point, host_prod, host_ver, host_ip, host_lang, host_acct; + string service_prod, service_name, service_ip; + string param_productname, param_template_name, param_import_data; + + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "bypass") == 0) { + bypass = true; + } + else if (strcmp(argflag, "include_type") == 0) { + Split(argvalue, ";", target_types); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + ITKCALL(POM_get_user(&user_name, &user_tag)); + ITKCALL(SA_ask_user_identifier2(user_tag, &user_id)); + if (debug) { + initUserDir(user_id); + CreateUserFile(debug, "QF_ERP_wl", user_id, &log_file_path, &LOG); + printf("־ļ·%s\n", log_file_path); + } + DOFREE(user_id); + WriteLog(debug, "============================================================="); + WriteLog(debug, "ʼִУQF_ERP_wl"); + WriteLog(debug, "============================================================="); + + WriteToFile(LOG, "START"); + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + if (bypass) { + POM_AM__set_application_bypass(true); + } + ifail = getAllTargetRevs(task_tag, target_tags, target_types); + if (target_tags.size() == 0) { + WriteToFile(LOG, "TARGET NOT FOUND"); + WriteLog(debug, "δҵҪݵĶ"); + goto end; + } + //ѡ + { + vector gi_prefs, pli_prefs; + ifail = getPrefStrings(PREF_ERP_WL, TC_preference_site, pref_values); + if (pref_values.size() < 11) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_WL); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_WL_GI, TC_preference_site, gi_prefs); + parseErpConfigs(gi_prefs, 0, gi_configs); + if (gi_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_WL_GI); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_WL_PLI, TC_preference_site, pli_prefs); + parseErpConfigs(pli_prefs, 0, pli_configs); + if (pli_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_WL_PLI); + ifail = ITK_err; + goto end; + } + } + // xml + { + char date_string[20]; + struct tm* p; + time_t now; + time(&now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d%03d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, getCurrentMilliSeconds()); + + TiXmlDocument* doc = new TiXmlDocument(); + + TiXmlElement* host = new TiXmlElement("host"); + TiXmlElement* service = new TiXmlElement("service"); + host->SetAttribute("prod", pref_values[1].c_str()); + host->SetAttribute("ver", pref_values[2].c_str()); + host->SetAttribute("ip", pref_values[3].c_str()); + host->SetAttribute("id", pref_values.size()>11?pref_values[11].c_str():""); + host->SetAttribute("lang", pref_values[4].c_str()); + host->SetAttribute("timestamp", date_string); + host->SetAttribute("acct", pref_values[5].c_str()); + service->SetAttribute("prod", pref_values[6].c_str()); + service->SetAttribute("name", pref_values[7].c_str()); + service->SetAttribute("ip", pref_values[8].c_str()); + service->SetAttribute("id", pref_values.size() > 12 ? pref_values[12].c_str() : ""); + + TiXmlElement* request = new TiXmlElement("request"); + request->SetAttribute("type", "sync"); + string host_service_str; + TiXmlPrinter host_printer, service_printer; + host->Accept(&host_printer); + host_service_str.append(trim(host_printer.CStr())); + service->Accept(&service_printer); + host_service_str.append(trim(service_printer.CStr())); + + //unsigned char buffer[2048]; + //memcpy(buffer, host_service_str.c_str(), host_service_str.size()); + WriteLog(debug, "Get MD5 From \"%s\"", host_service_str.c_str()); + request->SetAttribute("key", str2md5(host_service_str).c_str()); + + doc->LinkEndChild(request); + request->LinkEndChild(host); + request->LinkEndChild(service); + TiXmlElement* payload = new TiXmlElement("payload"); + request->LinkEndChild(payload); + TiXmlElement* param = new TiXmlElement("param"); + param->SetAttribute("key", "std_data"); + param->SetAttribute("type", "xml"); + payload->LinkEndChild(param); + TiXmlElement* data_request = new TiXmlElement("data_request"); + param->LinkEndChild(data_request); + TiXmlElement* datainfo = new TiXmlElement("datainfo"); + data_request->LinkEndChild(datainfo); + TiXmlElement* param1 = new TiXmlElement("parameter"); + param1->SetAttribute("key", "productName"); + param1->SetAttribute("type", "string"); + set_xml_value(param1, pref_values[9].c_str()); + datainfo->LinkEndChild(param1); + TiXmlElement* param2 = new TiXmlElement("parameter"); + param2->SetAttribute("key", "templateName"); + param2->SetAttribute("type", "string"); + set_xml_value(param2, pref_values[10].c_str()); + datainfo->LinkEndChild(param2); + TiXmlElement* param3 = new TiXmlElement("parameter"); + param3->SetAttribute("key", "importData"); + param3->SetAttribute("type", "data"); + datainfo->LinkEndChild(param3); + TiXmlElement* data = new TiXmlElement("data"); + data->SetAttribute("name", "ITEM"); + param3->LinkEndChild(data); + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", 1); + data->LinkEndChild(row); + TiXmlElement* detail_gi = new TiXmlElement("detail"); + detail_gi->SetAttribute("name", "GI"); + row->LinkEndChild(detail_gi); + for (int i = 0; i < target_tags.size(); i++) { + TiXmlElement* row_gi = new TiXmlElement("row"); + row_gi->SetAttribute("seq", i + 1); + detail_gi->LinkEndChild(row_gi); + ifail = read_data(NULLTAG, target_tags[i], NULLTAG, NULLTAG, gi_configs, row_gi); + if (ifail != ITK_ok) { + goto end; + } + } + TiXmlElement* detail_pli = new TiXmlElement("detail"); + detail_pli->SetAttribute("name", "PLI"); + row->LinkEndChild(detail_pli); + for (int i = 0; i < target_tags.size(); i++) { + TiXmlElement* row_pli = new TiXmlElement("row"); + row_pli->SetAttribute("seq", i + 1); + detail_pli->LinkEndChild(row_pli); + ifail = read_data(NULLTAG, target_tags[i], NULLTAG, NULLTAG, pli_configs, row_pli); + if (ifail != ITK_ok) { + goto end; + } + //TODO 20240118 pliֶܹʱ + WriteToFile(LOG, "ʼpliܹʱ"); + addZgs(target_tags[i], row_pli); + //TODO 20240116 ڲֶֿ⴦ + addCk(target_tags[i], row_pli); + } + TiXmlPrinter doc_printer; + doc->Accept(&doc_printer); + if (LOG) { + WriteToFile(LOG, ""); + WriteToFile(LOG, doc_printer.CStr()); + } + soap* soap = soap_new(); + soap_init(soap); + soap_register_plugin(soap, plugin); + soap_set_mode(soap, SOAP_C_UTFSTRING); + _WS1__invokeSrv* soapReq = new _WS1__invokeSrv(); + soapReq->soap_default(soap); + soapReq->in0.assign(doc_printer.CStr()); + _WS1__invokeSrvResponse response; + ifail = soap_call___WS1__invokeSrv(soap, pref_values[0].c_str(), NULL, soapReq, response); + WriteToFile(LOG, "REQUEST SENT"); + if (ifail == SOAP_OK) { + if (LOG) { + WriteToFile(LOG, "RETURN DATA"); + WriteToFile(LOG, response.invokeSrvReturn.c_str()); + } + ifail = parseResponse(response.invokeSrvReturn); + } + else { + WriteLog(debug, "ýӿ쳣%d", ifail); + soap_print_fault(soap, stderr); + ifail = ITK_err; + EMH_store_error_s1(EMH_severity_error, ITK_err, "ýӿʧ"); + } + soap_destroy(soap); + soap_done(soap); + //ifail = parseResponse(" 019 ƽ̨ͬ 99299d70-ce98-43d3-890b-0c2331f04ca7 2.0 000 1 ʧϢ "); + } + +end: + POM_AM__set_application_bypass(false); + WriteToFile(LOG, "FINISH"); + target_tags.clear(); + if (LOG) + { + fclose(LOG); + LOG = NULL; + } + target_types.clear(); + gi_configs.clear(); + pli_configs.clear(); + pref_values.clear(); + WriteLog(debug, "============================================================="); + WriteLog(debug, "ִнQF_ERP_wl"); + WriteLog(debug, "============================================================="); + return ifail; +} + + +int QF_ERP_BOM(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, task_count = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL, * propvalue = NULL, * objectstring = NULL, * task_name = NULL, * task_type = NULL; + char* user_id = NULL, * user_name = NULL; + tag_t task_tag = NULLTAG, rootTask_tag = NULLTAG, user_tag = NULLTAG; + tag_t* task_tags = NULL; + bool bypass = false; + bool has_err = false; + vector target_tags; + char* log_file_path; + FILE* LOG; + vector parent_configs, child_configs, zz_parent_configs, zz_child_configs, gi_configs, pli_configs; + vector target_types; + vector wl_pref_values, bom_pref_values; + TiXmlDocument* bom_doc = new TiXmlDocument(); + TiXmlDocument* wl_doc = new TiXmlDocument(); + TiXmlElement* bom_data, *wl_pli, *wl_gi; + /** + * 0=endpoint + * 1=host prod + * 2=host ver + * 3=host ip + * 4=host lang + * 5=host acct + * 6=service prod + * 7=service name + * 8=service ip + * 9=param product name + * 10=param template name + * ѡ11=host id + * ѡ12=service id + */ + string end_point, host_prod, host_ver, host_ip, host_lang, host_acct; + string service_prod, service_name, service_ip; + string param_productname, param_template_name, param_import_data; + vector added_lines; + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "bypass") == 0) { + bypass = true; + } + else if (strcmp(argflag, "include_type") == 0) { + Split(argvalue, ";", target_types); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + ITKCALL(POM_get_user(&user_name, &user_tag)); + ITKCALL(SA_ask_user_identifier2(user_tag, &user_id)); + if (debug) { + initUserDir(user_id); + CreateUserFile(debug, "QF_ERP_BOM", user_id, &log_file_path, &LOG); + printf("־ļ·%s\n", log_file_path); + } + DOFREE(user_id); + WriteLog(debug, "============================================================="); + WriteLog(debug, "ʼִУQF_ERP_BOM"); + WriteLog(debug, "============================================================="); + + WriteToFile(LOG, "START"); + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + if (bypass) { + POM_AM__set_application_bypass(true); + } + ifail = getAllTargetRevs(task_tag, target_tags, target_types); + if (target_tags.size() == 0) { + WriteToFile(LOG, "TARGET NOT FOUND"); + WriteLog(debug, "δҵҪݵĶ"); + goto end; + } + //ѡ + { + vector gi_prefs, pli_prefs; + ifail = getPrefStrings(PREF_ERP_WL, TC_preference_site, wl_pref_values); + if (wl_pref_values.size() < 11) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_WL); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_WL_GI, TC_preference_site, gi_prefs); + parseErpConfigs(gi_prefs, 0, gi_configs); + if (gi_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_WL_GI); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_WL_PLI, TC_preference_site, pli_prefs); + parseErpConfigs(pli_prefs, 0, pli_configs); + if (pli_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_WL_PLI); + ifail = ITK_err; + goto end; + } + } + //BOMѡ + { + vector parent_prefs, child_prefs, zz_parent_prefs, zz_child_prefs; + ifail = getPrefStrings(PREF_ERP_BOM, TC_preference_site, bom_pref_values); + if (bom_pref_values.size() < 11) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_BOM); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_BOM_PARENT, TC_preference_site, parent_prefs); + parseErpConfigs(parent_prefs, 0, parent_configs); + if (parent_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_BOM_PARENT); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_BOM_CHILD, TC_preference_site, child_prefs); + parseErpConfigs(child_prefs, 0, child_configs); + if (child_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_BOM_CHILD); + ifail = ITK_err; + goto end; + } + + ifail = getPrefStrings(PREF_ERP_BOM_PARENT_ZZ, TC_preference_site, zz_parent_prefs); + parseErpConfigs(zz_parent_prefs, 0, zz_parent_configs); + if (zz_parent_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_BOM_PARENT_ZZ); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_ERP_BOM_CHILD_ZZ, TC_preference_site, zz_child_prefs); + parseErpConfigs(zz_child_prefs, 0, zz_child_configs); + if (zz_child_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_ERP_BOM_CHILD_ZZ); + ifail = ITK_err; + goto end; + } + } + // xml + { + char date_string[20]; + struct tm* p; + time_t now; + time(&now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d%03d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, getCurrentMilliSeconds()); + + TiXmlElement* host = new TiXmlElement("host"); + TiXmlElement* service = new TiXmlElement("service"); + host->SetAttribute("prod", wl_pref_values[1].c_str()); + host->SetAttribute("ver", wl_pref_values[2].c_str()); + host->SetAttribute("ip", wl_pref_values[3].c_str()); + host->SetAttribute("id", wl_pref_values.size() > 11 ? wl_pref_values[11].c_str() : ""); + host->SetAttribute("lang", wl_pref_values[4].c_str()); + host->SetAttribute("timestamp", date_string); + host->SetAttribute("acct", wl_pref_values[5].c_str()); + service->SetAttribute("prod", wl_pref_values[6].c_str()); + service->SetAttribute("name", wl_pref_values[7].c_str()); + service->SetAttribute("ip", wl_pref_values[8].c_str()); + service->SetAttribute("id", wl_pref_values.size() > 12 ? wl_pref_values[12].c_str() : ""); + + TiXmlElement* request = new TiXmlElement("request"); + request->SetAttribute("type", "sync"); + string host_service_str; + TiXmlPrinter host_printer, service_printer; + host->Accept(&host_printer); + host_service_str.append(trim(host_printer.CStr())); + service->Accept(&service_printer); + host_service_str.append(trim(service_printer.CStr())); + + //unsigned char buffer[2048]; + //memcpy(buffer, host_service_str.c_str(), host_service_str.size()); + WriteLog(debug, "Get MD5 From \"%s\"", host_service_str.c_str()); + request->SetAttribute("key", str2md5(host_service_str).c_str()); + + wl_doc->LinkEndChild(request); + request->LinkEndChild(host); + request->LinkEndChild(service); + TiXmlElement* payload = new TiXmlElement("payload"); + request->LinkEndChild(payload); + TiXmlElement* param = new TiXmlElement("param"); + param->SetAttribute("key", "std_data"); + param->SetAttribute("type", "xml"); + payload->LinkEndChild(param); + TiXmlElement* data_request = new TiXmlElement("data_request"); + param->LinkEndChild(data_request); + TiXmlElement* datainfo = new TiXmlElement("datainfo"); + data_request->LinkEndChild(datainfo); + TiXmlElement* param1 = new TiXmlElement("parameter"); + param1->SetAttribute("key", "productName"); + param1->SetAttribute("type", "string"); + set_xml_value(param1, wl_pref_values[9].c_str()); + datainfo->LinkEndChild(param1); + TiXmlElement* param2 = new TiXmlElement("parameter"); + param2->SetAttribute("key", "templateName"); + param2->SetAttribute("type", "string"); + set_xml_value(param2, wl_pref_values[10].c_str()); + datainfo->LinkEndChild(param2); + TiXmlElement* param3 = new TiXmlElement("parameter"); + param3->SetAttribute("key", "importData"); + param3->SetAttribute("type", "data"); + datainfo->LinkEndChild(param3); + TiXmlElement* data = new TiXmlElement("data"); + data->SetAttribute("name", "ITEM"); + param3->LinkEndChild(data); + TiXmlElement* row = new TiXmlElement("row"); + row->SetAttribute("seq", 1); + data->LinkEndChild(row); + wl_gi = new TiXmlElement("detail"); + wl_gi->SetAttribute("name", "GI"); + row->LinkEndChild(wl_gi); + /*for (int i = 0; i < target_tags.size(); i++) { + TiXmlElement* row_gi = new TiXmlElement("row"); + row_gi->SetAttribute("seq", i + 1); + detail_gi->LinkEndChild(row_gi); + ifail = read_data(NULLTAG, target_tags[i], gi_configs, row_gi); + if (ifail != ITK_ok) { + goto end; + } + }*/ + wl_pli = new TiXmlElement("detail"); + wl_pli->SetAttribute("name", "PLI"); + row->LinkEndChild(wl_pli); + /*for (int i = 0; i < target_tags.size(); i++) { + TiXmlElement* row_pli = new TiXmlElement("row"); + row_pli->SetAttribute("seq", i + 1); + detail_pli->LinkEndChild(row_pli); + ifail = read_data(NULLTAG, target_tags[i], pli_configs, row_pli); + if (ifail != ITK_ok) { + goto end; + } + }*/ + } + + // BOMxml + { + char date_string[20]; + struct tm* p; + time_t now; + time(&now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d%03d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, getCurrentMilliSeconds()); + + + + TiXmlElement* host = new TiXmlElement("host"); + TiXmlElement* service = new TiXmlElement("service"); + host->SetAttribute("prod", bom_pref_values[1].c_str()); + host->SetAttribute("ver", bom_pref_values[2].c_str()); + host->SetAttribute("ip", bom_pref_values[3].c_str()); + host->SetAttribute("id", bom_pref_values.size() > 11 ? bom_pref_values[11].c_str() : ""); + host->SetAttribute("lang", bom_pref_values[4].c_str()); + host->SetAttribute("timestamp", date_string); + host->SetAttribute("acct", bom_pref_values[5].c_str()); + service->SetAttribute("prod", bom_pref_values[6].c_str()); + service->SetAttribute("name", bom_pref_values[7].c_str()); + service->SetAttribute("ip", bom_pref_values[8].c_str()); + service->SetAttribute("id", bom_pref_values.size() > 12 ? bom_pref_values[12].c_str() : ""); + + TiXmlElement* request = new TiXmlElement("request"); + request->SetAttribute("type", "sync"); + string host_service_str; + TiXmlPrinter host_printer, service_printer; + + host->Accept(&host_printer); + host_service_str.append(trim(host_printer.CStr())); + + service->Accept(&service_printer); + host_service_str.append(trim(service_printer.CStr())); + + //unsigned char buffer[2048]; + //memcpy(buffer, host_service_str.c_str(), host_service_str.size()); + WriteLog(debug, "Get MD5 From \"%s\"", host_service_str.c_str()); + request->SetAttribute("key", str2md5(host_service_str).c_str()); + + + bom_doc->LinkEndChild(request); + request->LinkEndChild(host); + request->LinkEndChild(service); + TiXmlElement* payload = new TiXmlElement("payload"); + request->LinkEndChild(payload); + TiXmlElement* param = new TiXmlElement("param"); + param->SetAttribute("key", "std_data"); + param->SetAttribute("type", "xml"); + payload->LinkEndChild(param); + TiXmlElement* data_request = new TiXmlElement("data_request"); + param->LinkEndChild(data_request); + TiXmlElement* datainfo = new TiXmlElement("datainfo"); + data_request->LinkEndChild(datainfo); + TiXmlElement* param1 = new TiXmlElement("parameter"); + param1->SetAttribute("key", "productName"); + param1->SetAttribute("type", "string"); + set_xml_value(param1, bom_pref_values[9].c_str()); + datainfo->LinkEndChild(param1); + TiXmlElement* param2 = new TiXmlElement("parameter"); + param2->SetAttribute("key", "templateName"); + param2->SetAttribute("type", "string"); + set_xml_value(param2, bom_pref_values[10].c_str()); + datainfo->LinkEndChild(param2); + TiXmlElement* param3 = new TiXmlElement("parameter"); + param3->SetAttribute("key", "importData"); + param3->SetAttribute("type", "data"); + datainfo->LinkEndChild(param3); + bom_data = new TiXmlElement("data"); + bom_data->SetAttribute("name", "BOM"); + param3->LinkEndChild(bom_data); + + } + //ȡ + { + int bomSeq = 1, wlSeq = 1; + for (int i = 0; i < target_tags.size(); i++) { + ifail = read_bom_data(target_tags[i], parent_configs, child_configs, zz_parent_configs, zz_child_configs, pli_configs, gi_configs, bom_data, wl_pli, wl_gi, bomSeq, wlSeq, added_lines); + if (ifail != ITK_ok) { + goto end; + } + } + } + + { + TiXmlPrinter bom_doc_printer; + bom_doc->Accept(&bom_doc_printer); + + TiXmlPrinter wl_doc_printer; + wl_doc->Accept(&wl_doc_printer); + + soap* soap = soap_new(); + soap_init(soap); + soap_register_plugin(soap, plugin); + soap_set_mode(soap, SOAP_C_UTFSTRING); + + + //BOM + { + if (LOG) { + WriteToFile(LOG, "SEND BOM"); + WriteToFile(LOG, bom_doc_printer.CStr()); + } + _WS1__invokeSrv* soapReq = new _WS1__invokeSrv(); + soapReq->soap_default(soap); + soapReq->in0.assign(bom_doc_printer.CStr()); + _WS1__invokeSrvResponse response; + WriteToFile(LOG, "..."); + ifail = soap_call___WS1__invokeSrv(soap, bom_pref_values[0].c_str(), NULL, soapReq, response); + WriteToFile(LOG, "REQUEST SENT"); + if (ifail == SOAP_OK) { + if (LOG) { + WriteToFile(LOG, "RETURN DATA"); + WriteToFile(LOG, response.invokeSrvReturn.c_str()); + } + ifail = parseResponse(response.invokeSrvReturn); + } + else { + WriteLog(debug, "ýӿ쳣%d", ifail); + soap_print_fault(soap, stderr); + ifail = ITK_err; + EMH_store_error_s1(EMH_severity_error, ITK_err, "ýӿʧ"); + } + if (ifail != ITK_ok) { + has_err = true; + } + } + // + { + if (LOG) { + WriteToFile(LOG, "SEND WL"); + WriteToFile(LOG, wl_doc_printer.CStr()); + } + _WS1__invokeSrv* soapReq = new _WS1__invokeSrv(); + soapReq->soap_default(soap); + soapReq->in0.assign(wl_doc_printer.CStr()); + _WS1__invokeSrvResponse response; + WriteToFile(LOG, "..."); + ifail = soap_call___WS1__invokeSrv(soap, wl_pref_values[0].c_str(), NULL, soapReq, response); + WriteToFile(LOG, "REQUEST SENT"); + if (ifail == SOAP_OK) { + if (LOG) { + WriteToFile(LOG, "RETURN DATA"); + WriteToFile(LOG, response.invokeSrvReturn.c_str()); + } + ifail = parseResponse(response.invokeSrvReturn); + } + else { + WriteLog(debug, "ýӿ쳣%d", ifail); + soap_print_fault(soap, stderr); + ifail = ITK_err; + EMH_store_error_s1(EMH_severity_error, ITK_err, "ýӿʧ"); + } + if (ifail != ITK_ok) { + has_err = true; + } + } + + soap_destroy(soap); + soap_done(soap); + //ifail = parseResponse(" 019 ƽ̨ͬ 99299d70-ce98-43d3-890b-0c2331f04ca7 2.0 000 1 ʧϢ "); + } + +end: + POM_AM__set_application_bypass(false); + WriteToFile(LOG, "FINISH"); + target_tags.clear(); + if (LOG) + { + fclose(LOG); + LOG = NULL; + } + if (has_err) { + ifail = ITK_err; + } + target_types.clear(); + parent_configs.clear(); + child_configs.clear(); + zz_parent_configs.clear(); + zz_child_configs.clear(); + gi_configs.clear(); + pli_configs.clear(); + bom_pref_values.clear(); + wl_pref_values.clear(); + added_lines.clear(); + WriteLog(debug, "============================================================="); + WriteLog(debug, "ִнQF_ERP_BOM"); + WriteLog(debug, "============================================================="); + return ifail; +} + + +int QF_ERP_BOP(EPM_action_message_t msg) { + int ifail = ITK_ok, arg_cnt = 0, task_count = 0; + char* arg = NULL, * argflag = NULL, * argvalue = NULL, * propvalue = NULL, * objectstring = NULL, * task_name = NULL, * task_type = NULL; + char* user_id = NULL, * user_name = NULL; + tag_t task_tag = NULLTAG, rootTask_tag = NULLTAG, user_tag = NULLTAG; + tag_t* task_tags = NULL; + bool bypass = false; + bool has_err = false; + vector target_tags; + char* log_file_path; + FILE* LOG; + vector parent_configs, child_configs1, child_configs2, child_configs3, child_configs4, wl_data_configs; + vector wl_pref_values, bom_pref_values, target_types; + TiXmlDocument* bom_doc = new TiXmlDocument(); + TiXmlDocument* wl_doc = new TiXmlDocument(); + TiXmlElement* bom_data, * wl_data; + vector added_lines; + string end_point, host_prod, host_ver, host_ip, host_lang, host_acct; + string service_prod, service_name, service_ip; + string param_productname, param_template_name, param_import_data; + + arg_cnt = TC_number_of_arguments(msg.arguments); + if (arg_cnt > 0) { + for (int i = 0; i < arg_cnt; i++) { + arg = TC_next_argument(msg.arguments); + ITKCALL(ifail = ITK_ask_argument_named_value(arg, &argflag, &argvalue)); + if (strcmp(argflag, "bypass") == 0) { + bypass = true; + } + else if (strcmp(argflag, "include_type") == 0) { + Split(argvalue, ";", target_types); + } + MEM_free(argflag); + MEM_free(argvalue); + } + } + ITKCALL(POM_get_user(&user_name, &user_tag)); + ITKCALL(SA_ask_user_identifier2(user_tag, &user_id)); + if (debug) { + initUserDir(user_id); + CreateUserFile(debug, "QF_ERP_BOP", user_id, &log_file_path, &LOG); + printf("־ļ·%s\n", log_file_path); + } + DOFREE(user_id); + WriteLog(debug, "============================================================="); + WriteLog(debug, "ʼִУQF_ERP_BOP"); + WriteLog(debug, "============================================================="); + + WriteToFile(LOG, "START"); + task_tag = msg.task; + if (task_tag == NULLTAG) { + goto end; + } + if (bypass) { + POM_AM__set_application_bypass(true); + } + ifail = getAllTargetRevs(task_tag, target_tags, target_types); + if (target_tags.size() == 0) { + WriteToFile(LOG, "TARGET NOT FOUND"); + WriteLog(debug, "δҵҪݵĶ"); + goto end; + } + // ļѡ + ftp_dir.clear(); + local_dir.clear(); + { + vector data_prefs; + ifail = getPrefStrings(PREF_FTP_PATH, TC_preference_site, data_prefs); + if (data_prefs.size() == 2) { + ftp_dir.assign(data_prefs[0]); + local_dir.assign(data_prefs[1]); + } + data_prefs.clear(); + } + WriteLog(debug, "ftp·%s", ftp_dir.c_str()); + WriteLog(debug, "·%s", local_dir.c_str()); + if (ftp_dir.size() == 0 || local_dir.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_FTP_PATH); + ifail = ITK_err; + goto end; + } + if (!std::experimental::filesystem::is_directory(local_dir)) { + WriteLog(debug, "½Ŀ¼"); + if (std::experimental::filesystem::create_directories(local_dir)) { + WriteLog(debug, "½"); + } + else { + WriteLog(debug, "½ʧ"); + EMH_store_error_s2(EMH_severity_error, ITK_err, "Ŀ¼ʧ", local_dir.c_str()); + ifail = ITK_err; + goto end; + } + } + //ѡ + { + vector data_prefs; + ifail = getPrefStrings(PREF_MES_WL, TC_preference_site, wl_pref_values); + if (wl_pref_values.size() != 13) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_WL); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_MES_WL_DATA, TC_preference_site, data_prefs); + parseErpConfigs(data_prefs, 0, wl_data_configs); + if (wl_data_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_WL_DATA); + ifail = ITK_err; + goto end; + } + data_prefs.clear(); + } + //BOMѡ + { + vector parent_prefs; + ifail = getPrefStrings(PREF_MES_BOM, TC_preference_site, bom_pref_values); + if (bom_pref_values.size() != 10) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_BOM); + ifail = ITK_err; + goto end; + } + ifail = getPrefStrings(PREF_MES_BOM_PARENT, TC_preference_site, parent_prefs); + parseErpConfigs(parent_prefs, 0, parent_configs); + if (parent_configs.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_BOM_PARENT); + ifail = ITK_err; + goto end; + } + { + vector child_prefs; + ifail = getPrefStrings(PREF_MES_BOM_CHILD1, TC_preference_site, child_prefs); + parseErpConfigs(child_prefs, 0, child_configs1); + if (child_configs1.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_BOM_CHILD1); + ifail = ITK_err; + goto end; + } + child_prefs.clear(); + } + { + vector child_prefs; + ifail = getPrefStrings(PREF_MES_BOM_CHILD2, TC_preference_site, child_prefs); + parseErpConfigs(child_prefs, 0, child_configs2); + if (child_configs2.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_BOM_CHILD2); + ifail = ITK_err; + goto end; + } + child_prefs.clear(); + } + { + vector child_prefs; + ifail = getPrefStrings(PREF_MES_BOM_CHILD3, TC_preference_site, child_prefs); + parseErpConfigs(child_prefs, 0, child_configs3); + if (child_configs3.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_BOM_CHILD3); + ifail = ITK_err; + goto end; + } + child_prefs.clear(); + } + { + vector child_prefs; + ifail = getPrefStrings(PREF_MES_BOM_CHILD4, TC_preference_site, child_prefs); + parseErpConfigs(child_prefs, 0, child_configs4); + if (child_configs4.size() == 0) { + EMH_store_error_s2(EMH_severity_error, ITK_err, "ѡô", PREF_MES_BOM_CHILD4); + ifail = ITK_err; + goto end; + } + child_prefs.clear(); + } + parent_prefs.clear(); + } + // xml + { + char date_string[20]; + struct tm* p; + time_t now; + time(&now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d%03d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, getCurrentMilliSeconds()); + + TiXmlElement* host = new TiXmlElement("host"); + TiXmlElement* service = new TiXmlElement("service"); + TiXmlElement* datakey = new TiXmlElement("datakey"); + host->SetAttribute("prod", wl_pref_values[1].c_str()); + host->SetAttribute("ver", wl_pref_values[2].c_str()); + host->SetAttribute("ip", wl_pref_values[3].c_str()); + host->SetAttribute("id", wl_pref_values[4].c_str()); + host->SetAttribute("acct", wl_pref_values[5].c_str()); + host->SetAttribute("timestamp", date_string); + service->SetAttribute("prod", wl_pref_values[6].c_str()); + service->SetAttribute("ip", wl_pref_values[7].c_str()); + service->SetAttribute("id", wl_pref_values[8].c_str()); + service->SetAttribute("name", wl_pref_values[9].c_str()); + { + TiXmlElement* key = new TiXmlElement("key"); + key->SetAttribute("name", "EntId"); + set_xml_value(key, wl_pref_values[10].c_str()); + datakey->LinkEndChild(key); + } + { + TiXmlElement* key = new TiXmlElement("key"); + key->SetAttribute("name", "CompanyId"); + set_xml_value(key, wl_pref_values[11].c_str()); + datakey->LinkEndChild(key); + } + { + TiXmlElement* key = new TiXmlElement("key"); + key->SetAttribute("name", "item_no"); + set_xml_value(key, wl_pref_values[12].c_str()); + datakey->LinkEndChild(key); + } + + TiXmlElement* request = new TiXmlElement("request"); + request->SetAttribute("type", "sync"); + string host_service_str; + TiXmlPrinter host_printer, service_printer; + host->Accept(&host_printer); + host_service_str.append(trim(host_printer.CStr())); + service->Accept(&service_printer); + host_service_str.append(trim(service_printer.CStr())); + + //unsigned char buffer[2048]; + //memcpy(buffer, host_service_str.c_str(), host_service_str.size()); + WriteLog(debug, "Get MD5 From \"%s\"", host_service_str.c_str()); + request->SetAttribute("key", str2md5(host_service_str).c_str()); + + wl_doc->LinkEndChild(request); + request->LinkEndChild(host); + request->LinkEndChild(service); + request->LinkEndChild(datakey); + + + TiXmlElement* payload = new TiXmlElement("payload"); + request->LinkEndChild(payload); + TiXmlElement* param = new TiXmlElement("param"); + param->SetAttribute("key", "std_data"); + param->SetAttribute("type", "xml"); + payload->LinkEndChild(param); + TiXmlElement* data_request = new TiXmlElement("data_request"); + param->LinkEndChild(data_request); + TiXmlElement* datainfo = new TiXmlElement("datainfo"); + data_request->LinkEndChild(datainfo); + TiXmlElement* param3 = new TiXmlElement("parameter"); + param3->SetAttribute("key", "item_data"); + param3->SetAttribute("type", "data"); + datainfo->LinkEndChild(param3); + wl_data = new TiXmlElement("data"); + wl_data->SetAttribute("name", "ITEM"); + param3->LinkEndChild(wl_data); + } + + // BOMxml + { + char date_string[20]; + struct tm* p; + time_t now; + time(&now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d%02d%02d%02d%03d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec, getCurrentMilliSeconds()); + + + + TiXmlElement* host = new TiXmlElement("host"); + TiXmlElement* service = new TiXmlElement("service"); + host->SetAttribute("prod", bom_pref_values[1].c_str()); + host->SetAttribute("ver", bom_pref_values[2].c_str()); + host->SetAttribute("ip", bom_pref_values[3].c_str()); + host->SetAttribute("id", bom_pref_values[4].c_str()); + host->SetAttribute("acct", bom_pref_values[5].c_str()); + host->SetAttribute("timestamp", date_string); + service->SetAttribute("prod", bom_pref_values[6].c_str()); + service->SetAttribute("ip", bom_pref_values[7].c_str()); + service->SetAttribute("id", bom_pref_values[8].c_str()); + service->SetAttribute("name", bom_pref_values[9].c_str()); + + TiXmlElement* request = new TiXmlElement("request"); + request->SetAttribute("type", "sync"); + string host_service_str; + TiXmlPrinter host_printer, service_printer; + + host->Accept(&host_printer); + host_service_str.append(trim(host_printer.CStr())); + + service->Accept(&service_printer); + host_service_str.append(trim(service_printer.CStr())); + + //unsigned char buffer[2048]; + //memcpy(buffer, host_service_str.c_str(), host_service_str.size()); + WriteLog(debug, "Get MD5 From \"%s\"", host_service_str.c_str()); + request->SetAttribute("key", str2md5(host_service_str).c_str()); + + + bom_doc->LinkEndChild(request); + request->LinkEndChild(host); + request->LinkEndChild(service); + TiXmlElement* payload = new TiXmlElement("payload"); + request->LinkEndChild(payload); + TiXmlElement* param = new TiXmlElement("param"); + param->SetAttribute("key", "std_data"); + param->SetAttribute("type", "xml"); + payload->LinkEndChild(param); + TiXmlElement* data_request = new TiXmlElement("data_request"); + param->LinkEndChild(data_request); + TiXmlElement* datainfo = new TiXmlElement("datainfo"); + data_request->LinkEndChild(datainfo); + TiXmlElement* param3 = new TiXmlElement("parameter"); + param3->SetAttribute("key", "process_data"); + param3->SetAttribute("type", "data"); + datainfo->LinkEndChild(param3); + bom_data = new TiXmlElement("data"); + bom_data->SetAttribute("name", "process"); + param3->LinkEndChild(bom_data); + + } + //ȡ + { + vector added_wl; + int bomSeq = 1, wlSeq = 1; + for (int i = 0; i < target_tags.size(); i++) { + char *object_type = NULL; + AOM_ask_value_string(target_tags[i],"object_type",&object_type); + if (strcmp(object_type,"QF8gyRevision")!=0) { + DOFREE(object_type); + continue; + } + DOFREE(object_type); + ifail = read_bop_data(target_tags[i], parent_configs, child_configs1, child_configs2, child_configs3, child_configs4, wl_data_configs, bom_data, wl_data, bomSeq, wlSeq, added_wl, added_lines); + if (ifail != ITK_ok) { + goto end; + } + } + } + + { + TiXmlPrinter bom_doc_printer; + bom_doc->Accept(&bom_doc_printer); + + TiXmlPrinter wl_doc_printer; + wl_doc->Accept(&wl_doc_printer); + + soap* soap = soap_new(); + soap_init(soap); + soap_register_plugin(soap, plugin); + soap_set_mode(soap, SOAP_C_UTFSTRING); + + // + { + if (LOG) { + WriteToFile(LOG, "SEND WL"); + WriteToFile(LOG, wl_doc_printer.CStr()); + } + _WS1__invokeSrv* soapReq = new _WS1__invokeSrv(); + soapReq->soap_default(soap); + soapReq->in0.assign(wl_doc_printer.CStr()); + _WS1__invokeSrvResponse response; + WriteToFile(LOG, "..."); + ifail = soap_call___WS1__invokeSrv(soap, wl_pref_values[0].c_str(), NULL, soapReq, response); + WriteToFile(LOG, "REQUEST SENT"); + if (ifail == SOAP_OK) { + if (LOG) { + WriteToFile(LOG, "RETURN DATA"); + WriteToFile(LOG, response.invokeSrvReturn.c_str()); + } + ifail = parseResponse(response.invokeSrvReturn); + } + else { + WriteLog(debug, "ýӿ쳣%d", ifail); + soap_print_fault(soap, stderr); + ifail = ITK_err; + EMH_store_error_s1(EMH_severity_error, ITK_err, "ýӿʧ"); + } + if (ifail != ITK_ok) { + has_err = true; + } + } + + //BOM + { + if (LOG) { + WriteToFile(LOG, "SEND BOM"); + WriteToFile(LOG, bom_doc_printer.CStr()); + } + _WS1__invokeSrv* soapReq = new _WS1__invokeSrv(); + soapReq->soap_default(soap); + soapReq->in0.assign(bom_doc_printer.CStr()); + _WS1__invokeSrvResponse response; + WriteToFile(LOG, "..."); + ifail = soap_call___WS1__invokeSrv(soap, bom_pref_values[0].c_str(), NULL, soapReq, response); + WriteToFile(LOG, "REQUEST SENT"); + if (ifail == SOAP_OK) { + if (LOG) { + WriteToFile(LOG, "RETURN DATA"); + WriteToFile(LOG, response.invokeSrvReturn.c_str()); + } + ifail = parseResponse(response.invokeSrvReturn); + } + else { + WriteLog(debug, "ýӿ쳣%d", ifail); + soap_print_fault(soap, stderr); + ifail = ITK_err; + EMH_store_error_s1(EMH_severity_error, ITK_err, "ýӿʧ"); + } + if (ifail != ITK_ok) { + has_err = true; + } + } + + + soap_destroy(soap); + soap_done(soap); + //ifail = parseResponse(" 019 ƽ̨ͬ 99299d70-ce98-43d3-890b-0c2331f04ca7 2.0 000 1 ʧϢ "); + } + +end: + POM_AM__set_application_bypass(false); + WriteToFile(LOG, "FINISH"); + target_tags.clear(); + if (LOG) + { + fclose(LOG); + LOG = NULL; + } + if (has_err) { + ifail = ITK_err; + } + target_types.clear(); + parent_configs.clear(); + child_configs1.clear(); + child_configs2.clear(); + child_configs3.clear(); + child_configs4.clear(); + wl_data_configs.clear(); + bom_pref_values.clear(); + wl_pref_values.clear(); + added_lines.clear(); + WriteLog(debug, "============================================================="); + WriteLog(debug, "ִнQF_ERP_BOP"); + WriteLog(debug, "============================================================="); + return ifail; +} + diff --git a/connor_erp_mes/QF_SendTo_CRM.cxx b/connor_erp_mes/QF_SendTo_CRM.cxx new file mode 100644 index 0000000..e1d0b5c --- /dev/null +++ b/connor_erp_mes/QF_SendTo_CRM.cxx @@ -0,0 +1,305 @@ +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) +#pragma warning (disable: 4995) +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "connor_erp_mes.h" + + +// #include +// #include +#include +#include +#include +#include "kutil.h" +using namespace std; +extern "C" int POM_AM__set_application_bypass(logical bypass); + + + +int QF_SendTo_CRM(EPM_action_message_t msg) +{ + //EPM_rule_message_t rul_msg; + int ifail = ITK_ok, rcode = 0; + // + char arg1value[1024] = ""; + char *argflag = NULL, *argvalue = NULL, *arg = NULL; + BOOL bypass = FALSE, setboth = TRUE, signPic = FALSE; + int arg_cnt = 0; + //̽ڵ + tag_t root_task = NULLTAG, *sub_tasks = NULL, current_task = NULLTAG, type_tag = NULLTAG; + int sub_task_count = 0; + char root_task_name[128] = "", task_name[128] = ""; + int occur_of_counts = 0; + tag_t *taskAttches = NULLTAG; + char tgt_type[WSO_name_size_c + 1] = "", type_class[TCTYPE_class_name_size_c + 1] = ""; + ////ѭڲ + tag_t cur_task = NULLTAG; + char task_type[WSO_name_size_c + 1] = ""; + //ѭ + int i = 0, j = 0, k = 0, count = 0, n = 0; + //ڵϢ + + //ڵѭ + tag_t itemrevision = NULLTAG; + + int form_count = 0; + tag_t master_form = NULLTAG; + char local_path[128] = ""; + //ƽڵ + + + //char *txtfile = NULL; + //ǩ + int n_prop = 0, q = 0; + char **prop_names = NULL, hq_name[128] = "", hq_time_name[128] = "", *hq_value = NULL; + char exclude_type[256] = "", item_type[ITEM_type_size_c + 1] = ""; + tag_t item = NULLTAG; + logical is_sign = false; + + //õ˺Ľڵ + current_task = msg.task; + //CreateLogFile("PLA8_signoff",&txtfile); + printf("=========================================================\n"); + printf("JY_Save_CLS ʼִ\n"); + printf("=========================================================\n"); + //ȡhandlerIJĸ + arg_cnt = TC_number_of_arguments(msg.arguments); + printf("Ϊ%d\n", arg_cnt); + if (arg_cnt > 0) + { + for (i = 0; i pref_vec1; + + map lov_map;//ƣֵleylovid + getPrefStrings1("JY8lovid", TC_preference_site, pref_vec1); + for (int i=0;i map_vec; + Split(lovid, "=", map_vec); + + lov_map.insert(pair(map_vec[0], map_vec[1])); + }*/ + + + char *lovValue = NULL; + char *key_lov_name = NULL; + int options = 0; + int n_lov_entries = 0; + char **lov_keys; + char **lov_values; + logical *deprecated_staus; + char *owning_site = NULL; + int n_shared_sites = 0; + char **shared_sites; + + /*tag_t keyTag=NULL; + ICS_keylov_ask_tag("-20050252",&keyTag); + + + + char *keyid=NULL; + ICS_keylov_ask_id(keyTag,&keyid); + printf("ǰkeyidΪ %s\n",keyid);*/ + POM_AM__set_application_bypass(true); + + for (i = 0; i < att_cnt; i++) { + + char *object_TYPE_1 = NULL; + ifail = AOM_ask_value_string(attachments[i], "object_type", &object_TYPE_1);// + printf("ǰͶΪ %s\n", object_TYPE_1); + + if (strcmp(arg1value, object_TYPE_1) == 0) + { + map class_map;//Ϣƣֵʾֵ + printf("ƥ........\n"); + + + tag_t cpItem = NULL; + ITEM_ask_item_of_rev(attachments[i], &cpItem); + + //ȡ + logical isClassified; + ITKCALL(ICS_is_wsobject_classified(cpItem, &isClassified));//жǷѾ + if (isClassified) + { + printf("ѷ........\n"); + tag_t classObj, attribute_tag; + ICS_ask_classification_object(cpItem, &classObj); + tag_t ics_tag; + char * class_id = NULL; + char *className = NULL; + int theAttributeCount; + ICS_view_attribute_descriptor_p_t attributes; + ICS_view_descriptor_p_t theViewDescriptor = NULL; + ITKCALL(ICS_ico_ask_class_tag(classObj, &ics_tag)); + + + + + + ITKCALL(ICS_ico_ask_class(classObj, &class_id)); + ITKCALL(ICS_view_describe(class_id, "", "", FALSE, &theViewDescriptor)); + theAttributeCount = theViewDescriptor->attributeCount; + attributes = theViewDescriptor->attributes; + className=theViewDescriptor->name; + cout << "className--------------" << className << endl; + for (int j = 0; j < theAttributeCount; j++) { + //WriteLog("ICO attr id = %d \n",attributes[i].id); + //WriteLog("ICO attr name = %s \n",attributes[i].name); + //WriteLog("ICO attr format = %d \n",attributes[i].format); + string attr_name;// + string attr_value;//ֵ + string attr_id; + cout << "id--------------" << attributes[j].id << endl; + cout << "format----------------" << attributes[j].format << endl; + cout << "name-------------------" << attributes[j].name << endl; + //ȡԵʵֵʾֵ + logical isLocalizable = false; + ICS_ico_property_isLocalizable(classObj, attributes[j].id,&isLocalizable); + if (isLocalizable == true) { + int theAttributeValCount = 0; + char** theAttributeValues = NULL; + char* localization_statuses = NULL; + logical isMaster = false; + ICS_ico_ask_localized_value_strings(classObj, attributes[j].id, "zh_CN", &theAttributeValCount, &theAttributeValues, &localization_statuses, &isMaster); + for (size_t n = 0; n < theAttributeValCount; n++) + { + cout << theAttributeValues[n] << endl; + } + DOFREE(localization_statuses); + if (theAttributeValues != NULL) { + MEM_free(theAttributeValues); + theAttributeValues = NULL; + } + + } + char newLsm[15]; + itoa(attributes[j].id, newLsm, 10); + cout << "newLsm-------------------" << newLsm << endl; + attr_id = newLsm; + attr_name = attributes[j].name; + //ȡij + int classificationCount = 0; + char **values = NULL; + + + AOM_ask_value_strings(attachments[i], "jy8ClassLovInfo", &classificationCount, &values); + map lovMap; + for (int i1 = 0; i1 < classificationCount; i1++) + { + string lovMapValue = values[i1]; + vector map_vec; + printf("values[i1].......%s\n", values[i1]); + Split(lovMapValue, "=", map_vec); + lovMap.insert(pair(map_vec[0], map_vec[1])); + + } + + char *classValue = NULL; + + ICS_ask_attribute_value(classObj, attributes[j].name, &classValue); + attr_value = classValue; + + string keyId = lovMap[attr_id]; + if (keyId.size() > 0) { + ICS_keylov_get_keylov(keyId.c_str(), &key_lov_name, &options, &n_lov_entries, &lov_keys, &lov_values, &deprecated_staus, + &owning_site, &n_shared_sites, &shared_sites);//Դ߳"-20050249" + for (int o = 0; o < n_lov_entries; o++) + { + if (strcmp(classValue, lov_keys[o]) == 0) { + printf("%sΪ%s\n", attributes[j].name, lov_values[o]); + attr_value = lov_values[o]; + break; + } + } + + } + + + + printf("ƣ%s;ֵ%s\n", attributes[j].name, attr_value); + class_map.insert(pair(attr_name, attr_value)); + + } + DOFREE(class_id); + cout << "9===================" << endl; + + } + else { + printf("ûз..........."); + + } + DOFREE(object_TYPE_1); + } + else { + printf("Ͳƥ........\n"); + } + cout << "10===================" << endl; + } + POM_AM__set_application_bypass(false); + cout << "11===================" << endl; + //if (debug) + DOFREE(attachments); + cout << "12===================" << endl; + DOFREE(lovValue); + cout << "13===================" << endl; + DOFREE(key_lov_name); + cout << "14===================" << endl; + DOFREE(owning_site); + cout << "15===================" << endl; + { + printf("=========================================================\n"); + printf("hander ȡϢ ִ\n"); + printf("=========================================================\n"); + } + return rcode; +} + diff --git a/connor_erp_mes/connor_erp_mes.cpp b/connor_erp_mes/connor_erp_mes.cpp new file mode 100644 index 0000000..2f2b9b2 --- /dev/null +++ b/connor_erp_mes/connor_erp_mes.cpp @@ -0,0 +1,180 @@ +// connor_erp_mes.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include "connor_erp_mes.h" + +#include +#include +#include +#include +#ifdef __cplusplus +extern "C" { +#endif + /** + * @fn extern "C" DLLAPI int liborigin_register_callbacks + * @return usually return ITK_ok + * @brief liborigin customization entry + * 此函数必须有规范的写法,必须以dll的名称加上"_"开头 + */ + DLLAPI int connor_erp_mes_register_callbacks() + { + int ifail = ITK_ok; + //ITKCALL(ifail = CUSTOM_register_exit("connor_erp_mes", "USER_invoke_pdm_server", (CUSTOM_EXIT_ftn_t)K_invoke_pdm_server)); + //fprintf(stdout, "connor_erp_mes register USER_invoke_pdm_server complete\n"); + ITKCALL(ifail = CUSTOM_register_exit("connor_erp_mes", "USERSERVICE_register_methods", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_methods)); + fprintf(stdout, "connor_erp_mes register USERSERVICE_custom_register_methods complete\n"); + ITKCALL(ifail = CUSTOM_register_exit("connor_erp_mes", "USER_gs_shell_init_module", + (CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_handlers)); + fprintf(stdout, "connor_erp_mes register USER_gs_shell_init_module complete\n"); + return ifail; + } + + + DLLAPI int USERSERVICE_custom_register_handlers(int* decision, va_list args) + { + int ifail = ITK_ok; + //QF_ERP_wl + ITKCALL(ifail = EPM_register_action_handler("QF_ERP_wl", "QF_ERP_wl", (EPM_action_handler_t)QF_ERP_wl)); + if (ifail == 0) { + printf("注册操作处理程序成功:QF_ERP_wl\n"); + } + else { + printf("注册操作处理程序失败[%d]:QF_ERP_wl\n", ifail); + } + //QF_ERP_BOM + ITKCALL(ifail = EPM_register_action_handler("QF_ERP_BOM", "QF_ERP_BOM", (EPM_action_handler_t)QF_ERP_BOM)); + if (ifail == 0) { + printf("注册操作处理程序成功:QF_ERP_BOM\n"); + } + else { + printf("注册操作处理程序失败[%d]:QF_ERP_BOM\n", ifail); + } + //QF_ERP_BOP + ITKCALL(ifail = EPM_register_action_handler("QF_ERP_BOP", "QF_ERP_BOP", (EPM_action_handler_t)QF_ERP_BOP)); + if (ifail == 0) { + printf("注册操作处理程序成功:QF_ERP_BOP\n"); + } + else { + printf("注册操作处理程序失败[%d]:QF_ERP_BOP\n", ifail); + } + // QF_Deleta_TCM + ITKCALL(ifail = EPM_register_action_handler("QF_Delete_TCM", "QF_Delete_TCM", (EPM_action_handler_t)QF_Delete_TCM)); + if (ifail == 0) { + printf("注册操作处理程序成功:QF_Delete_TCM\n"); + } + else { + printf("注册操作处理程序失败[%d]:QF_Delete_TCM\n", ifail); + } + + /*ITKCALL(ifail = EPM_register_action_handler("QF_signoff_rev", "QF_signoff_rev", (EPM_action_handler_t)CONNOR_SIGN_MASTER)); + if (ifail == 0) { + printf("注册操作处理程序成功:QF_signoff_rev\n"); + } + else { + printf("注册操作处理程序失败[%d]:QF_signoff_rev\n", ifail); + } + ITKCALL(ifail = EPM_register_action_handler("QF_signoff_prt", "QF_signoff_prt", (EPM_action_handler_t)CONNOR_SIGN_DATASET)); + if (ifail == 0) { + printf("注册操作处理程序成功:QF_signoff_prt\n"); + } + else { + printf("注册操作处理程序失败[%d]:QF_signoff_prt\n", ifail); + }*/ + return ifail; + } + + //mail_name为邮件的名字,user_tag为要发送到的用户,tags为邮件内包含的对象 + void sendMail(char *mail_name, tag_t user_tag, tag_t *tags) + { + tag_t envelope_tag; + MAIL_create_envelope(mail_name, "", &envelope_tag); + MAIL_add_envelope_receiver(envelope_tag, user_tag); + AOM_set_value_tags(envelope_tag, "contents", 1, tags); + MAIL_send_envelope(envelope_tag); + } + int connor_send_envelop(void * returnValue) + { + printf("222set prop \n"); + int ifail = ITK_ok, + count = 0, + itemCount = 0, + form_count = 0; + tag_t tags = NULLTAG; + char *mail_name = NULL; + tag_t user_tag = NULLTAG; + USERARG_get_tag_argument(&tags);//获得对象参:产线对象 + USERARG_get_tag_argument(&user_tag);//获得对象参数:收件人 + USERARG_get_string_argument(&mail_name);//邮件内容 + + + //获取属性对象 + + //printf("222set prop %s\n", mail_name); + //tag_t *contentTags=NULL ; + //contentTags = (tag_t *)malloc(1 * sizeof(tag_t)); + //contentTags[0] = tags; + //sendMail(mail_name, user_tag, contentTags); + if (mail_name != NULL) { + MEM_free(mail_name); + mail_name = NULL; + } + //if (contentTags != NULL) { + // MEM_free(contentTags); + // contentTags = NULL; + //} + return ifail; + } + DLLAPI int USERSERVICE_custom_register_methods() + { + int numberOfArguments = 1, + returnValueType = USERARG_STRING_TYPE, + *argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_LOGICAL_TYPE;; + USER_function_t functionPtr; + int status = 0; + //自动发起流程 + numberOfArguments = 3; + functionPtr = connor_send_envelop;//注册方法 + argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int)); + argumentList[0] = USERARG_TAG_TYPE; + argumentList[1] = USERARG_TAG_TYPE; + argumentList[2] = USERARG_STRING_TYPE; + returnValueType = USERARG_VOID_TYPE; + status = USERSERVICE_register_method("connor_send_envelop", functionPtr, numberOfArguments, + argumentList, returnValueType); + MEM_free(argumentList); + if (status == ITK_ok) + { + fprintf(stdout, "\n Registering connor_send_envelop finished\n"); + } + else + { + fprintf(stdout, "\n Registering connor_send_envelop failed %d\n", status); + } + functionPtr = WX3_send_mail; + argumentList = (int*)MEM_alloc(5 * sizeof(int)); + argumentList[0] = USERARG_STRING_TYPE; + argumentList[1] = USERARG_STRING_TYPE; + argumentList[2] = USERARG_TAG_TYPE; + argumentList[3] = USERARG_TAG_TYPE + 100; + argumentList[4] = USERARG_TAG_TYPE; + returnValueType = USERARG_VOID_TYPE; + status = USERSERVICE_register_method("WX3_send_mail", functionPtr, 5, + argumentList, returnValueType); + if (status == ITK_ok) + { + fprintf(stdout, "\n Registering WX_send_mail finished\n"); + } + else + { + fprintf(stdout, "\n Registering WX_send_mail failed %d\n", status); + } + + return status; + } + + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/connor_erp_mes/connor_erp_mes.h b/connor_erp_mes/connor_erp_mes.h new file mode 100644 index 0000000..1a823c7 --- /dev/null +++ b/connor_erp_mes/connor_erp_mes.h @@ -0,0 +1,27 @@ +#pragma once +#include +#include +#include +#include "kutil.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +DLLAPI int USERSERVICE_custom_register_methods(); +DLLAPI int USERSERVICE_custom_register_handlers(int* decision, va_list args); + +int QF_ERP_wl(EPM_action_message_t msg); +int QF_ERP_BOM(EPM_action_message_t msg); +int QF_ERP_BOP(EPM_action_message_t msg); +int QF_Delete_TCM(EPM_action_message_t msg); +//int connor_send_envelop(void * returnValue); +int WX3_send_mail(void * returnValue); +#define debug true + +#ifdef __cplusplus +} +#endif + diff --git a/connor_erp_mes/connor_erp_mes.vcxproj b/connor_erp_mes/connor_erp_mes.vcxproj new file mode 100644 index 0000000..4fa1127 --- /dev/null +++ b/connor_erp_mes/connor_erp_mes.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {fdad31da-c4b8-4b1e-ab61-4f2f37e068cf} + connorerpmes + 8.1 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;IPLIB=none;%(PreprocessorDefinitions) + true + C:\TC13\tclib\include_cpp;C:\TC13\tclib\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + C:\TC13\tclib\lib\*.lib;%(AdditionalDependencies) + libuser_exits.ar.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connor_erp_mes/connor_erp_mes.vcxproj.filters b/connor_erp_mes/connor_erp_mes.vcxproj.filters new file mode 100644 index 0000000..f8b0821 --- /dev/null +++ b/connor_erp_mes/connor_erp_mes.vcxproj.filters @@ -0,0 +1,107 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {ae45bcd9-07c3-42f7-adb6-89f12d05f98f} + + + {b7279c7f-ff82-4b91-8f5e-06851f556c98} + + + {7c178b44-e75f-47ed-9958-67713d53b075} + + + + + 源文件 + + + 源文件 + + + 源文件 + + + tinyxml + + + tinyxml + + + tinyxml + + + tinyxml + + + webservice + + + webservice + + + webservice + + + webservice + + + md5 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + tinyxml + + + tinyxml + + + webservice + + + webservice + + + webservice + + + webservice + + + webservice + + + md5 + + + + + webservice + + + \ No newline at end of file diff --git a/connor_erp_mes/connor_send_envelop.cpp b/connor_erp_mes/connor_send_envelop.cpp new file mode 100644 index 0000000..44a3160 --- /dev/null +++ b/connor_erp_mes/connor_send_envelop.cpp @@ -0,0 +1,41 @@ +#include +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) +#pragma warning (disable: 4995) +#include +#include +#include +#include + +#include +#include +#include "connor_erp_mes.h" +using namespace std; + +extern "C" int POM_AM__set_application_bypass(logical bypass); + + +int WX3_send_mail(void* returnValue) +{ + char *title, *content; + tag_t dataset, target_user, *copy_user, envelope_tag; + int copy_user_num; + USERARG_get_string_argument(&title); + USERARG_get_string_argument(&content); + USERARG_get_tag_argument(&target_user); + USERARG_get_tag_array_argument(©_user_num, ©_user); + USERARG_get_tag_argument(&dataset); + MAIL_create_envelope(title, content, &envelope_tag); + MAIL_initialize_envelope2(envelope_tag, title, content);//ڴ˴ܷʼ + MAIL_add_envelope_receiver(envelope_tag, target_user); + for (auto i = 0; i +template class std::vector; + +/******************************************************************************\ + * * + * Import * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Namespaces * + * * +\******************************************************************************/ + + +/* NOTE: + +It is strongly recommended to customize the names of the namespace prefixes +generated by wsdl2h. To do so, modify the prefix bindings below and add the +modified lines to 'typemap.dat' then rerun wsdl2h (use wsdl2h -t typemap.dat): + +WS1 = "http://entry.serviceengine.cross.digiwin.com" + +*/ + +#define SOAP_NAMESPACE_OF_WS1 "http://entry.serviceengine.cross.digiwin.com" +//gsoap WS1 schema namespace: http://entry.serviceengine.cross.digiwin.com +//gsoap WS1 schema elementForm: qualified +//gsoap WS1 schema attributeForm: unqualified + +/******************************************************************************\ + * * + * Built-in Schema Types and Top-Level Elements and Attributes * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Forward Declarations * + * * +\******************************************************************************/ + + +class _WS1__invokeEtl; + +class _WS1__invokeEtlResponse; + +class _WS1__getEtlJobList; + +class _WS1__getEtlJobListResponse; + +class _WS1__getParamList; + +class _WS1__getParamListResponse; + +class _WS1__getProdList; + +class _WS1__getProdListResponse; + +class _WS1__regProdAP; + +class _WS1__regProdAPResponse; + +class _WS1__invokeUnion; + +class _WS1__invokeUnionResponse; + +class _WS1__invokeMdm; + +class _WS1__invokeMdmResponse; + +class _WS1__getProd; + +class _WS1__getProdResponse; + +class _WS1__getSrv; + +class _WS1__getSrvResponse; + +class _WS1__fpInvoke; + +class _WS1__fpInvokeResponse; + +class _WS1__getStandardServiceList; + +class _WS1__getStandardServiceListResponse; + +class _WS1__getStandardDataNameList; + +class _WS1__getStandardDataNameListResponse; + +class _WS1__regSrv; + +class _WS1__regSrvResponse; + +class _WS1__regEAI; + +class _WS1__regEAIResponse; + +class _WS1__invokeSrv; + +class _WS1__invokeSrvResponse; + +class _WS1__escrowResendSrv; + +class _WS1__escrowResendSrvResponse; + + +/******************************************************************************\ + * * + * Schema Types and Top-Level Elements and Attributes * + * http://entry.serviceengine.cross.digiwin.com * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Schema Complex Types and Top-Level Elements * + * http://entry.serviceengine.cross.digiwin.com * + * * +\******************************************************************************/ + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeEtl +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeEtl is a complexType. +/// +/// @note class _WS1__invokeEtl operations: +/// - _WS1__invokeEtl* soap_new__WS1__invokeEtl(soap*) allocate and default initialize +/// - _WS1__invokeEtl* soap_new__WS1__invokeEtl(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeEtl* soap_new_req__WS1__invokeEtl(soap*, ...) allocate, set required members +/// - _WS1__invokeEtl* soap_new_set__WS1__invokeEtl(soap*, ...) allocate, set all public members +/// - _WS1__invokeEtl::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeEtl(soap*, _WS1__invokeEtl*) deserialize from a stream +/// - int soap_write__WS1__invokeEtl(soap*, _WS1__invokeEtl*) serialize to a stream +/// - _WS1__invokeEtl* _WS1__invokeEtl::soap_dup(soap*) returns deep copy of _WS1__invokeEtl, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeEtl::soap_del() deep deletes _WS1__invokeEtl data members, use only after _WS1__invokeEtl::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeEtl::soap_type() returns SOAP_TYPE__WS1__invokeEtl or derived type identifier +class _WS1__invokeEtl +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeEtlResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeEtlResponse is a complexType. +/// +/// @note class _WS1__invokeEtlResponse operations: +/// - _WS1__invokeEtlResponse* soap_new__WS1__invokeEtlResponse(soap*) allocate and default initialize +/// - _WS1__invokeEtlResponse* soap_new__WS1__invokeEtlResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeEtlResponse* soap_new_req__WS1__invokeEtlResponse(soap*, ...) allocate, set required members +/// - _WS1__invokeEtlResponse* soap_new_set__WS1__invokeEtlResponse(soap*, ...) allocate, set all public members +/// - _WS1__invokeEtlResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeEtlResponse(soap*, _WS1__invokeEtlResponse*) deserialize from a stream +/// - int soap_write__WS1__invokeEtlResponse(soap*, _WS1__invokeEtlResponse*) serialize to a stream +/// - _WS1__invokeEtlResponse* _WS1__invokeEtlResponse::soap_dup(soap*) returns deep copy of _WS1__invokeEtlResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeEtlResponse::soap_del() deep deletes _WS1__invokeEtlResponse data members, use only after _WS1__invokeEtlResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeEtlResponse::soap_type() returns SOAP_TYPE__WS1__invokeEtlResponse or derived type identifier +class _WS1__invokeEtlResponse +{ public: +/// Element "invokeEtlReturn" of type xs:string. + std::string invokeEtlReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getEtlJobList +/// @brief "http://entry.serviceengine.cross.digiwin.com":getEtlJobList is a complexType. +/// +/// @note class _WS1__getEtlJobList operations: +/// - _WS1__getEtlJobList* soap_new__WS1__getEtlJobList(soap*) allocate and default initialize +/// - _WS1__getEtlJobList* soap_new__WS1__getEtlJobList(soap*, int num) allocate and default initialize an array +/// - _WS1__getEtlJobList* soap_new_req__WS1__getEtlJobList(soap*, ...) allocate, set required members +/// - _WS1__getEtlJobList* soap_new_set__WS1__getEtlJobList(soap*, ...) allocate, set all public members +/// - _WS1__getEtlJobList::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getEtlJobList(soap*, _WS1__getEtlJobList*) deserialize from a stream +/// - int soap_write__WS1__getEtlJobList(soap*, _WS1__getEtlJobList*) serialize to a stream +/// - _WS1__getEtlJobList* _WS1__getEtlJobList::soap_dup(soap*) returns deep copy of _WS1__getEtlJobList, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getEtlJobList::soap_del() deep deletes _WS1__getEtlJobList data members, use only after _WS1__getEtlJobList::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getEtlJobList::soap_type() returns SOAP_TYPE__WS1__getEtlJobList or derived type identifier +class _WS1__getEtlJobList +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getEtlJobListResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getEtlJobListResponse is a complexType. +/// +/// @note class _WS1__getEtlJobListResponse operations: +/// - _WS1__getEtlJobListResponse* soap_new__WS1__getEtlJobListResponse(soap*) allocate and default initialize +/// - _WS1__getEtlJobListResponse* soap_new__WS1__getEtlJobListResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getEtlJobListResponse* soap_new_req__WS1__getEtlJobListResponse(soap*, ...) allocate, set required members +/// - _WS1__getEtlJobListResponse* soap_new_set__WS1__getEtlJobListResponse(soap*, ...) allocate, set all public members +/// - _WS1__getEtlJobListResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getEtlJobListResponse(soap*, _WS1__getEtlJobListResponse*) deserialize from a stream +/// - int soap_write__WS1__getEtlJobListResponse(soap*, _WS1__getEtlJobListResponse*) serialize to a stream +/// - _WS1__getEtlJobListResponse* _WS1__getEtlJobListResponse::soap_dup(soap*) returns deep copy of _WS1__getEtlJobListResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getEtlJobListResponse::soap_del() deep deletes _WS1__getEtlJobListResponse data members, use only after _WS1__getEtlJobListResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getEtlJobListResponse::soap_type() returns SOAP_TYPE__WS1__getEtlJobListResponse or derived type identifier +class _WS1__getEtlJobListResponse +{ public: +/// Element "getEtlJobListReturn" of type xs:string. + std::string getEtlJobListReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getParamList +/// @brief "http://entry.serviceengine.cross.digiwin.com":getParamList is a complexType. +/// +/// @note class _WS1__getParamList operations: +/// - _WS1__getParamList* soap_new__WS1__getParamList(soap*) allocate and default initialize +/// - _WS1__getParamList* soap_new__WS1__getParamList(soap*, int num) allocate and default initialize an array +/// - _WS1__getParamList* soap_new_req__WS1__getParamList(soap*, ...) allocate, set required members +/// - _WS1__getParamList* soap_new_set__WS1__getParamList(soap*, ...) allocate, set all public members +/// - _WS1__getParamList::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getParamList(soap*, _WS1__getParamList*) deserialize from a stream +/// - int soap_write__WS1__getParamList(soap*, _WS1__getParamList*) serialize to a stream +/// - _WS1__getParamList* _WS1__getParamList::soap_dup(soap*) returns deep copy of _WS1__getParamList, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getParamList::soap_del() deep deletes _WS1__getParamList data members, use only after _WS1__getParamList::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getParamList::soap_type() returns SOAP_TYPE__WS1__getParamList or derived type identifier +class _WS1__getParamList +{ public: +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getParamListResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getParamListResponse is a complexType. +/// +/// @note class _WS1__getParamListResponse operations: +/// - _WS1__getParamListResponse* soap_new__WS1__getParamListResponse(soap*) allocate and default initialize +/// - _WS1__getParamListResponse* soap_new__WS1__getParamListResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getParamListResponse* soap_new_req__WS1__getParamListResponse(soap*, ...) allocate, set required members +/// - _WS1__getParamListResponse* soap_new_set__WS1__getParamListResponse(soap*, ...) allocate, set all public members +/// - _WS1__getParamListResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getParamListResponse(soap*, _WS1__getParamListResponse*) deserialize from a stream +/// - int soap_write__WS1__getParamListResponse(soap*, _WS1__getParamListResponse*) serialize to a stream +/// - _WS1__getParamListResponse* _WS1__getParamListResponse::soap_dup(soap*) returns deep copy of _WS1__getParamListResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getParamListResponse::soap_del() deep deletes _WS1__getParamListResponse data members, use only after _WS1__getParamListResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getParamListResponse::soap_type() returns SOAP_TYPE__WS1__getParamListResponse or derived type identifier +class _WS1__getParamListResponse +{ public: +/// Element "getParamListReturn" of type xs:string. + std::string getParamListReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getProdList +/// @brief "http://entry.serviceengine.cross.digiwin.com":getProdList is a complexType. +/// +/// @note class _WS1__getProdList operations: +/// - _WS1__getProdList* soap_new__WS1__getProdList(soap*) allocate and default initialize +/// - _WS1__getProdList* soap_new__WS1__getProdList(soap*, int num) allocate and default initialize an array +/// - _WS1__getProdList* soap_new_req__WS1__getProdList(soap*, ...) allocate, set required members +/// - _WS1__getProdList* soap_new_set__WS1__getProdList(soap*, ...) allocate, set all public members +/// - _WS1__getProdList::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getProdList(soap*, _WS1__getProdList*) deserialize from a stream +/// - int soap_write__WS1__getProdList(soap*, _WS1__getProdList*) serialize to a stream +/// - _WS1__getProdList* _WS1__getProdList::soap_dup(soap*) returns deep copy of _WS1__getProdList, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getProdList::soap_del() deep deletes _WS1__getProdList data members, use only after _WS1__getProdList::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getProdList::soap_type() returns SOAP_TYPE__WS1__getProdList or derived type identifier +class _WS1__getProdList +{ public: +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getProdListResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getProdListResponse is a complexType. +/// +/// @note class _WS1__getProdListResponse operations: +/// - _WS1__getProdListResponse* soap_new__WS1__getProdListResponse(soap*) allocate and default initialize +/// - _WS1__getProdListResponse* soap_new__WS1__getProdListResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getProdListResponse* soap_new_req__WS1__getProdListResponse(soap*, ...) allocate, set required members +/// - _WS1__getProdListResponse* soap_new_set__WS1__getProdListResponse(soap*, ...) allocate, set all public members +/// - _WS1__getProdListResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getProdListResponse(soap*, _WS1__getProdListResponse*) deserialize from a stream +/// - int soap_write__WS1__getProdListResponse(soap*, _WS1__getProdListResponse*) serialize to a stream +/// - _WS1__getProdListResponse* _WS1__getProdListResponse::soap_dup(soap*) returns deep copy of _WS1__getProdListResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getProdListResponse::soap_del() deep deletes _WS1__getProdListResponse data members, use only after _WS1__getProdListResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getProdListResponse::soap_type() returns SOAP_TYPE__WS1__getProdListResponse or derived type identifier +class _WS1__getProdListResponse +{ public: +/// Element "getProdListReturn" of type xs:string. + std::string getProdListReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":regProdAP +/// @brief "http://entry.serviceengine.cross.digiwin.com":regProdAP is a complexType. +/// +/// @note class _WS1__regProdAP operations: +/// - _WS1__regProdAP* soap_new__WS1__regProdAP(soap*) allocate and default initialize +/// - _WS1__regProdAP* soap_new__WS1__regProdAP(soap*, int num) allocate and default initialize an array +/// - _WS1__regProdAP* soap_new_req__WS1__regProdAP(soap*, ...) allocate, set required members +/// - _WS1__regProdAP* soap_new_set__WS1__regProdAP(soap*, ...) allocate, set all public members +/// - _WS1__regProdAP::soap_default(soap*) default initialize members +/// - int soap_read__WS1__regProdAP(soap*, _WS1__regProdAP*) deserialize from a stream +/// - int soap_write__WS1__regProdAP(soap*, _WS1__regProdAP*) serialize to a stream +/// - _WS1__regProdAP* _WS1__regProdAP::soap_dup(soap*) returns deep copy of _WS1__regProdAP, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__regProdAP::soap_del() deep deletes _WS1__regProdAP data members, use only after _WS1__regProdAP::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__regProdAP::soap_type() returns SOAP_TYPE__WS1__regProdAP or derived type identifier +class _WS1__regProdAP +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":regProdAPResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":regProdAPResponse is a complexType. +/// +/// @note class _WS1__regProdAPResponse operations: +/// - _WS1__regProdAPResponse* soap_new__WS1__regProdAPResponse(soap*) allocate and default initialize +/// - _WS1__regProdAPResponse* soap_new__WS1__regProdAPResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__regProdAPResponse* soap_new_req__WS1__regProdAPResponse(soap*, ...) allocate, set required members +/// - _WS1__regProdAPResponse* soap_new_set__WS1__regProdAPResponse(soap*, ...) allocate, set all public members +/// - _WS1__regProdAPResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__regProdAPResponse(soap*, _WS1__regProdAPResponse*) deserialize from a stream +/// - int soap_write__WS1__regProdAPResponse(soap*, _WS1__regProdAPResponse*) serialize to a stream +/// - _WS1__regProdAPResponse* _WS1__regProdAPResponse::soap_dup(soap*) returns deep copy of _WS1__regProdAPResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__regProdAPResponse::soap_del() deep deletes _WS1__regProdAPResponse data members, use only after _WS1__regProdAPResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__regProdAPResponse::soap_type() returns SOAP_TYPE__WS1__regProdAPResponse or derived type identifier +class _WS1__regProdAPResponse +{ public: +/// Element "regProdAPReturn" of type xs:string. + std::string regProdAPReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeUnion +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeUnion is a complexType. +/// +/// @note class _WS1__invokeUnion operations: +/// - _WS1__invokeUnion* soap_new__WS1__invokeUnion(soap*) allocate and default initialize +/// - _WS1__invokeUnion* soap_new__WS1__invokeUnion(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeUnion* soap_new_req__WS1__invokeUnion(soap*, ...) allocate, set required members +/// - _WS1__invokeUnion* soap_new_set__WS1__invokeUnion(soap*, ...) allocate, set all public members +/// - _WS1__invokeUnion::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeUnion(soap*, _WS1__invokeUnion*) deserialize from a stream +/// - int soap_write__WS1__invokeUnion(soap*, _WS1__invokeUnion*) serialize to a stream +/// - _WS1__invokeUnion* _WS1__invokeUnion::soap_dup(soap*) returns deep copy of _WS1__invokeUnion, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeUnion::soap_del() deep deletes _WS1__invokeUnion data members, use only after _WS1__invokeUnion::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeUnion::soap_type() returns SOAP_TYPE__WS1__invokeUnion or derived type identifier +class _WS1__invokeUnion +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Element "in1" of type xs:string. + std::string in1 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeUnionResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeUnionResponse is a complexType. +/// +/// @note class _WS1__invokeUnionResponse operations: +/// - _WS1__invokeUnionResponse* soap_new__WS1__invokeUnionResponse(soap*) allocate and default initialize +/// - _WS1__invokeUnionResponse* soap_new__WS1__invokeUnionResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeUnionResponse* soap_new_req__WS1__invokeUnionResponse(soap*, ...) allocate, set required members +/// - _WS1__invokeUnionResponse* soap_new_set__WS1__invokeUnionResponse(soap*, ...) allocate, set all public members +/// - _WS1__invokeUnionResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeUnionResponse(soap*, _WS1__invokeUnionResponse*) deserialize from a stream +/// - int soap_write__WS1__invokeUnionResponse(soap*, _WS1__invokeUnionResponse*) serialize to a stream +/// - _WS1__invokeUnionResponse* _WS1__invokeUnionResponse::soap_dup(soap*) returns deep copy of _WS1__invokeUnionResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeUnionResponse::soap_del() deep deletes _WS1__invokeUnionResponse data members, use only after _WS1__invokeUnionResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeUnionResponse::soap_type() returns SOAP_TYPE__WS1__invokeUnionResponse or derived type identifier +class _WS1__invokeUnionResponse +{ public: +/// Element "invokeUnionReturn" of type xs:string. + std::string invokeUnionReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeMdm +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeMdm is a complexType. +/// +/// @note class _WS1__invokeMdm operations: +/// - _WS1__invokeMdm* soap_new__WS1__invokeMdm(soap*) allocate and default initialize +/// - _WS1__invokeMdm* soap_new__WS1__invokeMdm(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeMdm* soap_new_req__WS1__invokeMdm(soap*, ...) allocate, set required members +/// - _WS1__invokeMdm* soap_new_set__WS1__invokeMdm(soap*, ...) allocate, set all public members +/// - _WS1__invokeMdm::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeMdm(soap*, _WS1__invokeMdm*) deserialize from a stream +/// - int soap_write__WS1__invokeMdm(soap*, _WS1__invokeMdm*) serialize to a stream +/// - _WS1__invokeMdm* _WS1__invokeMdm::soap_dup(soap*) returns deep copy of _WS1__invokeMdm, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeMdm::soap_del() deep deletes _WS1__invokeMdm data members, use only after _WS1__invokeMdm::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeMdm::soap_type() returns SOAP_TYPE__WS1__invokeMdm or derived type identifier +class _WS1__invokeMdm +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeMdmResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeMdmResponse is a complexType. +/// +/// @note class _WS1__invokeMdmResponse operations: +/// - _WS1__invokeMdmResponse* soap_new__WS1__invokeMdmResponse(soap*) allocate and default initialize +/// - _WS1__invokeMdmResponse* soap_new__WS1__invokeMdmResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeMdmResponse* soap_new_req__WS1__invokeMdmResponse(soap*, ...) allocate, set required members +/// - _WS1__invokeMdmResponse* soap_new_set__WS1__invokeMdmResponse(soap*, ...) allocate, set all public members +/// - _WS1__invokeMdmResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeMdmResponse(soap*, _WS1__invokeMdmResponse*) deserialize from a stream +/// - int soap_write__WS1__invokeMdmResponse(soap*, _WS1__invokeMdmResponse*) serialize to a stream +/// - _WS1__invokeMdmResponse* _WS1__invokeMdmResponse::soap_dup(soap*) returns deep copy of _WS1__invokeMdmResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeMdmResponse::soap_del() deep deletes _WS1__invokeMdmResponse data members, use only after _WS1__invokeMdmResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeMdmResponse::soap_type() returns SOAP_TYPE__WS1__invokeMdmResponse or derived type identifier +class _WS1__invokeMdmResponse +{ public: +/// Element "invokeMdmReturn" of type xs:string. + std::string invokeMdmReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getProd +/// @brief "http://entry.serviceengine.cross.digiwin.com":getProd is a complexType. +/// +/// @note class _WS1__getProd operations: +/// - _WS1__getProd* soap_new__WS1__getProd(soap*) allocate and default initialize +/// - _WS1__getProd* soap_new__WS1__getProd(soap*, int num) allocate and default initialize an array +/// - _WS1__getProd* soap_new_req__WS1__getProd(soap*, ...) allocate, set required members +/// - _WS1__getProd* soap_new_set__WS1__getProd(soap*, ...) allocate, set all public members +/// - _WS1__getProd::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getProd(soap*, _WS1__getProd*) deserialize from a stream +/// - int soap_write__WS1__getProd(soap*, _WS1__getProd*) serialize to a stream +/// - _WS1__getProd* _WS1__getProd::soap_dup(soap*) returns deep copy of _WS1__getProd, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getProd::soap_del() deep deletes _WS1__getProd data members, use only after _WS1__getProd::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getProd::soap_type() returns SOAP_TYPE__WS1__getProd or derived type identifier +class _WS1__getProd +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getProdResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getProdResponse is a complexType. +/// +/// @note class _WS1__getProdResponse operations: +/// - _WS1__getProdResponse* soap_new__WS1__getProdResponse(soap*) allocate and default initialize +/// - _WS1__getProdResponse* soap_new__WS1__getProdResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getProdResponse* soap_new_req__WS1__getProdResponse(soap*, ...) allocate, set required members +/// - _WS1__getProdResponse* soap_new_set__WS1__getProdResponse(soap*, ...) allocate, set all public members +/// - _WS1__getProdResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getProdResponse(soap*, _WS1__getProdResponse*) deserialize from a stream +/// - int soap_write__WS1__getProdResponse(soap*, _WS1__getProdResponse*) serialize to a stream +/// - _WS1__getProdResponse* _WS1__getProdResponse::soap_dup(soap*) returns deep copy of _WS1__getProdResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getProdResponse::soap_del() deep deletes _WS1__getProdResponse data members, use only after _WS1__getProdResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getProdResponse::soap_type() returns SOAP_TYPE__WS1__getProdResponse or derived type identifier +class _WS1__getProdResponse +{ public: +/// Element "getProdReturn" of type xs:string. + std::string getProdReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getSrv +/// @brief "http://entry.serviceengine.cross.digiwin.com":getSrv is a complexType. +/// +/// @note class _WS1__getSrv operations: +/// - _WS1__getSrv* soap_new__WS1__getSrv(soap*) allocate and default initialize +/// - _WS1__getSrv* soap_new__WS1__getSrv(soap*, int num) allocate and default initialize an array +/// - _WS1__getSrv* soap_new_req__WS1__getSrv(soap*, ...) allocate, set required members +/// - _WS1__getSrv* soap_new_set__WS1__getSrv(soap*, ...) allocate, set all public members +/// - _WS1__getSrv::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getSrv(soap*, _WS1__getSrv*) deserialize from a stream +/// - int soap_write__WS1__getSrv(soap*, _WS1__getSrv*) serialize to a stream +/// - _WS1__getSrv* _WS1__getSrv::soap_dup(soap*) returns deep copy of _WS1__getSrv, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getSrv::soap_del() deep deletes _WS1__getSrv data members, use only after _WS1__getSrv::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getSrv::soap_type() returns SOAP_TYPE__WS1__getSrv or derived type identifier +class _WS1__getSrv +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getSrvResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getSrvResponse is a complexType. +/// +/// @note class _WS1__getSrvResponse operations: +/// - _WS1__getSrvResponse* soap_new__WS1__getSrvResponse(soap*) allocate and default initialize +/// - _WS1__getSrvResponse* soap_new__WS1__getSrvResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getSrvResponse* soap_new_req__WS1__getSrvResponse(soap*, ...) allocate, set required members +/// - _WS1__getSrvResponse* soap_new_set__WS1__getSrvResponse(soap*, ...) allocate, set all public members +/// - _WS1__getSrvResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getSrvResponse(soap*, _WS1__getSrvResponse*) deserialize from a stream +/// - int soap_write__WS1__getSrvResponse(soap*, _WS1__getSrvResponse*) serialize to a stream +/// - _WS1__getSrvResponse* _WS1__getSrvResponse::soap_dup(soap*) returns deep copy of _WS1__getSrvResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getSrvResponse::soap_del() deep deletes _WS1__getSrvResponse data members, use only after _WS1__getSrvResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getSrvResponse::soap_type() returns SOAP_TYPE__WS1__getSrvResponse or derived type identifier +class _WS1__getSrvResponse +{ public: +/// Element "getSrvReturn" of type xs:string. + std::string getSrvReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":fpInvoke +/// @brief "http://entry.serviceengine.cross.digiwin.com":fpInvoke is a complexType. +/// +/// @note class _WS1__fpInvoke operations: +/// - _WS1__fpInvoke* soap_new__WS1__fpInvoke(soap*) allocate and default initialize +/// - _WS1__fpInvoke* soap_new__WS1__fpInvoke(soap*, int num) allocate and default initialize an array +/// - _WS1__fpInvoke* soap_new_req__WS1__fpInvoke(soap*, ...) allocate, set required members +/// - _WS1__fpInvoke* soap_new_set__WS1__fpInvoke(soap*, ...) allocate, set all public members +/// - _WS1__fpInvoke::soap_default(soap*) default initialize members +/// - int soap_read__WS1__fpInvoke(soap*, _WS1__fpInvoke*) deserialize from a stream +/// - int soap_write__WS1__fpInvoke(soap*, _WS1__fpInvoke*) serialize to a stream +/// - _WS1__fpInvoke* _WS1__fpInvoke::soap_dup(soap*) returns deep copy of _WS1__fpInvoke, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__fpInvoke::soap_del() deep deletes _WS1__fpInvoke data members, use only after _WS1__fpInvoke::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__fpInvoke::soap_type() returns SOAP_TYPE__WS1__fpInvoke or derived type identifier +class _WS1__fpInvoke +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":fpInvokeResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":fpInvokeResponse is a complexType. +/// +/// @note class _WS1__fpInvokeResponse operations: +/// - _WS1__fpInvokeResponse* soap_new__WS1__fpInvokeResponse(soap*) allocate and default initialize +/// - _WS1__fpInvokeResponse* soap_new__WS1__fpInvokeResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__fpInvokeResponse* soap_new_req__WS1__fpInvokeResponse(soap*, ...) allocate, set required members +/// - _WS1__fpInvokeResponse* soap_new_set__WS1__fpInvokeResponse(soap*, ...) allocate, set all public members +/// - _WS1__fpInvokeResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__fpInvokeResponse(soap*, _WS1__fpInvokeResponse*) deserialize from a stream +/// - int soap_write__WS1__fpInvokeResponse(soap*, _WS1__fpInvokeResponse*) serialize to a stream +/// - _WS1__fpInvokeResponse* _WS1__fpInvokeResponse::soap_dup(soap*) returns deep copy of _WS1__fpInvokeResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__fpInvokeResponse::soap_del() deep deletes _WS1__fpInvokeResponse data members, use only after _WS1__fpInvokeResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__fpInvokeResponse::soap_type() returns SOAP_TYPE__WS1__fpInvokeResponse or derived type identifier +class _WS1__fpInvokeResponse +{ public: +/// Element "fpInvokeReturn" of type xs:string. + std::string fpInvokeReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getStandardServiceList +/// @brief "http://entry.serviceengine.cross.digiwin.com":getStandardServiceList is a complexType. +/// +/// @note class _WS1__getStandardServiceList operations: +/// - _WS1__getStandardServiceList* soap_new__WS1__getStandardServiceList(soap*) allocate and default initialize +/// - _WS1__getStandardServiceList* soap_new__WS1__getStandardServiceList(soap*, int num) allocate and default initialize an array +/// - _WS1__getStandardServiceList* soap_new_req__WS1__getStandardServiceList(soap*, ...) allocate, set required members +/// - _WS1__getStandardServiceList* soap_new_set__WS1__getStandardServiceList(soap*, ...) allocate, set all public members +/// - _WS1__getStandardServiceList::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getStandardServiceList(soap*, _WS1__getStandardServiceList*) deserialize from a stream +/// - int soap_write__WS1__getStandardServiceList(soap*, _WS1__getStandardServiceList*) serialize to a stream +/// - _WS1__getStandardServiceList* _WS1__getStandardServiceList::soap_dup(soap*) returns deep copy of _WS1__getStandardServiceList, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getStandardServiceList::soap_del() deep deletes _WS1__getStandardServiceList data members, use only after _WS1__getStandardServiceList::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getStandardServiceList::soap_type() returns SOAP_TYPE__WS1__getStandardServiceList or derived type identifier +class _WS1__getStandardServiceList +{ public: +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getStandardServiceListResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getStandardServiceListResponse is a complexType. +/// +/// @note class _WS1__getStandardServiceListResponse operations: +/// - _WS1__getStandardServiceListResponse* soap_new__WS1__getStandardServiceListResponse(soap*) allocate and default initialize +/// - _WS1__getStandardServiceListResponse* soap_new__WS1__getStandardServiceListResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getStandardServiceListResponse* soap_new_req__WS1__getStandardServiceListResponse(soap*, ...) allocate, set required members +/// - _WS1__getStandardServiceListResponse* soap_new_set__WS1__getStandardServiceListResponse(soap*, ...) allocate, set all public members +/// - _WS1__getStandardServiceListResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getStandardServiceListResponse(soap*, _WS1__getStandardServiceListResponse*) deserialize from a stream +/// - int soap_write__WS1__getStandardServiceListResponse(soap*, _WS1__getStandardServiceListResponse*) serialize to a stream +/// - _WS1__getStandardServiceListResponse* _WS1__getStandardServiceListResponse::soap_dup(soap*) returns deep copy of _WS1__getStandardServiceListResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getStandardServiceListResponse::soap_del() deep deletes _WS1__getStandardServiceListResponse data members, use only after _WS1__getStandardServiceListResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getStandardServiceListResponse::soap_type() returns SOAP_TYPE__WS1__getStandardServiceListResponse or derived type identifier +class _WS1__getStandardServiceListResponse +{ public: +/// Element "getStandardServiceListReturn" of type xs:string. + std::string getStandardServiceListReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getStandardDataNameList +/// @brief "http://entry.serviceengine.cross.digiwin.com":getStandardDataNameList is a complexType. +/// +/// @note class _WS1__getStandardDataNameList operations: +/// - _WS1__getStandardDataNameList* soap_new__WS1__getStandardDataNameList(soap*) allocate and default initialize +/// - _WS1__getStandardDataNameList* soap_new__WS1__getStandardDataNameList(soap*, int num) allocate and default initialize an array +/// - _WS1__getStandardDataNameList* soap_new_req__WS1__getStandardDataNameList(soap*, ...) allocate, set required members +/// - _WS1__getStandardDataNameList* soap_new_set__WS1__getStandardDataNameList(soap*, ...) allocate, set all public members +/// - _WS1__getStandardDataNameList::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getStandardDataNameList(soap*, _WS1__getStandardDataNameList*) deserialize from a stream +/// - int soap_write__WS1__getStandardDataNameList(soap*, _WS1__getStandardDataNameList*) serialize to a stream +/// - _WS1__getStandardDataNameList* _WS1__getStandardDataNameList::soap_dup(soap*) returns deep copy of _WS1__getStandardDataNameList, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getStandardDataNameList::soap_del() deep deletes _WS1__getStandardDataNameList data members, use only after _WS1__getStandardDataNameList::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getStandardDataNameList::soap_type() returns SOAP_TYPE__WS1__getStandardDataNameList or derived type identifier +class _WS1__getStandardDataNameList +{ public: +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":getStandardDataNameListResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":getStandardDataNameListResponse is a complexType. +/// +/// @note class _WS1__getStandardDataNameListResponse operations: +/// - _WS1__getStandardDataNameListResponse* soap_new__WS1__getStandardDataNameListResponse(soap*) allocate and default initialize +/// - _WS1__getStandardDataNameListResponse* soap_new__WS1__getStandardDataNameListResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__getStandardDataNameListResponse* soap_new_req__WS1__getStandardDataNameListResponse(soap*, ...) allocate, set required members +/// - _WS1__getStandardDataNameListResponse* soap_new_set__WS1__getStandardDataNameListResponse(soap*, ...) allocate, set all public members +/// - _WS1__getStandardDataNameListResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__getStandardDataNameListResponse(soap*, _WS1__getStandardDataNameListResponse*) deserialize from a stream +/// - int soap_write__WS1__getStandardDataNameListResponse(soap*, _WS1__getStandardDataNameListResponse*) serialize to a stream +/// - _WS1__getStandardDataNameListResponse* _WS1__getStandardDataNameListResponse::soap_dup(soap*) returns deep copy of _WS1__getStandardDataNameListResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__getStandardDataNameListResponse::soap_del() deep deletes _WS1__getStandardDataNameListResponse data members, use only after _WS1__getStandardDataNameListResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__getStandardDataNameListResponse::soap_type() returns SOAP_TYPE__WS1__getStandardDataNameListResponse or derived type identifier +class _WS1__getStandardDataNameListResponse +{ public: +/// Element "getStandardDataNameListReturn" of type xs:string. + std::string getStandardDataNameListReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":regSrv +/// @brief "http://entry.serviceengine.cross.digiwin.com":regSrv is a complexType. +/// +/// @note class _WS1__regSrv operations: +/// - _WS1__regSrv* soap_new__WS1__regSrv(soap*) allocate and default initialize +/// - _WS1__regSrv* soap_new__WS1__regSrv(soap*, int num) allocate and default initialize an array +/// - _WS1__regSrv* soap_new_req__WS1__regSrv(soap*, ...) allocate, set required members +/// - _WS1__regSrv* soap_new_set__WS1__regSrv(soap*, ...) allocate, set all public members +/// - _WS1__regSrv::soap_default(soap*) default initialize members +/// - int soap_read__WS1__regSrv(soap*, _WS1__regSrv*) deserialize from a stream +/// - int soap_write__WS1__regSrv(soap*, _WS1__regSrv*) serialize to a stream +/// - _WS1__regSrv* _WS1__regSrv::soap_dup(soap*) returns deep copy of _WS1__regSrv, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__regSrv::soap_del() deep deletes _WS1__regSrv data members, use only after _WS1__regSrv::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__regSrv::soap_type() returns SOAP_TYPE__WS1__regSrv or derived type identifier +class _WS1__regSrv +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":regSrvResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":regSrvResponse is a complexType. +/// +/// @note class _WS1__regSrvResponse operations: +/// - _WS1__regSrvResponse* soap_new__WS1__regSrvResponse(soap*) allocate and default initialize +/// - _WS1__regSrvResponse* soap_new__WS1__regSrvResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__regSrvResponse* soap_new_req__WS1__regSrvResponse(soap*, ...) allocate, set required members +/// - _WS1__regSrvResponse* soap_new_set__WS1__regSrvResponse(soap*, ...) allocate, set all public members +/// - _WS1__regSrvResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__regSrvResponse(soap*, _WS1__regSrvResponse*) deserialize from a stream +/// - int soap_write__WS1__regSrvResponse(soap*, _WS1__regSrvResponse*) serialize to a stream +/// - _WS1__regSrvResponse* _WS1__regSrvResponse::soap_dup(soap*) returns deep copy of _WS1__regSrvResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__regSrvResponse::soap_del() deep deletes _WS1__regSrvResponse data members, use only after _WS1__regSrvResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__regSrvResponse::soap_type() returns SOAP_TYPE__WS1__regSrvResponse or derived type identifier +class _WS1__regSrvResponse +{ public: +/// Element "regSrvReturn" of type xs:string. + std::string regSrvReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":regEAI +/// @brief "http://entry.serviceengine.cross.digiwin.com":regEAI is a complexType. +/// +/// @note class _WS1__regEAI operations: +/// - _WS1__regEAI* soap_new__WS1__regEAI(soap*) allocate and default initialize +/// - _WS1__regEAI* soap_new__WS1__regEAI(soap*, int num) allocate and default initialize an array +/// - _WS1__regEAI* soap_new_req__WS1__regEAI(soap*, ...) allocate, set required members +/// - _WS1__regEAI* soap_new_set__WS1__regEAI(soap*, ...) allocate, set all public members +/// - _WS1__regEAI::soap_default(soap*) default initialize members +/// - int soap_read__WS1__regEAI(soap*, _WS1__regEAI*) deserialize from a stream +/// - int soap_write__WS1__regEAI(soap*, _WS1__regEAI*) serialize to a stream +/// - _WS1__regEAI* _WS1__regEAI::soap_dup(soap*) returns deep copy of _WS1__regEAI, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__regEAI::soap_del() deep deletes _WS1__regEAI data members, use only after _WS1__regEAI::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__regEAI::soap_type() returns SOAP_TYPE__WS1__regEAI or derived type identifier +class _WS1__regEAI +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":regEAIResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":regEAIResponse is a complexType. +/// +/// @note class _WS1__regEAIResponse operations: +/// - _WS1__regEAIResponse* soap_new__WS1__regEAIResponse(soap*) allocate and default initialize +/// - _WS1__regEAIResponse* soap_new__WS1__regEAIResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__regEAIResponse* soap_new_req__WS1__regEAIResponse(soap*, ...) allocate, set required members +/// - _WS1__regEAIResponse* soap_new_set__WS1__regEAIResponse(soap*, ...) allocate, set all public members +/// - _WS1__regEAIResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__regEAIResponse(soap*, _WS1__regEAIResponse*) deserialize from a stream +/// - int soap_write__WS1__regEAIResponse(soap*, _WS1__regEAIResponse*) serialize to a stream +/// - _WS1__regEAIResponse* _WS1__regEAIResponse::soap_dup(soap*) returns deep copy of _WS1__regEAIResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__regEAIResponse::soap_del() deep deletes _WS1__regEAIResponse data members, use only after _WS1__regEAIResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__regEAIResponse::soap_type() returns SOAP_TYPE__WS1__regEAIResponse or derived type identifier +class _WS1__regEAIResponse +{ public: +/// Element "regEAIReturn" of type xs:string. + std::string regEAIReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeSrv +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeSrv is a complexType. +/// +/// @note class _WS1__invokeSrv operations: +/// - _WS1__invokeSrv* soap_new__WS1__invokeSrv(soap*) allocate and default initialize +/// - _WS1__invokeSrv* soap_new__WS1__invokeSrv(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeSrv* soap_new_req__WS1__invokeSrv(soap*, ...) allocate, set required members +/// - _WS1__invokeSrv* soap_new_set__WS1__invokeSrv(soap*, ...) allocate, set all public members +/// - _WS1__invokeSrv::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeSrv(soap*, _WS1__invokeSrv*) deserialize from a stream +/// - int soap_write__WS1__invokeSrv(soap*, _WS1__invokeSrv*) serialize to a stream +/// - _WS1__invokeSrv* _WS1__invokeSrv::soap_dup(soap*) returns deep copy of _WS1__invokeSrv, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeSrv::soap_del() deep deletes _WS1__invokeSrv data members, use only after _WS1__invokeSrv::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeSrv::soap_type() returns SOAP_TYPE__WS1__invokeSrv or derived type identifier +class _WS1__invokeSrv +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":invokeSrvResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":invokeSrvResponse is a complexType. +/// +/// @note class _WS1__invokeSrvResponse operations: +/// - _WS1__invokeSrvResponse* soap_new__WS1__invokeSrvResponse(soap*) allocate and default initialize +/// - _WS1__invokeSrvResponse* soap_new__WS1__invokeSrvResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__invokeSrvResponse* soap_new_req__WS1__invokeSrvResponse(soap*, ...) allocate, set required members +/// - _WS1__invokeSrvResponse* soap_new_set__WS1__invokeSrvResponse(soap*, ...) allocate, set all public members +/// - _WS1__invokeSrvResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__invokeSrvResponse(soap*, _WS1__invokeSrvResponse*) deserialize from a stream +/// - int soap_write__WS1__invokeSrvResponse(soap*, _WS1__invokeSrvResponse*) serialize to a stream +/// - _WS1__invokeSrvResponse* _WS1__invokeSrvResponse::soap_dup(soap*) returns deep copy of _WS1__invokeSrvResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__invokeSrvResponse::soap_del() deep deletes _WS1__invokeSrvResponse data members, use only after _WS1__invokeSrvResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__invokeSrvResponse::soap_type() returns SOAP_TYPE__WS1__invokeSrvResponse or derived type identifier +class _WS1__invokeSrvResponse +{ public: +/// Element "invokeSrvReturn" of type xs:string. + std::string invokeSrvReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":escrowResendSrv +/// @brief "http://entry.serviceengine.cross.digiwin.com":escrowResendSrv is a complexType. +/// +/// @note class _WS1__escrowResendSrv operations: +/// - _WS1__escrowResendSrv* soap_new__WS1__escrowResendSrv(soap*) allocate and default initialize +/// - _WS1__escrowResendSrv* soap_new__WS1__escrowResendSrv(soap*, int num) allocate and default initialize an array +/// - _WS1__escrowResendSrv* soap_new_req__WS1__escrowResendSrv(soap*, ...) allocate, set required members +/// - _WS1__escrowResendSrv* soap_new_set__WS1__escrowResendSrv(soap*, ...) allocate, set all public members +/// - _WS1__escrowResendSrv::soap_default(soap*) default initialize members +/// - int soap_read__WS1__escrowResendSrv(soap*, _WS1__escrowResendSrv*) deserialize from a stream +/// - int soap_write__WS1__escrowResendSrv(soap*, _WS1__escrowResendSrv*) serialize to a stream +/// - _WS1__escrowResendSrv* _WS1__escrowResendSrv::soap_dup(soap*) returns deep copy of _WS1__escrowResendSrv, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__escrowResendSrv::soap_del() deep deletes _WS1__escrowResendSrv data members, use only after _WS1__escrowResendSrv::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__escrowResendSrv::soap_type() returns SOAP_TYPE__WS1__escrowResendSrv or derived type identifier +class _WS1__escrowResendSrv +{ public: +/// Element "in0" of type xs:string. + std::string in0 1; ///< Required element. +/// Element "in1" of type xs:string. + std::string in1 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + +/// @brief Top-level root element "http://entry.serviceengine.cross.digiwin.com":escrowResendSrvResponse +/// @brief "http://entry.serviceengine.cross.digiwin.com":escrowResendSrvResponse is a complexType. +/// +/// @note class _WS1__escrowResendSrvResponse operations: +/// - _WS1__escrowResendSrvResponse* soap_new__WS1__escrowResendSrvResponse(soap*) allocate and default initialize +/// - _WS1__escrowResendSrvResponse* soap_new__WS1__escrowResendSrvResponse(soap*, int num) allocate and default initialize an array +/// - _WS1__escrowResendSrvResponse* soap_new_req__WS1__escrowResendSrvResponse(soap*, ...) allocate, set required members +/// - _WS1__escrowResendSrvResponse* soap_new_set__WS1__escrowResendSrvResponse(soap*, ...) allocate, set all public members +/// - _WS1__escrowResendSrvResponse::soap_default(soap*) default initialize members +/// - int soap_read__WS1__escrowResendSrvResponse(soap*, _WS1__escrowResendSrvResponse*) deserialize from a stream +/// - int soap_write__WS1__escrowResendSrvResponse(soap*, _WS1__escrowResendSrvResponse*) serialize to a stream +/// - _WS1__escrowResendSrvResponse* _WS1__escrowResendSrvResponse::soap_dup(soap*) returns deep copy of _WS1__escrowResendSrvResponse, copies the (cyclic) graph structure when a context is provided, or (cycle-pruned) tree structure with soap_set_mode(soap, SOAP_XML_TREE) (use soapcpp2 -Ec) +/// - _WS1__escrowResendSrvResponse::soap_del() deep deletes _WS1__escrowResendSrvResponse data members, use only after _WS1__escrowResendSrvResponse::soap_dup(NULL) (use soapcpp2 -Ed) +/// - int _WS1__escrowResendSrvResponse::soap_type() returns SOAP_TYPE__WS1__escrowResendSrvResponse or derived type identifier +class _WS1__escrowResendSrvResponse +{ public: +/// Element "escrowResendSrvReturn" of type xs:string. + std::string escrowResendSrvReturn 1; ///< Required element. +/// Pointer to soap context that manages this instance. + struct soap *soap ; +}; + + +/******************************************************************************\ + * * + * Additional Top-Level Elements * + * http://entry.serviceengine.cross.digiwin.com * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Additional Top-Level Attributes * + * http://entry.serviceengine.cross.digiwin.com * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Services * + * * +\******************************************************************************/ + + +//gsoap WS1 service name: IntegrationEntrySoapBinding +//gsoap WS1 service type: IntegrationEntry +//gsoap WS1 service port: http://192.168.8.115:9999/IntegrationEntry +//gsoap WS1 service namespace: http://entry.serviceengine.cross.digiwin.com +//gsoap WS1 service transport: http://schemas.xmlsoap.org/soap/http + +/** @mainpage Service Definitions + +@section Service_bindings Service Bindings + + - @ref IntegrationEntrySoapBinding + +@section Service_more More Information + + - @ref page_notes "Notes" + + - @ref page_XMLDataBinding "XML Data Binding" + + - @ref SOAP_ENV__Header "SOAP Header Content" (when applicable) + + - @ref SOAP_ENV__Detail "SOAP Fault Detail Content" (when applicable) + + +*/ + +/** @page IntegrationEntrySoapBinding Binding "IntegrationEntrySoapBinding" + +@section IntegrationEntrySoapBinding_operations Operations of Binding "IntegrationEntrySoapBinding" + + - @ref __WS1__invokeEtl + + - @ref __WS1__getEtlJobList + + - @ref __WS1__getParamList + + - @ref __WS1__getProdList + + - @ref __WS1__regProdAP + + - @ref __WS1__invokeUnion + + - @ref __WS1__invokeMdm + + - @ref __WS1__getProd + + - @ref __WS1__getSrv + + - @ref __WS1__fpInvoke + + - @ref __WS1__getStandardServiceList + + - @ref __WS1__getStandardDataNameList + + - @ref __WS1__regSrv + + - @ref __WS1__regEAI + + - @ref __WS1__invokeSrv + + - @ref __WS1__escrowResendSrv + +@section IntegrationEntrySoapBinding_ports Default endpoints of Binding "IntegrationEntrySoapBinding" + + - http://192.168.8.115:9999/IntegrationEntry + +@note Use wsdl2h option -Nname to change the service binding prefix name + + +*/ + +/******************************************************************************\ + * * + * Service Binding * + * IntegrationEntrySoapBinding * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__invokeEtl * + * * +\******************************************************************************/ + + +/** Operation "__WS1__invokeEtl" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__invokeEtl( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__invokeEtl* WS1__invokeEtl, + // output parameters: + _WS1__invokeEtlResponse &WS1__invokeEtlResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__invokeEtl( + struct soap *soap, + // input parameters: + _WS1__invokeEtl* WS1__invokeEtl, + // output parameters: + _WS1__invokeEtlResponse &WS1__invokeEtlResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: invokeEtl SOAP +//gsoap WS1 service method-style: invokeEtl document +//gsoap WS1 service method-encoding: invokeEtl literal +//gsoap WS1 service method-action: invokeEtl "" +//gsoap WS1 service method-output-action: invokeEtl Response +int __WS1__invokeEtl( + _WS1__invokeEtl* WS1__invokeEtl, ///< Input parameter + _WS1__invokeEtlResponse &WS1__invokeEtlResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getEtlJobList * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getEtlJobList" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getEtlJobList( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getEtlJobList* WS1__getEtlJobList, + // output parameters: + _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getEtlJobList( + struct soap *soap, + // input parameters: + _WS1__getEtlJobList* WS1__getEtlJobList, + // output parameters: + _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getEtlJobList SOAP +//gsoap WS1 service method-style: getEtlJobList document +//gsoap WS1 service method-encoding: getEtlJobList literal +//gsoap WS1 service method-action: getEtlJobList "" +//gsoap WS1 service method-output-action: getEtlJobList Response +int __WS1__getEtlJobList( + _WS1__getEtlJobList* WS1__getEtlJobList, ///< Input parameter + _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getParamList * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getParamList" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getParamList( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getParamList* WS1__getParamList, + // output parameters: + _WS1__getParamListResponse &WS1__getParamListResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getParamList( + struct soap *soap, + // input parameters: + _WS1__getParamList* WS1__getParamList, + // output parameters: + _WS1__getParamListResponse &WS1__getParamListResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getParamList SOAP +//gsoap WS1 service method-style: getParamList document +//gsoap WS1 service method-encoding: getParamList literal +//gsoap WS1 service method-action: getParamList "" +//gsoap WS1 service method-output-action: getParamList Response +int __WS1__getParamList( + _WS1__getParamList* WS1__getParamList, ///< Input parameter + _WS1__getParamListResponse &WS1__getParamListResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getProdList * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getProdList" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getProdList( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getProdList* WS1__getProdList, + // output parameters: + _WS1__getProdListResponse &WS1__getProdListResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getProdList( + struct soap *soap, + // input parameters: + _WS1__getProdList* WS1__getProdList, + // output parameters: + _WS1__getProdListResponse &WS1__getProdListResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getProdList SOAP +//gsoap WS1 service method-style: getProdList document +//gsoap WS1 service method-encoding: getProdList literal +//gsoap WS1 service method-action: getProdList "" +//gsoap WS1 service method-output-action: getProdList Response +int __WS1__getProdList( + _WS1__getProdList* WS1__getProdList, ///< Input parameter + _WS1__getProdListResponse &WS1__getProdListResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__regProdAP * + * * +\******************************************************************************/ + + +/** Operation "__WS1__regProdAP" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__regProdAP( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__regProdAP* WS1__regProdAP, + // output parameters: + _WS1__regProdAPResponse &WS1__regProdAPResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__regProdAP( + struct soap *soap, + // input parameters: + _WS1__regProdAP* WS1__regProdAP, + // output parameters: + _WS1__regProdAPResponse &WS1__regProdAPResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: regProdAP SOAP +//gsoap WS1 service method-style: regProdAP document +//gsoap WS1 service method-encoding: regProdAP literal +//gsoap WS1 service method-action: regProdAP "" +//gsoap WS1 service method-output-action: regProdAP Response +int __WS1__regProdAP( + _WS1__regProdAP* WS1__regProdAP, ///< Input parameter + _WS1__regProdAPResponse &WS1__regProdAPResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__invokeUnion * + * * +\******************************************************************************/ + + +/** Operation "__WS1__invokeUnion" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__invokeUnion( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__invokeUnion* WS1__invokeUnion, + // output parameters: + _WS1__invokeUnionResponse &WS1__invokeUnionResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__invokeUnion( + struct soap *soap, + // input parameters: + _WS1__invokeUnion* WS1__invokeUnion, + // output parameters: + _WS1__invokeUnionResponse &WS1__invokeUnionResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: invokeUnion SOAP +//gsoap WS1 service method-style: invokeUnion document +//gsoap WS1 service method-encoding: invokeUnion literal +//gsoap WS1 service method-action: invokeUnion "" +//gsoap WS1 service method-output-action: invokeUnion Response +int __WS1__invokeUnion( + _WS1__invokeUnion* WS1__invokeUnion, ///< Input parameter + _WS1__invokeUnionResponse &WS1__invokeUnionResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__invokeMdm * + * * +\******************************************************************************/ + + +/** Operation "__WS1__invokeMdm" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__invokeMdm( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__invokeMdm* WS1__invokeMdm, + // output parameters: + _WS1__invokeMdmResponse &WS1__invokeMdmResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__invokeMdm( + struct soap *soap, + // input parameters: + _WS1__invokeMdm* WS1__invokeMdm, + // output parameters: + _WS1__invokeMdmResponse &WS1__invokeMdmResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: invokeMdm SOAP +//gsoap WS1 service method-style: invokeMdm document +//gsoap WS1 service method-encoding: invokeMdm literal +//gsoap WS1 service method-action: invokeMdm "" +//gsoap WS1 service method-output-action: invokeMdm Response +int __WS1__invokeMdm( + _WS1__invokeMdm* WS1__invokeMdm, ///< Input parameter + _WS1__invokeMdmResponse &WS1__invokeMdmResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getProd * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getProd" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getProd( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getProd* WS1__getProd, + // output parameters: + _WS1__getProdResponse &WS1__getProdResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getProd( + struct soap *soap, + // input parameters: + _WS1__getProd* WS1__getProd, + // output parameters: + _WS1__getProdResponse &WS1__getProdResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getProd SOAP +//gsoap WS1 service method-style: getProd document +//gsoap WS1 service method-encoding: getProd literal +//gsoap WS1 service method-action: getProd "" +//gsoap WS1 service method-output-action: getProd Response +int __WS1__getProd( + _WS1__getProd* WS1__getProd, ///< Input parameter + _WS1__getProdResponse &WS1__getProdResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getSrv * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getSrv" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getSrv( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getSrv* WS1__getSrv, + // output parameters: + _WS1__getSrvResponse &WS1__getSrvResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getSrv( + struct soap *soap, + // input parameters: + _WS1__getSrv* WS1__getSrv, + // output parameters: + _WS1__getSrvResponse &WS1__getSrvResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getSrv SOAP +//gsoap WS1 service method-style: getSrv document +//gsoap WS1 service method-encoding: getSrv literal +//gsoap WS1 service method-action: getSrv "" +//gsoap WS1 service method-output-action: getSrv Response +int __WS1__getSrv( + _WS1__getSrv* WS1__getSrv, ///< Input parameter + _WS1__getSrvResponse &WS1__getSrvResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__fpInvoke * + * * +\******************************************************************************/ + + +/** Operation "__WS1__fpInvoke" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__fpInvoke( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__fpInvoke* WS1__fpInvoke, + // output parameters: + _WS1__fpInvokeResponse &WS1__fpInvokeResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__fpInvoke( + struct soap *soap, + // input parameters: + _WS1__fpInvoke* WS1__fpInvoke, + // output parameters: + _WS1__fpInvokeResponse &WS1__fpInvokeResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: fpInvoke SOAP +//gsoap WS1 service method-style: fpInvoke document +//gsoap WS1 service method-encoding: fpInvoke literal +//gsoap WS1 service method-action: fpInvoke "" +//gsoap WS1 service method-output-action: fpInvoke Response +int __WS1__fpInvoke( + _WS1__fpInvoke* WS1__fpInvoke, ///< Input parameter + _WS1__fpInvokeResponse &WS1__fpInvokeResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getStandardServiceList * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getStandardServiceList" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getStandardServiceList( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getStandardServiceList* WS1__getStandardServiceList, + // output parameters: + _WS1__getStandardServiceListResponse&WS1__getStandardServiceListResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getStandardServiceList( + struct soap *soap, + // input parameters: + _WS1__getStandardServiceList* WS1__getStandardServiceList, + // output parameters: + _WS1__getStandardServiceListResponse&WS1__getStandardServiceListResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getStandardServiceList SOAP +//gsoap WS1 service method-style: getStandardServiceList document +//gsoap WS1 service method-encoding: getStandardServiceList literal +//gsoap WS1 service method-action: getStandardServiceList "" +//gsoap WS1 service method-output-action: getStandardServiceList Response +int __WS1__getStandardServiceList( + _WS1__getStandardServiceList* WS1__getStandardServiceList, ///< Input parameter + _WS1__getStandardServiceListResponse&WS1__getStandardServiceListResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__getStandardDataNameList * + * * +\******************************************************************************/ + + +/** Operation "__WS1__getStandardDataNameList" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__getStandardDataNameList( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__getStandardDataNameList* WS1__getStandardDataNameList, + // output parameters: + _WS1__getStandardDataNameListResponse&WS1__getStandardDataNameListResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__getStandardDataNameList( + struct soap *soap, + // input parameters: + _WS1__getStandardDataNameList* WS1__getStandardDataNameList, + // output parameters: + _WS1__getStandardDataNameListResponse&WS1__getStandardDataNameListResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: getStandardDataNameList SOAP +//gsoap WS1 service method-style: getStandardDataNameList document +//gsoap WS1 service method-encoding: getStandardDataNameList literal +//gsoap WS1 service method-action: getStandardDataNameList "" +//gsoap WS1 service method-output-action: getStandardDataNameList Response +int __WS1__getStandardDataNameList( + _WS1__getStandardDataNameList* WS1__getStandardDataNameList, ///< Input parameter + _WS1__getStandardDataNameListResponse&WS1__getStandardDataNameListResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__regSrv * + * * +\******************************************************************************/ + + +/** Operation "__WS1__regSrv" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__regSrv( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__regSrv* WS1__regSrv, + // output parameters: + _WS1__regSrvResponse &WS1__regSrvResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__regSrv( + struct soap *soap, + // input parameters: + _WS1__regSrv* WS1__regSrv, + // output parameters: + _WS1__regSrvResponse &WS1__regSrvResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: regSrv SOAP +//gsoap WS1 service method-style: regSrv document +//gsoap WS1 service method-encoding: regSrv literal +//gsoap WS1 service method-action: regSrv "" +//gsoap WS1 service method-output-action: regSrv Response +int __WS1__regSrv( + _WS1__regSrv* WS1__regSrv, ///< Input parameter + _WS1__regSrvResponse &WS1__regSrvResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__regEAI * + * * +\******************************************************************************/ + + +/** Operation "__WS1__regEAI" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__regEAI( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__regEAI* WS1__regEAI, + // output parameters: + _WS1__regEAIResponse &WS1__regEAIResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__regEAI( + struct soap *soap, + // input parameters: + _WS1__regEAI* WS1__regEAI, + // output parameters: + _WS1__regEAIResponse &WS1__regEAIResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: regEAI SOAP +//gsoap WS1 service method-style: regEAI document +//gsoap WS1 service method-encoding: regEAI literal +//gsoap WS1 service method-action: regEAI "" +//gsoap WS1 service method-output-action: regEAI Response +int __WS1__regEAI( + _WS1__regEAI* WS1__regEAI, ///< Input parameter + _WS1__regEAIResponse &WS1__regEAIResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__invokeSrv * + * * +\******************************************************************************/ + + +/** Operation "__WS1__invokeSrv" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__invokeSrv( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__invokeSrv* WS1__invokeSrv, + // output parameters: + _WS1__invokeSrvResponse &WS1__invokeSrvResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__invokeSrv( + struct soap *soap, + // input parameters: + _WS1__invokeSrv* WS1__invokeSrv, + // output parameters: + _WS1__invokeSrvResponse &WS1__invokeSrvResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: invokeSrv SOAP +//gsoap WS1 service method-style: invokeSrv document +//gsoap WS1 service method-encoding: invokeSrv literal +//gsoap WS1 service method-action: invokeSrv "" +//gsoap WS1 service method-output-action: invokeSrv Response +int __WS1__invokeSrv( + _WS1__invokeSrv* WS1__invokeSrv, ///< Input parameter + _WS1__invokeSrvResponse &WS1__invokeSrvResponse ///< Output parameter +); + +/******************************************************************************\ + * * + * Service Operation * + * __WS1__escrowResendSrv * + * * +\******************************************************************************/ + + +/** Operation "__WS1__escrowResendSrv" of service binding "IntegrationEntrySoapBinding". + + - SOAP document/literal style messaging + + - Default endpoints: + - http://192.168.8.115:9999/IntegrationEntry + + - Addressing input action: "" + + - Addressing output action: "Response" + +C stub function (defined in soapClient.c[pp] generated by soapcpp2): +@code + int soap_call___WS1__escrowResendSrv( + struct soap *soap, + NULL, // char *endpoint = NULL selects default endpoint for this operation + NULL, // char *action = NULL selects default action for this operation + // input parameters: + _WS1__escrowResendSrv* WS1__escrowResendSrv, + // output parameters: + _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse + ); +@endcode + +C server function (called from the service dispatcher defined in soapServer.c[pp]): +@code + int __WS1__escrowResendSrv( + struct soap *soap, + // input parameters: + _WS1__escrowResendSrv* WS1__escrowResendSrv, + // output parameters: + _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse + ); +@endcode + +C++ proxy class (defined in soapIntegrationEntrySoapBindingProxy.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingProxy; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use proxy classes; + +C++ service class (defined in soapIntegrationEntrySoapBindingService.h generated with soapcpp2): +@code + class IntegrationEntrySoapBindingService; +@endcode +Important: use soapcpp2 option '-j' (or '-i') to generate improved and easy-to-use service classes; + +*/ + +//gsoap WS1 service method-protocol: escrowResendSrv SOAP +//gsoap WS1 service method-style: escrowResendSrv document +//gsoap WS1 service method-encoding: escrowResendSrv literal +//gsoap WS1 service method-action: escrowResendSrv "" +//gsoap WS1 service method-output-action: escrowResendSrv Response +int __WS1__escrowResendSrv( + _WS1__escrowResendSrv* WS1__escrowResendSrv, ///< Input parameter + _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse ///< Output parameter +); + +/** @page IntegrationEntrySoapBinding Binding "IntegrationEntrySoapBinding" + +@section IntegrationEntrySoapBinding_policy_enablers Policy Enablers of Binding "IntegrationEntrySoapBinding" + +None specified. + +*/ + +/******************************************************************************\ + * * + * XML Data Binding * + * * +\******************************************************************************/ + + +/** @page page_XMLDataBinding XML Data Binding + +SOAP/XML services use data bindings that are contractually bound by WSDLs and +are auto-generated by wsdl2h and soapcpp2 (see Service Bindings). Plain data +bindings are adopted from XML schemas as part of the WSDL types section or when +running wsdl2h on a set of schemas to produce non-SOAP-based XML data bindings. + +@note The following readers and writers are C/C++ data type (de)serializers +auto-generated by wsdl2h and soapcpp2. Run soapcpp2 on this file to generate the +(de)serialization code, which is stored in soapC.c[pp]. Include "soapH.h" in +your code to import these data type and function declarations. Only use the +soapcpp2-generated files in your project build. Do not include the wsdl2h- +generated .h file in your code. + +@note Data can be read and deserialized from: + - an int file descriptor, using soap->recvfd = fd + - a socket, using soap->socket = (int)... + - a C++ stream (istream, stringstream), using soap->is = (istream*)... + - a C string, using soap->is = (const char*)... + - any input, using the soap->frecv() callback + +@note Data can be serialized and written to: + - an int file descriptor, using soap->sendfd = (int)... + - a socket, using soap->socket = (int)... + - a C++ stream (ostream, stringstream), using soap->os = (ostream*)... + - a C string, using soap->os = (const char**)... + - any output, using the soap->fsend() callback + +@note The following options are available for (de)serialization control: + - soap->encodingStyle = NULL; to remove SOAP 1.1/1.2 encodingStyle + - soap_set_mode(soap, SOAP_XML_TREE); XML without id-ref (no cycles!) + - soap_set_mode(soap, SOAP_XML_GRAPH); XML with id-ref (including cycles) + - soap_set_namespaces(soap, struct Namespace *nsmap); to set xmlns bindings + + +*/ + +/** + +@section WS1 Top-level root elements of schema "http://entry.serviceengine.cross.digiwin.com" + + - @ref _WS1__invokeEtl + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeEtl(struct soap*, _WS1__invokeEtl*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeEtl(struct soap*, _WS1__invokeEtl*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeEtl(struct soap*, const char *URL, _WS1__invokeEtl*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeEtl(struct soap*, const char *URL, _WS1__invokeEtl*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeEtl(struct soap*, const char *URL, _WS1__invokeEtl*); + soap_POST_recv__WS1__invokeEtl(struct soap*, _WS1__invokeEtl*); + @endcode + + - @ref _WS1__invokeEtlResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeEtlResponse(struct soap*, _WS1__invokeEtlResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeEtlResponse(struct soap*, _WS1__invokeEtlResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeEtlResponse(struct soap*, const char *URL, _WS1__invokeEtlResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeEtlResponse(struct soap*, const char *URL, _WS1__invokeEtlResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeEtlResponse(struct soap*, const char *URL, _WS1__invokeEtlResponse*); + soap_POST_recv__WS1__invokeEtlResponse(struct soap*, _WS1__invokeEtlResponse*); + @endcode + + - @ref _WS1__getEtlJobList + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getEtlJobList(struct soap*, const char *URL, _WS1__getEtlJobList*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getEtlJobList(struct soap*, const char *URL, _WS1__getEtlJobList*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getEtlJobList(struct soap*, const char *URL, _WS1__getEtlJobList*); + soap_POST_recv__WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList*); + @endcode + + - @ref _WS1__getEtlJobListResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getEtlJobListResponse(struct soap*, _WS1__getEtlJobListResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getEtlJobListResponse(struct soap*, _WS1__getEtlJobListResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getEtlJobListResponse(struct soap*, const char *URL, _WS1__getEtlJobListResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getEtlJobListResponse(struct soap*, const char *URL, _WS1__getEtlJobListResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getEtlJobListResponse(struct soap*, const char *URL, _WS1__getEtlJobListResponse*); + soap_POST_recv__WS1__getEtlJobListResponse(struct soap*, _WS1__getEtlJobListResponse*); + @endcode + + - @ref _WS1__getParamList + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getParamList(struct soap*, _WS1__getParamList*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getParamList(struct soap*, _WS1__getParamList*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getParamList(struct soap*, const char *URL, _WS1__getParamList*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getParamList(struct soap*, const char *URL, _WS1__getParamList*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getParamList(struct soap*, const char *URL, _WS1__getParamList*); + soap_POST_recv__WS1__getParamList(struct soap*, _WS1__getParamList*); + @endcode + + - @ref _WS1__getParamListResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getParamListResponse(struct soap*, _WS1__getParamListResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getParamListResponse(struct soap*, _WS1__getParamListResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getParamListResponse(struct soap*, const char *URL, _WS1__getParamListResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getParamListResponse(struct soap*, const char *URL, _WS1__getParamListResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getParamListResponse(struct soap*, const char *URL, _WS1__getParamListResponse*); + soap_POST_recv__WS1__getParamListResponse(struct soap*, _WS1__getParamListResponse*); + @endcode + + - @ref _WS1__getProdList + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getProdList(struct soap*, _WS1__getProdList*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getProdList(struct soap*, _WS1__getProdList*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getProdList(struct soap*, const char *URL, _WS1__getProdList*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getProdList(struct soap*, const char *URL, _WS1__getProdList*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getProdList(struct soap*, const char *URL, _WS1__getProdList*); + soap_POST_recv__WS1__getProdList(struct soap*, _WS1__getProdList*); + @endcode + + - @ref _WS1__getProdListResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getProdListResponse(struct soap*, _WS1__getProdListResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getProdListResponse(struct soap*, _WS1__getProdListResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getProdListResponse(struct soap*, const char *URL, _WS1__getProdListResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getProdListResponse(struct soap*, const char *URL, _WS1__getProdListResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getProdListResponse(struct soap*, const char *URL, _WS1__getProdListResponse*); + soap_POST_recv__WS1__getProdListResponse(struct soap*, _WS1__getProdListResponse*); + @endcode + + - @ref _WS1__regProdAP + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__regProdAP(struct soap*, _WS1__regProdAP*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__regProdAP(struct soap*, _WS1__regProdAP*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__regProdAP(struct soap*, const char *URL, _WS1__regProdAP*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__regProdAP(struct soap*, const char *URL, _WS1__regProdAP*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__regProdAP(struct soap*, const char *URL, _WS1__regProdAP*); + soap_POST_recv__WS1__regProdAP(struct soap*, _WS1__regProdAP*); + @endcode + + - @ref _WS1__regProdAPResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__regProdAPResponse(struct soap*, _WS1__regProdAPResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__regProdAPResponse(struct soap*, _WS1__regProdAPResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__regProdAPResponse(struct soap*, const char *URL, _WS1__regProdAPResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__regProdAPResponse(struct soap*, const char *URL, _WS1__regProdAPResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__regProdAPResponse(struct soap*, const char *URL, _WS1__regProdAPResponse*); + soap_POST_recv__WS1__regProdAPResponse(struct soap*, _WS1__regProdAPResponse*); + @endcode + + - @ref _WS1__invokeUnion + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeUnion(struct soap*, _WS1__invokeUnion*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeUnion(struct soap*, _WS1__invokeUnion*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeUnion(struct soap*, const char *URL, _WS1__invokeUnion*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeUnion(struct soap*, const char *URL, _WS1__invokeUnion*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeUnion(struct soap*, const char *URL, _WS1__invokeUnion*); + soap_POST_recv__WS1__invokeUnion(struct soap*, _WS1__invokeUnion*); + @endcode + + - @ref _WS1__invokeUnionResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeUnionResponse(struct soap*, _WS1__invokeUnionResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeUnionResponse(struct soap*, _WS1__invokeUnionResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeUnionResponse(struct soap*, const char *URL, _WS1__invokeUnionResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeUnionResponse(struct soap*, const char *URL, _WS1__invokeUnionResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeUnionResponse(struct soap*, const char *URL, _WS1__invokeUnionResponse*); + soap_POST_recv__WS1__invokeUnionResponse(struct soap*, _WS1__invokeUnionResponse*); + @endcode + + - @ref _WS1__invokeMdm + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeMdm(struct soap*, _WS1__invokeMdm*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeMdm(struct soap*, _WS1__invokeMdm*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeMdm(struct soap*, const char *URL, _WS1__invokeMdm*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeMdm(struct soap*, const char *URL, _WS1__invokeMdm*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeMdm(struct soap*, const char *URL, _WS1__invokeMdm*); + soap_POST_recv__WS1__invokeMdm(struct soap*, _WS1__invokeMdm*); + @endcode + + - @ref _WS1__invokeMdmResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeMdmResponse(struct soap*, _WS1__invokeMdmResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeMdmResponse(struct soap*, _WS1__invokeMdmResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeMdmResponse(struct soap*, const char *URL, _WS1__invokeMdmResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeMdmResponse(struct soap*, const char *URL, _WS1__invokeMdmResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeMdmResponse(struct soap*, const char *URL, _WS1__invokeMdmResponse*); + soap_POST_recv__WS1__invokeMdmResponse(struct soap*, _WS1__invokeMdmResponse*); + @endcode + + - @ref _WS1__getProd + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getProd(struct soap*, _WS1__getProd*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getProd(struct soap*, _WS1__getProd*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getProd(struct soap*, const char *URL, _WS1__getProd*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getProd(struct soap*, const char *URL, _WS1__getProd*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getProd(struct soap*, const char *URL, _WS1__getProd*); + soap_POST_recv__WS1__getProd(struct soap*, _WS1__getProd*); + @endcode + + - @ref _WS1__getProdResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getProdResponse(struct soap*, _WS1__getProdResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getProdResponse(struct soap*, _WS1__getProdResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getProdResponse(struct soap*, const char *URL, _WS1__getProdResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getProdResponse(struct soap*, const char *URL, _WS1__getProdResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getProdResponse(struct soap*, const char *URL, _WS1__getProdResponse*); + soap_POST_recv__WS1__getProdResponse(struct soap*, _WS1__getProdResponse*); + @endcode + + - @ref _WS1__getSrv + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getSrv(struct soap*, _WS1__getSrv*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getSrv(struct soap*, _WS1__getSrv*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getSrv(struct soap*, const char *URL, _WS1__getSrv*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getSrv(struct soap*, const char *URL, _WS1__getSrv*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getSrv(struct soap*, const char *URL, _WS1__getSrv*); + soap_POST_recv__WS1__getSrv(struct soap*, _WS1__getSrv*); + @endcode + + - @ref _WS1__getSrvResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getSrvResponse(struct soap*, _WS1__getSrvResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getSrvResponse(struct soap*, _WS1__getSrvResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getSrvResponse(struct soap*, const char *URL, _WS1__getSrvResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getSrvResponse(struct soap*, const char *URL, _WS1__getSrvResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getSrvResponse(struct soap*, const char *URL, _WS1__getSrvResponse*); + soap_POST_recv__WS1__getSrvResponse(struct soap*, _WS1__getSrvResponse*); + @endcode + + - @ref _WS1__fpInvoke + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__fpInvoke(struct soap*, _WS1__fpInvoke*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__fpInvoke(struct soap*, _WS1__fpInvoke*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__fpInvoke(struct soap*, const char *URL, _WS1__fpInvoke*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__fpInvoke(struct soap*, const char *URL, _WS1__fpInvoke*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__fpInvoke(struct soap*, const char *URL, _WS1__fpInvoke*); + soap_POST_recv__WS1__fpInvoke(struct soap*, _WS1__fpInvoke*); + @endcode + + - @ref _WS1__fpInvokeResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__fpInvokeResponse(struct soap*, _WS1__fpInvokeResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__fpInvokeResponse(struct soap*, _WS1__fpInvokeResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__fpInvokeResponse(struct soap*, const char *URL, _WS1__fpInvokeResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__fpInvokeResponse(struct soap*, const char *URL, _WS1__fpInvokeResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__fpInvokeResponse(struct soap*, const char *URL, _WS1__fpInvokeResponse*); + soap_POST_recv__WS1__fpInvokeResponse(struct soap*, _WS1__fpInvokeResponse*); + @endcode + + - @ref _WS1__getStandardServiceList + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getStandardServiceList(struct soap*, const char *URL, _WS1__getStandardServiceList*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getStandardServiceList(struct soap*, const char *URL, _WS1__getStandardServiceList*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getStandardServiceList(struct soap*, const char *URL, _WS1__getStandardServiceList*); + soap_POST_recv__WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList*); + @endcode + + - @ref _WS1__getStandardServiceListResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getStandardServiceListResponse(struct soap*, _WS1__getStandardServiceListResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getStandardServiceListResponse(struct soap*, _WS1__getStandardServiceListResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getStandardServiceListResponse(struct soap*, const char *URL, _WS1__getStandardServiceListResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getStandardServiceListResponse(struct soap*, const char *URL, _WS1__getStandardServiceListResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getStandardServiceListResponse(struct soap*, const char *URL, _WS1__getStandardServiceListResponse*); + soap_POST_recv__WS1__getStandardServiceListResponse(struct soap*, _WS1__getStandardServiceListResponse*); + @endcode + + - @ref _WS1__getStandardDataNameList + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getStandardDataNameList(struct soap*, const char *URL, _WS1__getStandardDataNameList*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getStandardDataNameList(struct soap*, const char *URL, _WS1__getStandardDataNameList*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getStandardDataNameList(struct soap*, const char *URL, _WS1__getStandardDataNameList*); + soap_POST_recv__WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList*); + @endcode + + - @ref _WS1__getStandardDataNameListResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__getStandardDataNameListResponse(struct soap*, _WS1__getStandardDataNameListResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__getStandardDataNameListResponse(struct soap*, _WS1__getStandardDataNameListResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__getStandardDataNameListResponse(struct soap*, const char *URL, _WS1__getStandardDataNameListResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__getStandardDataNameListResponse(struct soap*, const char *URL, _WS1__getStandardDataNameListResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__getStandardDataNameListResponse(struct soap*, const char *URL, _WS1__getStandardDataNameListResponse*); + soap_POST_recv__WS1__getStandardDataNameListResponse(struct soap*, _WS1__getStandardDataNameListResponse*); + @endcode + + - @ref _WS1__regSrv + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__regSrv(struct soap*, _WS1__regSrv*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__regSrv(struct soap*, _WS1__regSrv*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__regSrv(struct soap*, const char *URL, _WS1__regSrv*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__regSrv(struct soap*, const char *URL, _WS1__regSrv*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__regSrv(struct soap*, const char *URL, _WS1__regSrv*); + soap_POST_recv__WS1__regSrv(struct soap*, _WS1__regSrv*); + @endcode + + - @ref _WS1__regSrvResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__regSrvResponse(struct soap*, _WS1__regSrvResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__regSrvResponse(struct soap*, _WS1__regSrvResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__regSrvResponse(struct soap*, const char *URL, _WS1__regSrvResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__regSrvResponse(struct soap*, const char *URL, _WS1__regSrvResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__regSrvResponse(struct soap*, const char *URL, _WS1__regSrvResponse*); + soap_POST_recv__WS1__regSrvResponse(struct soap*, _WS1__regSrvResponse*); + @endcode + + - @ref _WS1__regEAI + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__regEAI(struct soap*, _WS1__regEAI*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__regEAI(struct soap*, _WS1__regEAI*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__regEAI(struct soap*, const char *URL, _WS1__regEAI*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__regEAI(struct soap*, const char *URL, _WS1__regEAI*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__regEAI(struct soap*, const char *URL, _WS1__regEAI*); + soap_POST_recv__WS1__regEAI(struct soap*, _WS1__regEAI*); + @endcode + + - @ref _WS1__regEAIResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__regEAIResponse(struct soap*, _WS1__regEAIResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__regEAIResponse(struct soap*, _WS1__regEAIResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__regEAIResponse(struct soap*, const char *URL, _WS1__regEAIResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__regEAIResponse(struct soap*, const char *URL, _WS1__regEAIResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__regEAIResponse(struct soap*, const char *URL, _WS1__regEAIResponse*); + soap_POST_recv__WS1__regEAIResponse(struct soap*, _WS1__regEAIResponse*); + @endcode + + - @ref _WS1__invokeSrv + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeSrv(struct soap*, _WS1__invokeSrv*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeSrv(struct soap*, _WS1__invokeSrv*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeSrv(struct soap*, const char *URL, _WS1__invokeSrv*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeSrv(struct soap*, const char *URL, _WS1__invokeSrv*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeSrv(struct soap*, const char *URL, _WS1__invokeSrv*); + soap_POST_recv__WS1__invokeSrv(struct soap*, _WS1__invokeSrv*); + @endcode + + - @ref _WS1__invokeSrvResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__invokeSrvResponse(struct soap*, _WS1__invokeSrvResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__invokeSrvResponse(struct soap*, _WS1__invokeSrvResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__invokeSrvResponse(struct soap*, const char *URL, _WS1__invokeSrvResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__invokeSrvResponse(struct soap*, const char *URL, _WS1__invokeSrvResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__invokeSrvResponse(struct soap*, const char *URL, _WS1__invokeSrvResponse*); + soap_POST_recv__WS1__invokeSrvResponse(struct soap*, _WS1__invokeSrvResponse*); + @endcode + + - @ref _WS1__escrowResendSrv + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__escrowResendSrv(struct soap*, const char *URL, _WS1__escrowResendSrv*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__escrowResendSrv(struct soap*, const char *URL, _WS1__escrowResendSrv*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__escrowResendSrv(struct soap*, const char *URL, _WS1__escrowResendSrv*); + soap_POST_recv__WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv*); + @endcode + + - @ref _WS1__escrowResendSrvResponse + @code + // Reader (returns SOAP_OK on success): + soap_read__WS1__escrowResendSrvResponse(struct soap*, _WS1__escrowResendSrvResponse*); + // Writer (returns SOAP_OK on success): + soap_write__WS1__escrowResendSrvResponse(struct soap*, _WS1__escrowResendSrvResponse*); + // REST GET (returns SOAP_OK on success): + soap_GET__WS1__escrowResendSrvResponse(struct soap*, const char *URL, _WS1__escrowResendSrvResponse*); + // REST PUT (returns SOAP_OK on success): + soap_PUT__WS1__escrowResendSrvResponse(struct soap*, const char *URL, _WS1__escrowResendSrvResponse*); + // REST POST (returns SOAP_OK on success): + soap_POST_send__WS1__escrowResendSrvResponse(struct soap*, const char *URL, _WS1__escrowResendSrvResponse*); + soap_POST_recv__WS1__escrowResendSrvResponse(struct soap*, _WS1__escrowResendSrvResponse*); + @endcode + +*/ + +/* End of cross.h */ diff --git a/connor_erp_mes/crossC.cpp b/connor_erp_mes/crossC.cpp new file mode 100644 index 0000000..80cff3f --- /dev/null +++ b/connor_erp_mes/crossC.cpp @@ -0,0 +1,9371 @@ +/* crossC.cpp + Generated by gSOAP 2.8.91 for cross.h + +gSOAP XML Web services tools +Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#if defined(__BORLANDC__) +#pragma option push -w-8060 +#pragma option push -w-8004 +#endif + +#include "crossH.h" + +SOAP_SOURCE_STAMP("@(#) crossC.cpp ver 2.8.91 2021-05-24 02:42:29 GMT") + + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap *soap) +{ + soap->part = SOAP_IN_HEADER; + soap->header = soap_in_SOAP_ENV__Header(soap, "SOAP-ENV:Header", soap->header, NULL); + soap->part = SOAP_END_HEADER; + return soap->header == NULL; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap *soap) +{ + if (soap->version && soap->header) + { soap->part = SOAP_IN_HEADER; + if (soap_out_SOAP_ENV__Header(soap, "SOAP-ENV:Header", 0, soap->header, "")) + return soap->error; + soap->part = SOAP_END_HEADER; + } + return SOAP_OK; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap *soap) +{ + if (soap->version && soap->header) + soap_serialize_SOAP_ENV__Header(soap, soap->header); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap *soap) +{ + if (soap->header == NULL) + { if ((soap->header = soap_new_SOAP_ENV__Header(soap))) + soap_default_SOAP_ENV__Header(soap, soap->header); + } +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap *soap) +{ + if (soap->fault == NULL) + { soap->fault = soap_new_SOAP_ENV__Fault(soap, -1); + if (soap->fault == NULL) + return; + } + if (soap->version == 2 && soap->fault->SOAP_ENV__Code == NULL) + soap->fault->SOAP_ENV__Code = soap_new_SOAP_ENV__Code(soap, -1); + if (soap->version == 2 && soap->fault->SOAP_ENV__Reason == NULL) + soap->fault->SOAP_ENV__Reason = soap_new_SOAP_ENV__Reason(soap, -1); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap *soap) +{ + if (soap->fault) + soap_serialize_SOAP_ENV__Fault(soap, soap->fault); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_putfault(struct soap *soap) +{ + if (soap->fault) + return soap_put_SOAP_ENV__Fault(soap, soap->fault, "SOAP-ENV:Fault", ""); + return SOAP_OK; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_getfault(struct soap *soap) +{ + return (soap->fault = soap_get_SOAP_ENV__Fault(soap, NULL, "SOAP-ENV:Fault", NULL)) == NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Code) + return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value; + return (const char**)(void*)&soap->fault->faultcode; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Code) + { if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL) + { soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = soap_new_SOAP_ENV__Code(soap, -1); + if (soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode == NULL) + return NULL; + } + return (const char**)(void*)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value; + } + return (const char**)(void*)&soap->fault->faultcode; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_subcode(struct soap *soap) +{ + const char **s = soap_faultsubcode(soap); + return s ? *s : NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2 && soap->fault->SOAP_ENV__Reason) + return (const char**)(void*)&soap->fault->SOAP_ENV__Reason->SOAP_ENV__Text; + return (const char**)(void*)&soap->fault->faultstring; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_string(struct soap *soap) +{ + const char **s = soap_faultstring(soap); + return s ? *s : NULL; +} + +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap *soap) +{ + soap_fault(soap); + if (soap->fault == NULL) + return NULL; + if (soap->version == 2) + { if (soap->fault->SOAP_ENV__Detail == NULL) + soap->fault->SOAP_ENV__Detail = soap_new_SOAP_ENV__Detail(soap, -1); + return (const char**)(void*)&soap->fault->SOAP_ENV__Detail->__any; + } + if (soap->fault->detail == NULL) + soap->fault->detail = soap_new_SOAP_ENV__Detail(soap, -1); + return (const char**)(void*)&soap->fault->detail->__any; +} + +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_detail(struct soap *soap) +{ + const char **s = soap_faultdetail(soap); + return s ? *s : NULL; +} + +#endif + +#ifndef WITH_NOIDREF +SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap *soap) +{ + int t; + if (soap->version == 1) + { for (;;) + { if (!soap_getelement(soap, NULL, &t)) + if ((soap->error && soap->error != SOAP_TAG_MISMATCH) || soap_ignore_element(soap)) + break; + } + } + if (soap->error == SOAP_NO_TAG || soap->error == SOAP_EOF) + soap->error = SOAP_OK; + return soap->error; +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap *soap, const char *tag, int *type) +{ (void)type; + if (soap_peek_element(soap)) + return NULL; +#ifndef WITH_NOIDREF + if (!*soap->id || !(*type = soap_lookup_type(soap, soap->id))) + *type = soap_lookup_type(soap, soap->href); + switch (*type) + { + case SOAP_TYPE_byte: + return soap_in_byte(soap, tag, NULL, "xsd:byte"); + case SOAP_TYPE_int: + return soap_in_int(soap, tag, NULL, "xsd:int"); + case SOAP_TYPE_std__string: + return soap_in_std__string(soap, tag, NULL, "xsd:string"); + case SOAP_TYPE_PointerTo_WS1__escrowResendSrv: + return soap_in_PointerTo_WS1__escrowResendSrv(soap, tag, NULL, "WS1:escrowResendSrv"); + case SOAP_TYPE_PointerTo_WS1__invokeSrv: + return soap_in_PointerTo_WS1__invokeSrv(soap, tag, NULL, "WS1:invokeSrv"); + case SOAP_TYPE_PointerTo_WS1__regEAI: + return soap_in_PointerTo_WS1__regEAI(soap, tag, NULL, "WS1:regEAI"); + case SOAP_TYPE_PointerTo_WS1__regSrv: + return soap_in_PointerTo_WS1__regSrv(soap, tag, NULL, "WS1:regSrv"); + case SOAP_TYPE_PointerTo_WS1__getStandardDataNameList: + return soap_in_PointerTo_WS1__getStandardDataNameList(soap, tag, NULL, "WS1:getStandardDataNameList"); + case SOAP_TYPE_PointerTo_WS1__getStandardServiceList: + return soap_in_PointerTo_WS1__getStandardServiceList(soap, tag, NULL, "WS1:getStandardServiceList"); + case SOAP_TYPE_PointerTo_WS1__fpInvoke: + return soap_in_PointerTo_WS1__fpInvoke(soap, tag, NULL, "WS1:fpInvoke"); + case SOAP_TYPE_PointerTo_WS1__getSrv: + return soap_in_PointerTo_WS1__getSrv(soap, tag, NULL, "WS1:getSrv"); + case SOAP_TYPE_PointerTo_WS1__getProd: + return soap_in_PointerTo_WS1__getProd(soap, tag, NULL, "WS1:getProd"); + case SOAP_TYPE_PointerTo_WS1__invokeMdm: + return soap_in_PointerTo_WS1__invokeMdm(soap, tag, NULL, "WS1:invokeMdm"); + case SOAP_TYPE_PointerTo_WS1__invokeUnion: + return soap_in_PointerTo_WS1__invokeUnion(soap, tag, NULL, "WS1:invokeUnion"); + case SOAP_TYPE_PointerTo_WS1__regProdAP: + return soap_in_PointerTo_WS1__regProdAP(soap, tag, NULL, "WS1:regProdAP"); + case SOAP_TYPE_PointerTo_WS1__getProdList: + return soap_in_PointerTo_WS1__getProdList(soap, tag, NULL, "WS1:getProdList"); + case SOAP_TYPE_PointerTo_WS1__getParamList: + return soap_in_PointerTo_WS1__getParamList(soap, tag, NULL, "WS1:getParamList"); + case SOAP_TYPE_PointerTo_WS1__getEtlJobList: + return soap_in_PointerTo_WS1__getEtlJobList(soap, tag, NULL, "WS1:getEtlJobList"); + case SOAP_TYPE_PointerTo_WS1__invokeEtl: + return soap_in_PointerTo_WS1__invokeEtl(soap, tag, NULL, "WS1:invokeEtl"); + case SOAP_TYPE__QName: + { char **s; + s = soap_in__QName(soap, tag, NULL, "xsd:QName"); + return s ? *s : NULL; + } + case SOAP_TYPE_string: + { char **s; + s = soap_in_string(soap, tag, NULL, "xsd:string"); + return s ? *s : NULL; + } + default: +#else + *type = 0; +#endif + { const char *t = soap->type; + if (!*t) + t = soap->tag; + if (!soap_match_tag(soap, t, "xsd:string")) + { *type = SOAP_TYPE_std__string; + return soap_in_std__string(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:byte")) + { *type = SOAP_TYPE_byte; + return soap_in_byte(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:int")) + { *type = SOAP_TYPE_int; + return soap_in_int(soap, tag, NULL, NULL); + } + if (!soap_match_tag(soap, t, "xsd:QName")) + { char **s; + *type = SOAP_TYPE__QName; + s = soap_in__QName(soap, tag, NULL, NULL); + return s ? *s : NULL; + } + if (!soap_match_tag(soap, t, "xsd:string")) + { char **s; + *type = SOAP_TYPE_string; + s = soap_in_string(soap, tag, NULL, NULL); + return s ? *s : NULL; + } + t = soap->tag; + if (!soap_match_tag(soap, t, "WS1:escrowResendSrvResponse")) + { *type = SOAP_TYPE__WS1__escrowResendSrvResponse; + return soap_in__WS1__escrowResendSrvResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:escrowResendSrv")) + { *type = SOAP_TYPE__WS1__escrowResendSrv; + return soap_in__WS1__escrowResendSrv(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeSrvResponse")) + { *type = SOAP_TYPE__WS1__invokeSrvResponse; + return soap_in__WS1__invokeSrvResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeSrv")) + { *type = SOAP_TYPE__WS1__invokeSrv; + return soap_in__WS1__invokeSrv(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:regEAIResponse")) + { *type = SOAP_TYPE__WS1__regEAIResponse; + return soap_in__WS1__regEAIResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:regEAI")) + { *type = SOAP_TYPE__WS1__regEAI; + return soap_in__WS1__regEAI(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:regSrvResponse")) + { *type = SOAP_TYPE__WS1__regSrvResponse; + return soap_in__WS1__regSrvResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:regSrv")) + { *type = SOAP_TYPE__WS1__regSrv; + return soap_in__WS1__regSrv(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getStandardDataNameListResponse")) + { *type = SOAP_TYPE__WS1__getStandardDataNameListResponse; + return soap_in__WS1__getStandardDataNameListResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getStandardDataNameList")) + { *type = SOAP_TYPE__WS1__getStandardDataNameList; + return soap_in__WS1__getStandardDataNameList(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getStandardServiceListResponse")) + { *type = SOAP_TYPE__WS1__getStandardServiceListResponse; + return soap_in__WS1__getStandardServiceListResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getStandardServiceList")) + { *type = SOAP_TYPE__WS1__getStandardServiceList; + return soap_in__WS1__getStandardServiceList(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:fpInvokeResponse")) + { *type = SOAP_TYPE__WS1__fpInvokeResponse; + return soap_in__WS1__fpInvokeResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:fpInvoke")) + { *type = SOAP_TYPE__WS1__fpInvoke; + return soap_in__WS1__fpInvoke(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getSrvResponse")) + { *type = SOAP_TYPE__WS1__getSrvResponse; + return soap_in__WS1__getSrvResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getSrv")) + { *type = SOAP_TYPE__WS1__getSrv; + return soap_in__WS1__getSrv(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getProdResponse")) + { *type = SOAP_TYPE__WS1__getProdResponse; + return soap_in__WS1__getProdResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getProd")) + { *type = SOAP_TYPE__WS1__getProd; + return soap_in__WS1__getProd(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeMdmResponse")) + { *type = SOAP_TYPE__WS1__invokeMdmResponse; + return soap_in__WS1__invokeMdmResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeMdm")) + { *type = SOAP_TYPE__WS1__invokeMdm; + return soap_in__WS1__invokeMdm(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeUnionResponse")) + { *type = SOAP_TYPE__WS1__invokeUnionResponse; + return soap_in__WS1__invokeUnionResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeUnion")) + { *type = SOAP_TYPE__WS1__invokeUnion; + return soap_in__WS1__invokeUnion(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:regProdAPResponse")) + { *type = SOAP_TYPE__WS1__regProdAPResponse; + return soap_in__WS1__regProdAPResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:regProdAP")) + { *type = SOAP_TYPE__WS1__regProdAP; + return soap_in__WS1__regProdAP(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getProdListResponse")) + { *type = SOAP_TYPE__WS1__getProdListResponse; + return soap_in__WS1__getProdListResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getProdList")) + { *type = SOAP_TYPE__WS1__getProdList; + return soap_in__WS1__getProdList(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getParamListResponse")) + { *type = SOAP_TYPE__WS1__getParamListResponse; + return soap_in__WS1__getParamListResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getParamList")) + { *type = SOAP_TYPE__WS1__getParamList; + return soap_in__WS1__getParamList(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getEtlJobListResponse")) + { *type = SOAP_TYPE__WS1__getEtlJobListResponse; + return soap_in__WS1__getEtlJobListResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:getEtlJobList")) + { *type = SOAP_TYPE__WS1__getEtlJobList; + return soap_in__WS1__getEtlJobList(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeEtlResponse")) + { *type = SOAP_TYPE__WS1__invokeEtlResponse; + return soap_in__WS1__invokeEtlResponse(soap, NULL, NULL, NULL); + } + if (!soap_match_tag(soap, t, "WS1:invokeEtl")) + { *type = SOAP_TYPE__WS1__invokeEtl; + return soap_in__WS1__invokeEtl(soap, NULL, NULL, NULL); + } +#ifndef WITH_NOIDREF + } +#endif + } + soap->error = SOAP_TAG_MISMATCH; + return NULL; +} + +#ifdef __cplusplus +} +#endif + +SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap *soap) +{ + if (!soap_peek_element(soap)) + { int t; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unexpected element '%s' in input (level = %u, %d)\n", soap->tag, soap->level, soap->body)); + if (soap->mustUnderstand && !soap->other && !soap->fignore) + return soap->error = SOAP_MUSTUNDERSTAND; + if (((soap->mode & SOAP_XML_STRICT) && !soap->fignore && soap->part != SOAP_IN_HEADER) || !soap_match_tag(soap, soap->tag, "SOAP-ENV:")) + { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "REJECTING element '%s'\n", soap->tag)); + return soap->error = SOAP_TAG_MISMATCH; + } + if (!*soap->id || !soap_getelement(soap, NULL, &t)) + { soap->peeked = 0; + if (soap->fignore) + soap->error = soap->fignore(soap, soap->tag); + else + soap->error = SOAP_OK; + DBGLOG(TEST, if (!soap->error) SOAP_MESSAGE(fdebug, "IGNORING element '%s'\n", soap->tag)); + if (!soap->error && soap->body && soap_ignore(soap)) + return soap->error; + } + } + return soap->error; +} + +#ifndef WITH_NOIDREF +SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap *soap) +{ + int i; + struct soap_plist *pp; + if (soap->version == 1 && soap->encodingStyle && !(soap->mode & (SOAP_XML_TREE | SOAP_XML_GRAPH))) + for (i = 0; i < SOAP_PTRHASH; i++) + for (pp = soap->pht[i]; pp; pp = pp->next) + if (pp->mark1 == 2 || pp->mark2 == 2) + if (soap_putelement(soap, pp->ptr, SOAP_MULTIREFTAG, pp->id, pp->type)) + return soap->error; + return SOAP_OK; +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap *soap, const void *ptr, const char *tag, int id, int type) +{ (void)tag; + switch (type) + { + case SOAP_TYPE_byte: + return soap_out_byte(soap, tag, id, (const char *)ptr, "xsd:byte"); + case SOAP_TYPE_int: + return soap_out_int(soap, tag, id, (const int *)ptr, "xsd:int"); + case SOAP_TYPE_std__string: + return soap_out_std__string(soap, tag, id, (const std::string *)ptr, "xsd:string"); + case SOAP_TYPE__WS1__escrowResendSrvResponse: + return ((_WS1__escrowResendSrvResponse *)ptr)->soap_out(soap, "WS1:escrowResendSrvResponse", id, ""); + case SOAP_TYPE__WS1__escrowResendSrv: + return ((_WS1__escrowResendSrv *)ptr)->soap_out(soap, "WS1:escrowResendSrv", id, ""); + case SOAP_TYPE__WS1__invokeSrvResponse: + return ((_WS1__invokeSrvResponse *)ptr)->soap_out(soap, "WS1:invokeSrvResponse", id, ""); + case SOAP_TYPE__WS1__invokeSrv: + return ((_WS1__invokeSrv *)ptr)->soap_out(soap, "WS1:invokeSrv", id, ""); + case SOAP_TYPE__WS1__regEAIResponse: + return ((_WS1__regEAIResponse *)ptr)->soap_out(soap, "WS1:regEAIResponse", id, ""); + case SOAP_TYPE__WS1__regEAI: + return ((_WS1__regEAI *)ptr)->soap_out(soap, "WS1:regEAI", id, ""); + case SOAP_TYPE__WS1__regSrvResponse: + return ((_WS1__regSrvResponse *)ptr)->soap_out(soap, "WS1:regSrvResponse", id, ""); + case SOAP_TYPE__WS1__regSrv: + return ((_WS1__regSrv *)ptr)->soap_out(soap, "WS1:regSrv", id, ""); + case SOAP_TYPE__WS1__getStandardDataNameListResponse: + return ((_WS1__getStandardDataNameListResponse *)ptr)->soap_out(soap, "WS1:getStandardDataNameListResponse", id, ""); + case SOAP_TYPE__WS1__getStandardDataNameList: + return ((_WS1__getStandardDataNameList *)ptr)->soap_out(soap, "WS1:getStandardDataNameList", id, ""); + case SOAP_TYPE__WS1__getStandardServiceListResponse: + return ((_WS1__getStandardServiceListResponse *)ptr)->soap_out(soap, "WS1:getStandardServiceListResponse", id, ""); + case SOAP_TYPE__WS1__getStandardServiceList: + return ((_WS1__getStandardServiceList *)ptr)->soap_out(soap, "WS1:getStandardServiceList", id, ""); + case SOAP_TYPE__WS1__fpInvokeResponse: + return ((_WS1__fpInvokeResponse *)ptr)->soap_out(soap, "WS1:fpInvokeResponse", id, ""); + case SOAP_TYPE__WS1__fpInvoke: + return ((_WS1__fpInvoke *)ptr)->soap_out(soap, "WS1:fpInvoke", id, ""); + case SOAP_TYPE__WS1__getSrvResponse: + return ((_WS1__getSrvResponse *)ptr)->soap_out(soap, "WS1:getSrvResponse", id, ""); + case SOAP_TYPE__WS1__getSrv: + return ((_WS1__getSrv *)ptr)->soap_out(soap, "WS1:getSrv", id, ""); + case SOAP_TYPE__WS1__getProdResponse: + return ((_WS1__getProdResponse *)ptr)->soap_out(soap, "WS1:getProdResponse", id, ""); + case SOAP_TYPE__WS1__getProd: + return ((_WS1__getProd *)ptr)->soap_out(soap, "WS1:getProd", id, ""); + case SOAP_TYPE__WS1__invokeMdmResponse: + return ((_WS1__invokeMdmResponse *)ptr)->soap_out(soap, "WS1:invokeMdmResponse", id, ""); + case SOAP_TYPE__WS1__invokeMdm: + return ((_WS1__invokeMdm *)ptr)->soap_out(soap, "WS1:invokeMdm", id, ""); + case SOAP_TYPE__WS1__invokeUnionResponse: + return ((_WS1__invokeUnionResponse *)ptr)->soap_out(soap, "WS1:invokeUnionResponse", id, ""); + case SOAP_TYPE__WS1__invokeUnion: + return ((_WS1__invokeUnion *)ptr)->soap_out(soap, "WS1:invokeUnion", id, ""); + case SOAP_TYPE__WS1__regProdAPResponse: + return ((_WS1__regProdAPResponse *)ptr)->soap_out(soap, "WS1:regProdAPResponse", id, ""); + case SOAP_TYPE__WS1__regProdAP: + return ((_WS1__regProdAP *)ptr)->soap_out(soap, "WS1:regProdAP", id, ""); + case SOAP_TYPE__WS1__getProdListResponse: + return ((_WS1__getProdListResponse *)ptr)->soap_out(soap, "WS1:getProdListResponse", id, ""); + case SOAP_TYPE__WS1__getProdList: + return ((_WS1__getProdList *)ptr)->soap_out(soap, "WS1:getProdList", id, ""); + case SOAP_TYPE__WS1__getParamListResponse: + return ((_WS1__getParamListResponse *)ptr)->soap_out(soap, "WS1:getParamListResponse", id, ""); + case SOAP_TYPE__WS1__getParamList: + return ((_WS1__getParamList *)ptr)->soap_out(soap, "WS1:getParamList", id, ""); + case SOAP_TYPE__WS1__getEtlJobListResponse: + return ((_WS1__getEtlJobListResponse *)ptr)->soap_out(soap, "WS1:getEtlJobListResponse", id, ""); + case SOAP_TYPE__WS1__getEtlJobList: + return ((_WS1__getEtlJobList *)ptr)->soap_out(soap, "WS1:getEtlJobList", id, ""); + case SOAP_TYPE__WS1__invokeEtlResponse: + return ((_WS1__invokeEtlResponse *)ptr)->soap_out(soap, "WS1:invokeEtlResponse", id, ""); + case SOAP_TYPE__WS1__invokeEtl: + return ((_WS1__invokeEtl *)ptr)->soap_out(soap, "WS1:invokeEtl", id, ""); + case SOAP_TYPE_PointerTo_WS1__escrowResendSrv: + return soap_out_PointerTo_WS1__escrowResendSrv(soap, tag, id, (_WS1__escrowResendSrv *const*)ptr, "WS1:escrowResendSrv"); + case SOAP_TYPE_PointerTo_WS1__invokeSrv: + return soap_out_PointerTo_WS1__invokeSrv(soap, tag, id, (_WS1__invokeSrv *const*)ptr, "WS1:invokeSrv"); + case SOAP_TYPE_PointerTo_WS1__regEAI: + return soap_out_PointerTo_WS1__regEAI(soap, tag, id, (_WS1__regEAI *const*)ptr, "WS1:regEAI"); + case SOAP_TYPE_PointerTo_WS1__regSrv: + return soap_out_PointerTo_WS1__regSrv(soap, tag, id, (_WS1__regSrv *const*)ptr, "WS1:regSrv"); + case SOAP_TYPE_PointerTo_WS1__getStandardDataNameList: + return soap_out_PointerTo_WS1__getStandardDataNameList(soap, tag, id, (_WS1__getStandardDataNameList *const*)ptr, "WS1:getStandardDataNameList"); + case SOAP_TYPE_PointerTo_WS1__getStandardServiceList: + return soap_out_PointerTo_WS1__getStandardServiceList(soap, tag, id, (_WS1__getStandardServiceList *const*)ptr, "WS1:getStandardServiceList"); + case SOAP_TYPE_PointerTo_WS1__fpInvoke: + return soap_out_PointerTo_WS1__fpInvoke(soap, tag, id, (_WS1__fpInvoke *const*)ptr, "WS1:fpInvoke"); + case SOAP_TYPE_PointerTo_WS1__getSrv: + return soap_out_PointerTo_WS1__getSrv(soap, tag, id, (_WS1__getSrv *const*)ptr, "WS1:getSrv"); + case SOAP_TYPE_PointerTo_WS1__getProd: + return soap_out_PointerTo_WS1__getProd(soap, tag, id, (_WS1__getProd *const*)ptr, "WS1:getProd"); + case SOAP_TYPE_PointerTo_WS1__invokeMdm: + return soap_out_PointerTo_WS1__invokeMdm(soap, tag, id, (_WS1__invokeMdm *const*)ptr, "WS1:invokeMdm"); + case SOAP_TYPE_PointerTo_WS1__invokeUnion: + return soap_out_PointerTo_WS1__invokeUnion(soap, tag, id, (_WS1__invokeUnion *const*)ptr, "WS1:invokeUnion"); + case SOAP_TYPE_PointerTo_WS1__regProdAP: + return soap_out_PointerTo_WS1__regProdAP(soap, tag, id, (_WS1__regProdAP *const*)ptr, "WS1:regProdAP"); + case SOAP_TYPE_PointerTo_WS1__getProdList: + return soap_out_PointerTo_WS1__getProdList(soap, tag, id, (_WS1__getProdList *const*)ptr, "WS1:getProdList"); + case SOAP_TYPE_PointerTo_WS1__getParamList: + return soap_out_PointerTo_WS1__getParamList(soap, tag, id, (_WS1__getParamList *const*)ptr, "WS1:getParamList"); + case SOAP_TYPE_PointerTo_WS1__getEtlJobList: + return soap_out_PointerTo_WS1__getEtlJobList(soap, tag, id, (_WS1__getEtlJobList *const*)ptr, "WS1:getEtlJobList"); + case SOAP_TYPE_PointerTo_WS1__invokeEtl: + return soap_out_PointerTo_WS1__invokeEtl(soap, tag, id, (_WS1__invokeEtl *const*)ptr, "WS1:invokeEtl"); + case SOAP_TYPE__QName: + return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:QName"); + case SOAP_TYPE_string: + return soap_out_string(soap, tag, id, (char*const*)(void*)&ptr, "xsd:string"); + case 0: + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_putelement '%s' failed for type %d in crossC.cpp\n", tag ? tag : "", type)); + return soap_element_empty(soap, tag); /* unknown type to serialize */ +} +#ifdef __cplusplus +} +#endif + +#ifndef WITH_NOIDREF + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap *soap, const void *ptr, int type) +{ + (void)soap; (void)ptr; (void)type; /* appease -Wall -Werror */ + switch (type) + { + case SOAP_TYPE_std__string: + soap_serialize_std__string(soap, (const std::string *)ptr); + break; + case SOAP_TYPE__WS1__escrowResendSrvResponse: + ((_WS1__escrowResendSrvResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__escrowResendSrv: + ((_WS1__escrowResendSrv *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeSrvResponse: + ((_WS1__invokeSrvResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeSrv: + ((_WS1__invokeSrv *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__regEAIResponse: + ((_WS1__regEAIResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__regEAI: + ((_WS1__regEAI *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__regSrvResponse: + ((_WS1__regSrvResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__regSrv: + ((_WS1__regSrv *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getStandardDataNameListResponse: + ((_WS1__getStandardDataNameListResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getStandardDataNameList: + ((_WS1__getStandardDataNameList *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getStandardServiceListResponse: + ((_WS1__getStandardServiceListResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getStandardServiceList: + ((_WS1__getStandardServiceList *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__fpInvokeResponse: + ((_WS1__fpInvokeResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__fpInvoke: + ((_WS1__fpInvoke *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getSrvResponse: + ((_WS1__getSrvResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getSrv: + ((_WS1__getSrv *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getProdResponse: + ((_WS1__getProdResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getProd: + ((_WS1__getProd *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeMdmResponse: + ((_WS1__invokeMdmResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeMdm: + ((_WS1__invokeMdm *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeUnionResponse: + ((_WS1__invokeUnionResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeUnion: + ((_WS1__invokeUnion *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__regProdAPResponse: + ((_WS1__regProdAPResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__regProdAP: + ((_WS1__regProdAP *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getProdListResponse: + ((_WS1__getProdListResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getProdList: + ((_WS1__getProdList *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getParamListResponse: + ((_WS1__getParamListResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getParamList: + ((_WS1__getParamList *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getEtlJobListResponse: + ((_WS1__getEtlJobListResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__getEtlJobList: + ((_WS1__getEtlJobList *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeEtlResponse: + ((_WS1__invokeEtlResponse *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE__WS1__invokeEtl: + ((_WS1__invokeEtl *)ptr)->soap_serialize(soap); + break; + case SOAP_TYPE___WS1__escrowResendSrv: + soap_serialize___WS1__escrowResendSrv(soap, (const struct __WS1__escrowResendSrv *)ptr); + break; + case SOAP_TYPE___WS1__invokeSrv: + soap_serialize___WS1__invokeSrv(soap, (const struct __WS1__invokeSrv *)ptr); + break; + case SOAP_TYPE___WS1__regEAI: + soap_serialize___WS1__regEAI(soap, (const struct __WS1__regEAI *)ptr); + break; + case SOAP_TYPE___WS1__regSrv: + soap_serialize___WS1__regSrv(soap, (const struct __WS1__regSrv *)ptr); + break; + case SOAP_TYPE___WS1__getStandardDataNameList: + soap_serialize___WS1__getStandardDataNameList(soap, (const struct __WS1__getStandardDataNameList *)ptr); + break; + case SOAP_TYPE___WS1__getStandardServiceList: + soap_serialize___WS1__getStandardServiceList(soap, (const struct __WS1__getStandardServiceList *)ptr); + break; + case SOAP_TYPE___WS1__fpInvoke: + soap_serialize___WS1__fpInvoke(soap, (const struct __WS1__fpInvoke *)ptr); + break; + case SOAP_TYPE___WS1__getSrv: + soap_serialize___WS1__getSrv(soap, (const struct __WS1__getSrv *)ptr); + break; + case SOAP_TYPE___WS1__getProd: + soap_serialize___WS1__getProd(soap, (const struct __WS1__getProd *)ptr); + break; + case SOAP_TYPE___WS1__invokeMdm: + soap_serialize___WS1__invokeMdm(soap, (const struct __WS1__invokeMdm *)ptr); + break; + case SOAP_TYPE___WS1__invokeUnion: + soap_serialize___WS1__invokeUnion(soap, (const struct __WS1__invokeUnion *)ptr); + break; + case SOAP_TYPE___WS1__regProdAP: + soap_serialize___WS1__regProdAP(soap, (const struct __WS1__regProdAP *)ptr); + break; + case SOAP_TYPE___WS1__getProdList: + soap_serialize___WS1__getProdList(soap, (const struct __WS1__getProdList *)ptr); + break; + case SOAP_TYPE___WS1__getParamList: + soap_serialize___WS1__getParamList(soap, (const struct __WS1__getParamList *)ptr); + break; + case SOAP_TYPE___WS1__getEtlJobList: + soap_serialize___WS1__getEtlJobList(soap, (const struct __WS1__getEtlJobList *)ptr); + break; + case SOAP_TYPE___WS1__invokeEtl: + soap_serialize___WS1__invokeEtl(soap, (const struct __WS1__invokeEtl *)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__escrowResendSrv: + soap_serialize_PointerTo_WS1__escrowResendSrv(soap, (_WS1__escrowResendSrv *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__invokeSrv: + soap_serialize_PointerTo_WS1__invokeSrv(soap, (_WS1__invokeSrv *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__regEAI: + soap_serialize_PointerTo_WS1__regEAI(soap, (_WS1__regEAI *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__regSrv: + soap_serialize_PointerTo_WS1__regSrv(soap, (_WS1__regSrv *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getStandardDataNameList: + soap_serialize_PointerTo_WS1__getStandardDataNameList(soap, (_WS1__getStandardDataNameList *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getStandardServiceList: + soap_serialize_PointerTo_WS1__getStandardServiceList(soap, (_WS1__getStandardServiceList *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__fpInvoke: + soap_serialize_PointerTo_WS1__fpInvoke(soap, (_WS1__fpInvoke *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getSrv: + soap_serialize_PointerTo_WS1__getSrv(soap, (_WS1__getSrv *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getProd: + soap_serialize_PointerTo_WS1__getProd(soap, (_WS1__getProd *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__invokeMdm: + soap_serialize_PointerTo_WS1__invokeMdm(soap, (_WS1__invokeMdm *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__invokeUnion: + soap_serialize_PointerTo_WS1__invokeUnion(soap, (_WS1__invokeUnion *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__regProdAP: + soap_serialize_PointerTo_WS1__regProdAP(soap, (_WS1__regProdAP *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getProdList: + soap_serialize_PointerTo_WS1__getProdList(soap, (_WS1__getProdList *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getParamList: + soap_serialize_PointerTo_WS1__getParamList(soap, (_WS1__getParamList *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__getEtlJobList: + soap_serialize_PointerTo_WS1__getEtlJobList(soap, (_WS1__getEtlJobList *const*)ptr); + break; + case SOAP_TYPE_PointerTo_WS1__invokeEtl: + soap_serialize_PointerTo_WS1__invokeEtl(soap, (_WS1__invokeEtl *const*)ptr); + break; + case SOAP_TYPE__QName: + soap_serialize_string(soap, (char*const*)(void*)&ptr); + break; + case SOAP_TYPE_string: + soap_serialize_string(soap, (char*const*)(void*)&ptr); + break; + } +} +#ifdef __cplusplus +} +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOAP_FMAC3 void * SOAP_FMAC4 soap_dupelement(struct soap *soap, const void *ptr, int type) +{(void)soap; (void)ptr; (void)type; /* appease -Wall -Werror */ + return NULL; +} +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_delelement(const void *ptr, int type) +{(void)ptr; (void)type; /* appease -Wall -Werror */ +} +#ifdef __cplusplus +} +#endif + +SOAP_FMAC3 void * SOAP_FMAC4 cross_instantiate(struct soap *soap, int t, const char *type, const char *arrayType, size_t *n) +{ (void)type; + switch (t) + { + case SOAP_TYPE_std__string: + return (void*)cross_instantiate_std__string(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeEtl: + return (void*)cross_instantiate__WS1__invokeEtl(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeEtlResponse: + return (void*)cross_instantiate__WS1__invokeEtlResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getEtlJobList: + return (void*)cross_instantiate__WS1__getEtlJobList(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getEtlJobListResponse: + return (void*)cross_instantiate__WS1__getEtlJobListResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getParamList: + return (void*)cross_instantiate__WS1__getParamList(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getParamListResponse: + return (void*)cross_instantiate__WS1__getParamListResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getProdList: + return (void*)cross_instantiate__WS1__getProdList(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getProdListResponse: + return (void*)cross_instantiate__WS1__getProdListResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__regProdAP: + return (void*)cross_instantiate__WS1__regProdAP(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__regProdAPResponse: + return (void*)cross_instantiate__WS1__regProdAPResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeUnion: + return (void*)cross_instantiate__WS1__invokeUnion(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeUnionResponse: + return (void*)cross_instantiate__WS1__invokeUnionResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeMdm: + return (void*)cross_instantiate__WS1__invokeMdm(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeMdmResponse: + return (void*)cross_instantiate__WS1__invokeMdmResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getProd: + return (void*)cross_instantiate__WS1__getProd(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getProdResponse: + return (void*)cross_instantiate__WS1__getProdResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getSrv: + return (void*)cross_instantiate__WS1__getSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getSrvResponse: + return (void*)cross_instantiate__WS1__getSrvResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__fpInvoke: + return (void*)cross_instantiate__WS1__fpInvoke(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__fpInvokeResponse: + return (void*)cross_instantiate__WS1__fpInvokeResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getStandardServiceList: + return (void*)cross_instantiate__WS1__getStandardServiceList(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getStandardServiceListResponse: + return (void*)cross_instantiate__WS1__getStandardServiceListResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getStandardDataNameList: + return (void*)cross_instantiate__WS1__getStandardDataNameList(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__getStandardDataNameListResponse: + return (void*)cross_instantiate__WS1__getStandardDataNameListResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__regSrv: + return (void*)cross_instantiate__WS1__regSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__regSrvResponse: + return (void*)cross_instantiate__WS1__regSrvResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__regEAI: + return (void*)cross_instantiate__WS1__regEAI(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__regEAIResponse: + return (void*)cross_instantiate__WS1__regEAIResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeSrv: + return (void*)cross_instantiate__WS1__invokeSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__invokeSrvResponse: + return (void*)cross_instantiate__WS1__invokeSrvResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__escrowResendSrv: + return (void*)cross_instantiate__WS1__escrowResendSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE__WS1__escrowResendSrvResponse: + return (void*)cross_instantiate__WS1__escrowResendSrvResponse(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__invokeEtl: + return (void*)cross_instantiate___WS1__invokeEtl(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getEtlJobList: + return (void*)cross_instantiate___WS1__getEtlJobList(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getParamList: + return (void*)cross_instantiate___WS1__getParamList(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getProdList: + return (void*)cross_instantiate___WS1__getProdList(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__regProdAP: + return (void*)cross_instantiate___WS1__regProdAP(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__invokeUnion: + return (void*)cross_instantiate___WS1__invokeUnion(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__invokeMdm: + return (void*)cross_instantiate___WS1__invokeMdm(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getProd: + return (void*)cross_instantiate___WS1__getProd(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getSrv: + return (void*)cross_instantiate___WS1__getSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__fpInvoke: + return (void*)cross_instantiate___WS1__fpInvoke(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getStandardServiceList: + return (void*)cross_instantiate___WS1__getStandardServiceList(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__getStandardDataNameList: + return (void*)cross_instantiate___WS1__getStandardDataNameList(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__regSrv: + return (void*)cross_instantiate___WS1__regSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__regEAI: + return (void*)cross_instantiate___WS1__regEAI(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__invokeSrv: + return (void*)cross_instantiate___WS1__invokeSrv(soap, -1, type, arrayType, n); + case SOAP_TYPE___WS1__escrowResendSrv: + return (void*)cross_instantiate___WS1__escrowResendSrv(soap, -1, type, arrayType, n); +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + return (void*)cross_instantiate_SOAP_ENV__Header(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + return (void*)cross_instantiate_SOAP_ENV__Code(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + return (void*)cross_instantiate_SOAP_ENV__Detail(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + return (void*)cross_instantiate_SOAP_ENV__Reason(soap, -1, type, arrayType, n); +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + return (void*)cross_instantiate_SOAP_ENV__Fault(soap, -1, type, arrayType, n); +#endif + } + return NULL; +} + +SOAP_FMAC3 int SOAP_FMAC4 cross_fdelete(struct soap *soap, struct soap_clist *p) +{ + (void)soap; /* appease -Wall -Werror */ + if (!p->ptr) + return SOAP_OK; + switch (p->type) + { + case SOAP_TYPE_std__string: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), std::string); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), std::string); + break; + case SOAP_TYPE__WS1__invokeEtl: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeEtl*>(p->ptr), _WS1__invokeEtl); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeEtl*>(p->ptr), _WS1__invokeEtl); + break; + case SOAP_TYPE__WS1__invokeEtlResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeEtlResponse*>(p->ptr), _WS1__invokeEtlResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeEtlResponse*>(p->ptr), _WS1__invokeEtlResponse); + break; + case SOAP_TYPE__WS1__getEtlJobList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getEtlJobList*>(p->ptr), _WS1__getEtlJobList); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getEtlJobList*>(p->ptr), _WS1__getEtlJobList); + break; + case SOAP_TYPE__WS1__getEtlJobListResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getEtlJobListResponse*>(p->ptr), _WS1__getEtlJobListResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getEtlJobListResponse*>(p->ptr), _WS1__getEtlJobListResponse); + break; + case SOAP_TYPE__WS1__getParamList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getParamList*>(p->ptr), _WS1__getParamList); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getParamList*>(p->ptr), _WS1__getParamList); + break; + case SOAP_TYPE__WS1__getParamListResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getParamListResponse*>(p->ptr), _WS1__getParamListResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getParamListResponse*>(p->ptr), _WS1__getParamListResponse); + break; + case SOAP_TYPE__WS1__getProdList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getProdList*>(p->ptr), _WS1__getProdList); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getProdList*>(p->ptr), _WS1__getProdList); + break; + case SOAP_TYPE__WS1__getProdListResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getProdListResponse*>(p->ptr), _WS1__getProdListResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getProdListResponse*>(p->ptr), _WS1__getProdListResponse); + break; + case SOAP_TYPE__WS1__regProdAP: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__regProdAP*>(p->ptr), _WS1__regProdAP); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__regProdAP*>(p->ptr), _WS1__regProdAP); + break; + case SOAP_TYPE__WS1__regProdAPResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__regProdAPResponse*>(p->ptr), _WS1__regProdAPResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__regProdAPResponse*>(p->ptr), _WS1__regProdAPResponse); + break; + case SOAP_TYPE__WS1__invokeUnion: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeUnion*>(p->ptr), _WS1__invokeUnion); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeUnion*>(p->ptr), _WS1__invokeUnion); + break; + case SOAP_TYPE__WS1__invokeUnionResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeUnionResponse*>(p->ptr), _WS1__invokeUnionResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeUnionResponse*>(p->ptr), _WS1__invokeUnionResponse); + break; + case SOAP_TYPE__WS1__invokeMdm: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeMdm*>(p->ptr), _WS1__invokeMdm); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeMdm*>(p->ptr), _WS1__invokeMdm); + break; + case SOAP_TYPE__WS1__invokeMdmResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeMdmResponse*>(p->ptr), _WS1__invokeMdmResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeMdmResponse*>(p->ptr), _WS1__invokeMdmResponse); + break; + case SOAP_TYPE__WS1__getProd: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getProd*>(p->ptr), _WS1__getProd); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getProd*>(p->ptr), _WS1__getProd); + break; + case SOAP_TYPE__WS1__getProdResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getProdResponse*>(p->ptr), _WS1__getProdResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getProdResponse*>(p->ptr), _WS1__getProdResponse); + break; + case SOAP_TYPE__WS1__getSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getSrv*>(p->ptr), _WS1__getSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getSrv*>(p->ptr), _WS1__getSrv); + break; + case SOAP_TYPE__WS1__getSrvResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getSrvResponse*>(p->ptr), _WS1__getSrvResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getSrvResponse*>(p->ptr), _WS1__getSrvResponse); + break; + case SOAP_TYPE__WS1__fpInvoke: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__fpInvoke*>(p->ptr), _WS1__fpInvoke); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__fpInvoke*>(p->ptr), _WS1__fpInvoke); + break; + case SOAP_TYPE__WS1__fpInvokeResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__fpInvokeResponse*>(p->ptr), _WS1__fpInvokeResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__fpInvokeResponse*>(p->ptr), _WS1__fpInvokeResponse); + break; + case SOAP_TYPE__WS1__getStandardServiceList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getStandardServiceList*>(p->ptr), _WS1__getStandardServiceList); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getStandardServiceList*>(p->ptr), _WS1__getStandardServiceList); + break; + case SOAP_TYPE__WS1__getStandardServiceListResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getStandardServiceListResponse*>(p->ptr), _WS1__getStandardServiceListResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getStandardServiceListResponse*>(p->ptr), _WS1__getStandardServiceListResponse); + break; + case SOAP_TYPE__WS1__getStandardDataNameList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getStandardDataNameList*>(p->ptr), _WS1__getStandardDataNameList); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getStandardDataNameList*>(p->ptr), _WS1__getStandardDataNameList); + break; + case SOAP_TYPE__WS1__getStandardDataNameListResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__getStandardDataNameListResponse*>(p->ptr), _WS1__getStandardDataNameListResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__getStandardDataNameListResponse*>(p->ptr), _WS1__getStandardDataNameListResponse); + break; + case SOAP_TYPE__WS1__regSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__regSrv*>(p->ptr), _WS1__regSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__regSrv*>(p->ptr), _WS1__regSrv); + break; + case SOAP_TYPE__WS1__regSrvResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__regSrvResponse*>(p->ptr), _WS1__regSrvResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__regSrvResponse*>(p->ptr), _WS1__regSrvResponse); + break; + case SOAP_TYPE__WS1__regEAI: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__regEAI*>(p->ptr), _WS1__regEAI); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__regEAI*>(p->ptr), _WS1__regEAI); + break; + case SOAP_TYPE__WS1__regEAIResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__regEAIResponse*>(p->ptr), _WS1__regEAIResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__regEAIResponse*>(p->ptr), _WS1__regEAIResponse); + break; + case SOAP_TYPE__WS1__invokeSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeSrv*>(p->ptr), _WS1__invokeSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeSrv*>(p->ptr), _WS1__invokeSrv); + break; + case SOAP_TYPE__WS1__invokeSrvResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__invokeSrvResponse*>(p->ptr), _WS1__invokeSrvResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__invokeSrvResponse*>(p->ptr), _WS1__invokeSrvResponse); + break; + case SOAP_TYPE__WS1__escrowResendSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__escrowResendSrv*>(p->ptr), _WS1__escrowResendSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__escrowResendSrv*>(p->ptr), _WS1__escrowResendSrv); + break; + case SOAP_TYPE__WS1__escrowResendSrvResponse: + if (p->size < 0) + SOAP_DELETE(soap, static_cast<_WS1__escrowResendSrvResponse*>(p->ptr), _WS1__escrowResendSrvResponse); + else + SOAP_DELETE_ARRAY(soap, static_cast<_WS1__escrowResendSrvResponse*>(p->ptr), _WS1__escrowResendSrvResponse); + break; + case SOAP_TYPE___WS1__invokeEtl: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__invokeEtl); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__invokeEtl); + break; + case SOAP_TYPE___WS1__getEtlJobList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getEtlJobList); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getEtlJobList); + break; + case SOAP_TYPE___WS1__getParamList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getParamList); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getParamList); + break; + case SOAP_TYPE___WS1__getProdList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getProdList); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getProdList); + break; + case SOAP_TYPE___WS1__regProdAP: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__regProdAP); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__regProdAP); + break; + case SOAP_TYPE___WS1__invokeUnion: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__invokeUnion); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__invokeUnion); + break; + case SOAP_TYPE___WS1__invokeMdm: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__invokeMdm); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__invokeMdm); + break; + case SOAP_TYPE___WS1__getProd: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getProd); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getProd); + break; + case SOAP_TYPE___WS1__getSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getSrv); + break; + case SOAP_TYPE___WS1__fpInvoke: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__fpInvoke); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__fpInvoke); + break; + case SOAP_TYPE___WS1__getStandardServiceList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getStandardServiceList); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getStandardServiceList); + break; + case SOAP_TYPE___WS1__getStandardDataNameList: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__getStandardDataNameList); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__getStandardDataNameList); + break; + case SOAP_TYPE___WS1__regSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__regSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__regSrv); + break; + case SOAP_TYPE___WS1__regEAI: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__regEAI); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__regEAI); + break; + case SOAP_TYPE___WS1__invokeSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__invokeSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__invokeSrv); + break; + case SOAP_TYPE___WS1__escrowResendSrv: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct __WS1__escrowResendSrv); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct __WS1__escrowResendSrv); + break; +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Header); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Header); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Code); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Code); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Detail); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Detail); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Reason); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Reason); + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + if (p->size < 0) + SOAP_DELETE(soap, static_cast(p->ptr), struct SOAP_ENV__Fault); + else + SOAP_DELETE_ARRAY(soap, static_cast(p->ptr), struct SOAP_ENV__Fault); + break; +#endif + default: + return SOAP_ERR; + } + return SOAP_OK; +} + +#ifdef WIN32 +#pragma warning(push) +// do not warn on switch w/o cases +#pragma warning(disable:4065) +#endif +SOAP_FMAC3 int SOAP_FMAC4 cross_fbase(int t, int b) +{ + (void)t; (void)b; /* appease -Wall -Werror */ + return 0; +} +#ifdef WIN32 +#pragma warning(pop) +#endif + +#ifndef WITH_NOIDREF +#ifdef WIN32 +#pragma warning(push) +// do not warn on switch w/o cases +#pragma warning(disable:4065) +#endif +SOAP_FMAC3 void SOAP_FMAC4 cross_finsert(struct soap *soap, int t, int tt, void *p, size_t index, const void *q, void **x) +{ + (void)soap; (void)t; (void)p; (void)index; (void)q; (void)x; /* appease -Wall -Werror */ + switch (tt) + { + case SOAP_TYPE_std__string: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy std::string type=%d location=%p object=%p\n", t, p, q)); + *(std::string*)p = *(std::string*)q; + break; + case SOAP_TYPE__WS1__invokeEtl: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeEtl type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeEtl*)p = *(_WS1__invokeEtl*)q; + break; + case SOAP_TYPE__WS1__invokeEtlResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeEtlResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeEtlResponse*)p = *(_WS1__invokeEtlResponse*)q; + break; + case SOAP_TYPE__WS1__getEtlJobList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getEtlJobList type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getEtlJobList*)p = *(_WS1__getEtlJobList*)q; + break; + case SOAP_TYPE__WS1__getEtlJobListResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getEtlJobListResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getEtlJobListResponse*)p = *(_WS1__getEtlJobListResponse*)q; + break; + case SOAP_TYPE__WS1__getParamList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getParamList type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getParamList*)p = *(_WS1__getParamList*)q; + break; + case SOAP_TYPE__WS1__getParamListResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getParamListResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getParamListResponse*)p = *(_WS1__getParamListResponse*)q; + break; + case SOAP_TYPE__WS1__getProdList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getProdList type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getProdList*)p = *(_WS1__getProdList*)q; + break; + case SOAP_TYPE__WS1__getProdListResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getProdListResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getProdListResponse*)p = *(_WS1__getProdListResponse*)q; + break; + case SOAP_TYPE__WS1__regProdAP: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__regProdAP type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__regProdAP*)p = *(_WS1__regProdAP*)q; + break; + case SOAP_TYPE__WS1__regProdAPResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__regProdAPResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__regProdAPResponse*)p = *(_WS1__regProdAPResponse*)q; + break; + case SOAP_TYPE__WS1__invokeUnion: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeUnion type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeUnion*)p = *(_WS1__invokeUnion*)q; + break; + case SOAP_TYPE__WS1__invokeUnionResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeUnionResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeUnionResponse*)p = *(_WS1__invokeUnionResponse*)q; + break; + case SOAP_TYPE__WS1__invokeMdm: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeMdm type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeMdm*)p = *(_WS1__invokeMdm*)q; + break; + case SOAP_TYPE__WS1__invokeMdmResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeMdmResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeMdmResponse*)p = *(_WS1__invokeMdmResponse*)q; + break; + case SOAP_TYPE__WS1__getProd: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getProd type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getProd*)p = *(_WS1__getProd*)q; + break; + case SOAP_TYPE__WS1__getProdResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getProdResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getProdResponse*)p = *(_WS1__getProdResponse*)q; + break; + case SOAP_TYPE__WS1__getSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getSrv type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getSrv*)p = *(_WS1__getSrv*)q; + break; + case SOAP_TYPE__WS1__getSrvResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getSrvResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getSrvResponse*)p = *(_WS1__getSrvResponse*)q; + break; + case SOAP_TYPE__WS1__fpInvoke: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__fpInvoke type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__fpInvoke*)p = *(_WS1__fpInvoke*)q; + break; + case SOAP_TYPE__WS1__fpInvokeResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__fpInvokeResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__fpInvokeResponse*)p = *(_WS1__fpInvokeResponse*)q; + break; + case SOAP_TYPE__WS1__getStandardServiceList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getStandardServiceList type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getStandardServiceList*)p = *(_WS1__getStandardServiceList*)q; + break; + case SOAP_TYPE__WS1__getStandardServiceListResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getStandardServiceListResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getStandardServiceListResponse*)p = *(_WS1__getStandardServiceListResponse*)q; + break; + case SOAP_TYPE__WS1__getStandardDataNameList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getStandardDataNameList type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getStandardDataNameList*)p = *(_WS1__getStandardDataNameList*)q; + break; + case SOAP_TYPE__WS1__getStandardDataNameListResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__getStandardDataNameListResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__getStandardDataNameListResponse*)p = *(_WS1__getStandardDataNameListResponse*)q; + break; + case SOAP_TYPE__WS1__regSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__regSrv type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__regSrv*)p = *(_WS1__regSrv*)q; + break; + case SOAP_TYPE__WS1__regSrvResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__regSrvResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__regSrvResponse*)p = *(_WS1__regSrvResponse*)q; + break; + case SOAP_TYPE__WS1__regEAI: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__regEAI type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__regEAI*)p = *(_WS1__regEAI*)q; + break; + case SOAP_TYPE__WS1__regEAIResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__regEAIResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__regEAIResponse*)p = *(_WS1__regEAIResponse*)q; + break; + case SOAP_TYPE__WS1__invokeSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeSrv type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeSrv*)p = *(_WS1__invokeSrv*)q; + break; + case SOAP_TYPE__WS1__invokeSrvResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__invokeSrvResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__invokeSrvResponse*)p = *(_WS1__invokeSrvResponse*)q; + break; + case SOAP_TYPE__WS1__escrowResendSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__escrowResendSrv type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__escrowResendSrv*)p = *(_WS1__escrowResendSrv*)q; + break; + case SOAP_TYPE__WS1__escrowResendSrvResponse: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy _WS1__escrowResendSrvResponse type=%d location=%p object=%p\n", t, p, q)); + *(_WS1__escrowResendSrvResponse*)p = *(_WS1__escrowResendSrvResponse*)q; + break; + case SOAP_TYPE___WS1__invokeEtl: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__invokeEtl type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__invokeEtl*)p = *(struct __WS1__invokeEtl*)q; + break; + case SOAP_TYPE___WS1__getEtlJobList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getEtlJobList type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getEtlJobList*)p = *(struct __WS1__getEtlJobList*)q; + break; + case SOAP_TYPE___WS1__getParamList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getParamList type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getParamList*)p = *(struct __WS1__getParamList*)q; + break; + case SOAP_TYPE___WS1__getProdList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getProdList type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getProdList*)p = *(struct __WS1__getProdList*)q; + break; + case SOAP_TYPE___WS1__regProdAP: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__regProdAP type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__regProdAP*)p = *(struct __WS1__regProdAP*)q; + break; + case SOAP_TYPE___WS1__invokeUnion: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__invokeUnion type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__invokeUnion*)p = *(struct __WS1__invokeUnion*)q; + break; + case SOAP_TYPE___WS1__invokeMdm: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__invokeMdm type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__invokeMdm*)p = *(struct __WS1__invokeMdm*)q; + break; + case SOAP_TYPE___WS1__getProd: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getProd type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getProd*)p = *(struct __WS1__getProd*)q; + break; + case SOAP_TYPE___WS1__getSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getSrv type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getSrv*)p = *(struct __WS1__getSrv*)q; + break; + case SOAP_TYPE___WS1__fpInvoke: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__fpInvoke type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__fpInvoke*)p = *(struct __WS1__fpInvoke*)q; + break; + case SOAP_TYPE___WS1__getStandardServiceList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getStandardServiceList type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getStandardServiceList*)p = *(struct __WS1__getStandardServiceList*)q; + break; + case SOAP_TYPE___WS1__getStandardDataNameList: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__getStandardDataNameList type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__getStandardDataNameList*)p = *(struct __WS1__getStandardDataNameList*)q; + break; + case SOAP_TYPE___WS1__regSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__regSrv type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__regSrv*)p = *(struct __WS1__regSrv*)q; + break; + case SOAP_TYPE___WS1__regEAI: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__regEAI type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__regEAI*)p = *(struct __WS1__regEAI*)q; + break; + case SOAP_TYPE___WS1__invokeSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__invokeSrv type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__invokeSrv*)p = *(struct __WS1__invokeSrv*)q; + break; + case SOAP_TYPE___WS1__escrowResendSrv: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct __WS1__escrowResendSrv type=%d location=%p object=%p\n", t, p, q)); + *(struct __WS1__escrowResendSrv*)p = *(struct __WS1__escrowResendSrv*)q; + break; +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Header: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Header type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Header*)p = *(struct SOAP_ENV__Header*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Code: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Code type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Code*)p = *(struct SOAP_ENV__Code*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Detail: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Detail type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Detail*)p = *(struct SOAP_ENV__Detail*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Reason: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Reason type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Reason*)p = *(struct SOAP_ENV__Reason*)q; + break; +#endif +#ifndef WITH_NOGLOBAL + case SOAP_TYPE_SOAP_ENV__Fault: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy struct SOAP_ENV__Fault type=%d location=%p object=%p\n", t, p, q)); + *(struct SOAP_ENV__Fault*)p = *(struct SOAP_ENV__Fault*)q; + break; +#endif + default: + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not insert type=%d in %d\n", t, tt)); + } +} +#ifdef WIN32 +#pragma warning(pop) +#endif +#endif + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap *soap, const char *tag, int id, const char *a, const char *type) +{ + return soap_outbyte(soap, tag, id, a, type, SOAP_TYPE_byte); +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap *soap, const char *tag, char *a, const char *type) +{ + a = soap_inbyte(soap, tag, a, type, SOAP_TYPE_byte); + return a; +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_new_byte(struct soap *soap, int n) +{ + char *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(char))); + for (char *p = a; p && n--; ++p) + soap_default_byte(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap *soap, const char *a, const char *tag, const char *type) +{ + if (soap_out_byte(soap, tag ? tag : "byte", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap *soap, char *p, const char *tag, const char *type) +{ + if ((p = soap_in_byte(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap *soap, const char *tag, int id, const int *a, const char *type) +{ + return soap_outint(soap, tag, id, a, type, SOAP_TYPE_int); +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap *soap, const char *tag, int *a, const char *type) +{ + a = soap_inint(soap, tag, a, type, SOAP_TYPE_int); + return a; +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_new_int(struct soap *soap, int n) +{ + int *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(int))); + for (int *p = a; p && n--; ++p) + soap_default_int(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap *soap, const int *a, const char *tag, const char *type) +{ + if (soap_out_int(soap, tag ? tag : "int", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap *soap, int *p, const char *tag, const char *type) +{ + if ((p = soap_in_int(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_std__string(struct soap *soap, const std::string *a) +{ (void)soap; (void)a; /* appease -Wall -Werror */ +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_std__string(struct soap *soap, const char *tag, int id, const std::string *s, const char *type) +{ + if ((soap->mode & SOAP_C_NILSTRING) && s->empty()) + return soap_element_null(soap, tag, id, type); + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, s, SOAP_TYPE_std__string), type) || soap_string_out(soap, s->c_str(), 0) || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 std::string * SOAP_FMAC4 soap_in_std__string(struct soap *soap, const char *tag, std::string *s, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!s) + s = soap_new_std__string(soap, -1); + if (soap->null) + if (s) + s->erase(); + if (soap->body && *soap->href != '#') + { char *t; + s = (std::string*)soap_id_enter(soap, soap->id, s, SOAP_TYPE_std__string, sizeof(std::string), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (s) + { if (!(t = soap_string_in(soap, 1, 0, -1, NULL))) + return NULL; + s->assign(t); + } + } + else + s = (std::string*)soap_id_forward(soap, soap->href, soap_id_enter(soap, soap->id, s, SOAP_TYPE_std__string, sizeof(std::string), soap->type, soap->arrayType, cross_instantiate, cross_fbase), 0, SOAP_TYPE_std__string, SOAP_TYPE_std__string, sizeof(std::string), 0, cross_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return s; +} + +SOAP_FMAC1 std::string * SOAP_FMAC2 cross_instantiate_std__string(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate_std__string(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + std::string *p; + size_t k = sizeof(std::string); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_std__string, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, std::string); + } + else + { p = SOAP_NEW_ARRAY(soap, std::string, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated std::string location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_std__string(struct soap *soap, const std::string *a, const char *tag, const char *type) +{ + if (soap_out_std__string(soap, tag ? tag : "string", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 std::string * SOAP_FMAC4 soap_get_std__string(struct soap *soap, std::string *p, const char *tag, const char *type) +{ + if ((p = soap_in_std__string(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__escrowResendSrvResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__escrowResendSrvResponse::escrowResendSrvReturn); +} + +void _WS1__escrowResendSrvResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__escrowResendSrvResponse::escrowResendSrvReturn); +#endif +} + +int _WS1__escrowResendSrvResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__escrowResendSrvResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__escrowResendSrvResponse(struct soap *soap, const char *tag, int id, const _WS1__escrowResendSrvResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__escrowResendSrvResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:escrowResendSrvReturn"); + if (soap_out_std__string(soap, "WS1:escrowResendSrvReturn", -1, &a->_WS1__escrowResendSrvResponse::escrowResendSrvReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__escrowResendSrvResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__escrowResendSrvResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__escrowResendSrvResponse * SOAP_FMAC4 soap_in__WS1__escrowResendSrvResponse(struct soap *soap, const char *tag, _WS1__escrowResendSrvResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__escrowResendSrvResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__escrowResendSrvResponse, sizeof(_WS1__escrowResendSrvResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__escrowResendSrvResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__escrowResendSrvResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_escrowResendSrvReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_escrowResendSrvReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:escrowResendSrvReturn", &a->_WS1__escrowResendSrvResponse::escrowResendSrvReturn, "xsd:string")) + { soap_flag_escrowResendSrvReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:escrowResendSrvReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_escrowResendSrvReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__escrowResendSrvResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__escrowResendSrvResponse, SOAP_TYPE__WS1__escrowResendSrvResponse, sizeof(_WS1__escrowResendSrvResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__escrowResendSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__escrowResendSrvResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__escrowResendSrvResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__escrowResendSrvResponse *p; + size_t k = sizeof(_WS1__escrowResendSrvResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__escrowResendSrvResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__escrowResendSrvResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__escrowResendSrvResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__escrowResendSrvResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__escrowResendSrvResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__escrowResendSrvResponse(soap, tag ? tag : "WS1:escrowResendSrvResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__escrowResendSrvResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__escrowResendSrvResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__escrowResendSrvResponse * SOAP_FMAC4 soap_get__WS1__escrowResendSrvResponse(struct soap *soap, _WS1__escrowResendSrvResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__escrowResendSrvResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__escrowResendSrv::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__escrowResendSrv::in0); + soap_default_std__string(soap, &this->_WS1__escrowResendSrv::in1); +} + +void _WS1__escrowResendSrv::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__escrowResendSrv::in0); + soap_serialize_std__string(soap, &this->_WS1__escrowResendSrv::in1); +#endif +} + +int _WS1__escrowResendSrv::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__escrowResendSrv(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__escrowResendSrv(struct soap *soap, const char *tag, int id, const _WS1__escrowResendSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__escrowResendSrv), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__escrowResendSrv::in0, "")) + return soap->error; + if (soap_out_std__string(soap, "WS1:in1", -1, &a->_WS1__escrowResendSrv::in1, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__escrowResendSrv::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__escrowResendSrv(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__escrowResendSrv * SOAP_FMAC4 soap_in__WS1__escrowResendSrv(struct soap *soap, const char *tag, _WS1__escrowResendSrv *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__escrowResendSrv*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__escrowResendSrv, sizeof(_WS1__escrowResendSrv), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__escrowResendSrv) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__escrowResendSrv *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + size_t soap_flag_in11 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__escrowResendSrv::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap_flag_in11 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in1", &a->_WS1__escrowResendSrv::in1, "xsd:string")) + { soap_flag_in11--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0 || soap_flag_in11 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__escrowResendSrv *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__escrowResendSrv, SOAP_TYPE__WS1__escrowResendSrv, sizeof(_WS1__escrowResendSrv), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__escrowResendSrv * SOAP_FMAC2 cross_instantiate__WS1__escrowResendSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__escrowResendSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__escrowResendSrv *p; + size_t k = sizeof(_WS1__escrowResendSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__escrowResendSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__escrowResendSrv); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__escrowResendSrv, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__escrowResendSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__escrowResendSrv::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__escrowResendSrv(soap, tag ? tag : "WS1:escrowResendSrv", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__escrowResendSrv::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__escrowResendSrv(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__escrowResendSrv * SOAP_FMAC4 soap_get__WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__escrowResendSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeSrvResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeSrvResponse::invokeSrvReturn); +} + +void _WS1__invokeSrvResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeSrvResponse::invokeSrvReturn); +#endif +} + +int _WS1__invokeSrvResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeSrvResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeSrvResponse(struct soap *soap, const char *tag, int id, const _WS1__invokeSrvResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeSrvResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:invokeSrvReturn"); + if (soap_out_std__string(soap, "WS1:invokeSrvReturn", -1, &a->_WS1__invokeSrvResponse::invokeSrvReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeSrvResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeSrvResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeSrvResponse * SOAP_FMAC4 soap_in__WS1__invokeSrvResponse(struct soap *soap, const char *tag, _WS1__invokeSrvResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeSrvResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeSrvResponse, sizeof(_WS1__invokeSrvResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeSrvResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeSrvResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_invokeSrvReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_invokeSrvReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:invokeSrvReturn", &a->_WS1__invokeSrvResponse::invokeSrvReturn, "xsd:string")) + { soap_flag_invokeSrvReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:invokeSrvReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_invokeSrvReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeSrvResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeSrvResponse, SOAP_TYPE__WS1__invokeSrvResponse, sizeof(_WS1__invokeSrvResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeSrvResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeSrvResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeSrvResponse *p; + size_t k = sizeof(_WS1__invokeSrvResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeSrvResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeSrvResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeSrvResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeSrvResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeSrvResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeSrvResponse(soap, tag ? tag : "WS1:invokeSrvResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeSrvResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeSrvResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeSrvResponse * SOAP_FMAC4 soap_get__WS1__invokeSrvResponse(struct soap *soap, _WS1__invokeSrvResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeSrvResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeSrv::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeSrv::in0); +} + +void _WS1__invokeSrv::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeSrv::in0); +#endif +} + +int _WS1__invokeSrv::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeSrv(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeSrv(struct soap *soap, const char *tag, int id, const _WS1__invokeSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeSrv), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__invokeSrv::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeSrv::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeSrv(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeSrv * SOAP_FMAC4 soap_in__WS1__invokeSrv(struct soap *soap, const char *tag, _WS1__invokeSrv *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeSrv*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeSrv, sizeof(_WS1__invokeSrv), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeSrv) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeSrv *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__invokeSrv::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeSrv *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeSrv, SOAP_TYPE__WS1__invokeSrv, sizeof(_WS1__invokeSrv), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeSrv * SOAP_FMAC2 cross_instantiate__WS1__invokeSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeSrv *p; + size_t k = sizeof(_WS1__invokeSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeSrv); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeSrv, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeSrv::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeSrv(soap, tag ? tag : "WS1:invokeSrv", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeSrv::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeSrv(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeSrv * SOAP_FMAC4 soap_get__WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__regEAIResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__regEAIResponse::regEAIReturn); +} + +void _WS1__regEAIResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__regEAIResponse::regEAIReturn); +#endif +} + +int _WS1__regEAIResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__regEAIResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regEAIResponse(struct soap *soap, const char *tag, int id, const _WS1__regEAIResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__regEAIResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:regEAIReturn"); + if (soap_out_std__string(soap, "WS1:regEAIReturn", -1, &a->_WS1__regEAIResponse::regEAIReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__regEAIResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__regEAIResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__regEAIResponse * SOAP_FMAC4 soap_in__WS1__regEAIResponse(struct soap *soap, const char *tag, _WS1__regEAIResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__regEAIResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__regEAIResponse, sizeof(_WS1__regEAIResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__regEAIResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__regEAIResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_regEAIReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_regEAIReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:regEAIReturn", &a->_WS1__regEAIResponse::regEAIReturn, "xsd:string")) + { soap_flag_regEAIReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:regEAIReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_regEAIReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__regEAIResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__regEAIResponse, SOAP_TYPE__WS1__regEAIResponse, sizeof(_WS1__regEAIResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__regEAIResponse * SOAP_FMAC2 cross_instantiate__WS1__regEAIResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__regEAIResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__regEAIResponse *p; + size_t k = sizeof(_WS1__regEAIResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__regEAIResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__regEAIResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__regEAIResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__regEAIResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__regEAIResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__regEAIResponse(soap, tag ? tag : "WS1:regEAIResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__regEAIResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__regEAIResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__regEAIResponse * SOAP_FMAC4 soap_get__WS1__regEAIResponse(struct soap *soap, _WS1__regEAIResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__regEAIResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__regEAI::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__regEAI::in0); +} + +void _WS1__regEAI::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__regEAI::in0); +#endif +} + +int _WS1__regEAI::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__regEAI(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regEAI(struct soap *soap, const char *tag, int id, const _WS1__regEAI *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__regEAI), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__regEAI::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__regEAI::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__regEAI(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__regEAI * SOAP_FMAC4 soap_in__WS1__regEAI(struct soap *soap, const char *tag, _WS1__regEAI *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__regEAI*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__regEAI, sizeof(_WS1__regEAI), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__regEAI) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__regEAI *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__regEAI::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__regEAI *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__regEAI, SOAP_TYPE__WS1__regEAI, sizeof(_WS1__regEAI), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__regEAI * SOAP_FMAC2 cross_instantiate__WS1__regEAI(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__regEAI(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__regEAI *p; + size_t k = sizeof(_WS1__regEAI); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__regEAI, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__regEAI); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__regEAI, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__regEAI location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__regEAI::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__regEAI(soap, tag ? tag : "WS1:regEAI", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__regEAI::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__regEAI(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__regEAI * SOAP_FMAC4 soap_get__WS1__regEAI(struct soap *soap, _WS1__regEAI *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__regEAI(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__regSrvResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__regSrvResponse::regSrvReturn); +} + +void _WS1__regSrvResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__regSrvResponse::regSrvReturn); +#endif +} + +int _WS1__regSrvResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__regSrvResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regSrvResponse(struct soap *soap, const char *tag, int id, const _WS1__regSrvResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__regSrvResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:regSrvReturn"); + if (soap_out_std__string(soap, "WS1:regSrvReturn", -1, &a->_WS1__regSrvResponse::regSrvReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__regSrvResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__regSrvResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__regSrvResponse * SOAP_FMAC4 soap_in__WS1__regSrvResponse(struct soap *soap, const char *tag, _WS1__regSrvResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__regSrvResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__regSrvResponse, sizeof(_WS1__regSrvResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__regSrvResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__regSrvResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_regSrvReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_regSrvReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:regSrvReturn", &a->_WS1__regSrvResponse::regSrvReturn, "xsd:string")) + { soap_flag_regSrvReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:regSrvReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_regSrvReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__regSrvResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__regSrvResponse, SOAP_TYPE__WS1__regSrvResponse, sizeof(_WS1__regSrvResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__regSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__regSrvResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__regSrvResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__regSrvResponse *p; + size_t k = sizeof(_WS1__regSrvResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__regSrvResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__regSrvResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__regSrvResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__regSrvResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__regSrvResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__regSrvResponse(soap, tag ? tag : "WS1:regSrvResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__regSrvResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__regSrvResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__regSrvResponse * SOAP_FMAC4 soap_get__WS1__regSrvResponse(struct soap *soap, _WS1__regSrvResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__regSrvResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__regSrv::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__regSrv::in0); +} + +void _WS1__regSrv::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__regSrv::in0); +#endif +} + +int _WS1__regSrv::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__regSrv(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regSrv(struct soap *soap, const char *tag, int id, const _WS1__regSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__regSrv), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__regSrv::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__regSrv::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__regSrv(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__regSrv * SOAP_FMAC4 soap_in__WS1__regSrv(struct soap *soap, const char *tag, _WS1__regSrv *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__regSrv*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__regSrv, sizeof(_WS1__regSrv), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__regSrv) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__regSrv *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__regSrv::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__regSrv *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__regSrv, SOAP_TYPE__WS1__regSrv, sizeof(_WS1__regSrv), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__regSrv * SOAP_FMAC2 cross_instantiate__WS1__regSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__regSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__regSrv *p; + size_t k = sizeof(_WS1__regSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__regSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__regSrv); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__regSrv, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__regSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__regSrv::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__regSrv(soap, tag ? tag : "WS1:regSrv", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__regSrv::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__regSrv(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__regSrv * SOAP_FMAC4 soap_get__WS1__regSrv(struct soap *soap, _WS1__regSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__regSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getStandardDataNameListResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getStandardDataNameListResponse::getStandardDataNameListReturn); +} + +void _WS1__getStandardDataNameListResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getStandardDataNameListResponse::getStandardDataNameListReturn); +#endif +} + +int _WS1__getStandardDataNameListResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getStandardDataNameListResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardDataNameListResponse(struct soap *soap, const char *tag, int id, const _WS1__getStandardDataNameListResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getStandardDataNameListResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getStandardDataNameListReturn"); + if (soap_out_std__string(soap, "WS1:getStandardDataNameListReturn", -1, &a->_WS1__getStandardDataNameListResponse::getStandardDataNameListReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getStandardDataNameListResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getStandardDataNameListResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getStandardDataNameListResponse * SOAP_FMAC4 soap_in__WS1__getStandardDataNameListResponse(struct soap *soap, const char *tag, _WS1__getStandardDataNameListResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getStandardDataNameListResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getStandardDataNameListResponse, sizeof(_WS1__getStandardDataNameListResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getStandardDataNameListResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getStandardDataNameListResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getStandardDataNameListReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getStandardDataNameListReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getStandardDataNameListReturn", &a->_WS1__getStandardDataNameListResponse::getStandardDataNameListReturn, "xsd:string")) + { soap_flag_getStandardDataNameListReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getStandardDataNameListReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getStandardDataNameListReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getStandardDataNameListResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getStandardDataNameListResponse, SOAP_TYPE__WS1__getStandardDataNameListResponse, sizeof(_WS1__getStandardDataNameListResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getStandardDataNameListResponse * SOAP_FMAC2 cross_instantiate__WS1__getStandardDataNameListResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getStandardDataNameListResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getStandardDataNameListResponse *p; + size_t k = sizeof(_WS1__getStandardDataNameListResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getStandardDataNameListResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getStandardDataNameListResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getStandardDataNameListResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getStandardDataNameListResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getStandardDataNameListResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getStandardDataNameListResponse(soap, tag ? tag : "WS1:getStandardDataNameListResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getStandardDataNameListResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getStandardDataNameListResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getStandardDataNameListResponse * SOAP_FMAC4 soap_get__WS1__getStandardDataNameListResponse(struct soap *soap, _WS1__getStandardDataNameListResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getStandardDataNameListResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getStandardDataNameList::soap_default(struct soap *soap) +{ + this->soap = soap; +} + +void _WS1__getStandardDataNameList::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +int _WS1__getStandardDataNameList::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getStandardDataNameList(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardDataNameList(struct soap *soap, const char *tag, int id, const _WS1__getStandardDataNameList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getStandardDataNameList), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getStandardDataNameList::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getStandardDataNameList(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getStandardDataNameList * SOAP_FMAC4 soap_in__WS1__getStandardDataNameList(struct soap *soap, const char *tag, _WS1__getStandardDataNameList *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getStandardDataNameList*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getStandardDataNameList, sizeof(_WS1__getStandardDataNameList), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getStandardDataNameList) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getStandardDataNameList *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_WS1__getStandardDataNameList *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getStandardDataNameList, SOAP_TYPE__WS1__getStandardDataNameList, sizeof(_WS1__getStandardDataNameList), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getStandardDataNameList * SOAP_FMAC2 cross_instantiate__WS1__getStandardDataNameList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getStandardDataNameList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getStandardDataNameList *p; + size_t k = sizeof(_WS1__getStandardDataNameList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getStandardDataNameList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getStandardDataNameList); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getStandardDataNameList, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getStandardDataNameList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getStandardDataNameList::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getStandardDataNameList(soap, tag ? tag : "WS1:getStandardDataNameList", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getStandardDataNameList::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getStandardDataNameList(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getStandardDataNameList * SOAP_FMAC4 soap_get__WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getStandardDataNameList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getStandardServiceListResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getStandardServiceListResponse::getStandardServiceListReturn); +} + +void _WS1__getStandardServiceListResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getStandardServiceListResponse::getStandardServiceListReturn); +#endif +} + +int _WS1__getStandardServiceListResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getStandardServiceListResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardServiceListResponse(struct soap *soap, const char *tag, int id, const _WS1__getStandardServiceListResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getStandardServiceListResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getStandardServiceListReturn"); + if (soap_out_std__string(soap, "WS1:getStandardServiceListReturn", -1, &a->_WS1__getStandardServiceListResponse::getStandardServiceListReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getStandardServiceListResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getStandardServiceListResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getStandardServiceListResponse * SOAP_FMAC4 soap_in__WS1__getStandardServiceListResponse(struct soap *soap, const char *tag, _WS1__getStandardServiceListResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getStandardServiceListResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getStandardServiceListResponse, sizeof(_WS1__getStandardServiceListResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getStandardServiceListResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getStandardServiceListResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getStandardServiceListReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getStandardServiceListReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getStandardServiceListReturn", &a->_WS1__getStandardServiceListResponse::getStandardServiceListReturn, "xsd:string")) + { soap_flag_getStandardServiceListReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getStandardServiceListReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getStandardServiceListReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getStandardServiceListResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getStandardServiceListResponse, SOAP_TYPE__WS1__getStandardServiceListResponse, sizeof(_WS1__getStandardServiceListResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getStandardServiceListResponse * SOAP_FMAC2 cross_instantiate__WS1__getStandardServiceListResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getStandardServiceListResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getStandardServiceListResponse *p; + size_t k = sizeof(_WS1__getStandardServiceListResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getStandardServiceListResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getStandardServiceListResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getStandardServiceListResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getStandardServiceListResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getStandardServiceListResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getStandardServiceListResponse(soap, tag ? tag : "WS1:getStandardServiceListResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getStandardServiceListResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getStandardServiceListResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getStandardServiceListResponse * SOAP_FMAC4 soap_get__WS1__getStandardServiceListResponse(struct soap *soap, _WS1__getStandardServiceListResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getStandardServiceListResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getStandardServiceList::soap_default(struct soap *soap) +{ + this->soap = soap; +} + +void _WS1__getStandardServiceList::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +int _WS1__getStandardServiceList::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getStandardServiceList(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardServiceList(struct soap *soap, const char *tag, int id, const _WS1__getStandardServiceList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getStandardServiceList), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getStandardServiceList::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getStandardServiceList(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getStandardServiceList * SOAP_FMAC4 soap_in__WS1__getStandardServiceList(struct soap *soap, const char *tag, _WS1__getStandardServiceList *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getStandardServiceList*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getStandardServiceList, sizeof(_WS1__getStandardServiceList), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getStandardServiceList) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getStandardServiceList *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_WS1__getStandardServiceList *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getStandardServiceList, SOAP_TYPE__WS1__getStandardServiceList, sizeof(_WS1__getStandardServiceList), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getStandardServiceList * SOAP_FMAC2 cross_instantiate__WS1__getStandardServiceList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getStandardServiceList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getStandardServiceList *p; + size_t k = sizeof(_WS1__getStandardServiceList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getStandardServiceList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getStandardServiceList); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getStandardServiceList, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getStandardServiceList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getStandardServiceList::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getStandardServiceList(soap, tag ? tag : "WS1:getStandardServiceList", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getStandardServiceList::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getStandardServiceList(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getStandardServiceList * SOAP_FMAC4 soap_get__WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getStandardServiceList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__fpInvokeResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__fpInvokeResponse::fpInvokeReturn); +} + +void _WS1__fpInvokeResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__fpInvokeResponse::fpInvokeReturn); +#endif +} + +int _WS1__fpInvokeResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__fpInvokeResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__fpInvokeResponse(struct soap *soap, const char *tag, int id, const _WS1__fpInvokeResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__fpInvokeResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:fpInvokeReturn"); + if (soap_out_std__string(soap, "WS1:fpInvokeReturn", -1, &a->_WS1__fpInvokeResponse::fpInvokeReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__fpInvokeResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__fpInvokeResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__fpInvokeResponse * SOAP_FMAC4 soap_in__WS1__fpInvokeResponse(struct soap *soap, const char *tag, _WS1__fpInvokeResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__fpInvokeResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__fpInvokeResponse, sizeof(_WS1__fpInvokeResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__fpInvokeResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__fpInvokeResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_fpInvokeReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_fpInvokeReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:fpInvokeReturn", &a->_WS1__fpInvokeResponse::fpInvokeReturn, "xsd:string")) + { soap_flag_fpInvokeReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:fpInvokeReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_fpInvokeReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__fpInvokeResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__fpInvokeResponse, SOAP_TYPE__WS1__fpInvokeResponse, sizeof(_WS1__fpInvokeResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__fpInvokeResponse * SOAP_FMAC2 cross_instantiate__WS1__fpInvokeResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__fpInvokeResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__fpInvokeResponse *p; + size_t k = sizeof(_WS1__fpInvokeResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__fpInvokeResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__fpInvokeResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__fpInvokeResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__fpInvokeResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__fpInvokeResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__fpInvokeResponse(soap, tag ? tag : "WS1:fpInvokeResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__fpInvokeResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__fpInvokeResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__fpInvokeResponse * SOAP_FMAC4 soap_get__WS1__fpInvokeResponse(struct soap *soap, _WS1__fpInvokeResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__fpInvokeResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__fpInvoke::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__fpInvoke::in0); +} + +void _WS1__fpInvoke::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__fpInvoke::in0); +#endif +} + +int _WS1__fpInvoke::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__fpInvoke(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__fpInvoke(struct soap *soap, const char *tag, int id, const _WS1__fpInvoke *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__fpInvoke), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__fpInvoke::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__fpInvoke::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__fpInvoke(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__fpInvoke * SOAP_FMAC4 soap_in__WS1__fpInvoke(struct soap *soap, const char *tag, _WS1__fpInvoke *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__fpInvoke*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__fpInvoke, sizeof(_WS1__fpInvoke), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__fpInvoke) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__fpInvoke *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__fpInvoke::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__fpInvoke *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__fpInvoke, SOAP_TYPE__WS1__fpInvoke, sizeof(_WS1__fpInvoke), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__fpInvoke * SOAP_FMAC2 cross_instantiate__WS1__fpInvoke(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__fpInvoke(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__fpInvoke *p; + size_t k = sizeof(_WS1__fpInvoke); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__fpInvoke, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__fpInvoke); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__fpInvoke, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__fpInvoke location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__fpInvoke::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__fpInvoke(soap, tag ? tag : "WS1:fpInvoke", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__fpInvoke::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__fpInvoke(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__fpInvoke * SOAP_FMAC4 soap_get__WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__fpInvoke(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getSrvResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getSrvResponse::getSrvReturn); +} + +void _WS1__getSrvResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getSrvResponse::getSrvReturn); +#endif +} + +int _WS1__getSrvResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getSrvResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getSrvResponse(struct soap *soap, const char *tag, int id, const _WS1__getSrvResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getSrvResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getSrvReturn"); + if (soap_out_std__string(soap, "WS1:getSrvReturn", -1, &a->_WS1__getSrvResponse::getSrvReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getSrvResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getSrvResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getSrvResponse * SOAP_FMAC4 soap_in__WS1__getSrvResponse(struct soap *soap, const char *tag, _WS1__getSrvResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getSrvResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getSrvResponse, sizeof(_WS1__getSrvResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getSrvResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getSrvResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getSrvReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getSrvReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getSrvReturn", &a->_WS1__getSrvResponse::getSrvReturn, "xsd:string")) + { soap_flag_getSrvReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getSrvReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getSrvReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getSrvResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getSrvResponse, SOAP_TYPE__WS1__getSrvResponse, sizeof(_WS1__getSrvResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__getSrvResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getSrvResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getSrvResponse *p; + size_t k = sizeof(_WS1__getSrvResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getSrvResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getSrvResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getSrvResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getSrvResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getSrvResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getSrvResponse(soap, tag ? tag : "WS1:getSrvResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getSrvResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getSrvResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getSrvResponse * SOAP_FMAC4 soap_get__WS1__getSrvResponse(struct soap *soap, _WS1__getSrvResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getSrvResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getSrv::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getSrv::in0); +} + +void _WS1__getSrv::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getSrv::in0); +#endif +} + +int _WS1__getSrv::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getSrv(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getSrv(struct soap *soap, const char *tag, int id, const _WS1__getSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getSrv), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__getSrv::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getSrv::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getSrv(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getSrv * SOAP_FMAC4 soap_in__WS1__getSrv(struct soap *soap, const char *tag, _WS1__getSrv *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getSrv*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getSrv, sizeof(_WS1__getSrv), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getSrv) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getSrv *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__getSrv::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getSrv *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getSrv, SOAP_TYPE__WS1__getSrv, sizeof(_WS1__getSrv), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getSrv * SOAP_FMAC2 cross_instantiate__WS1__getSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getSrv *p; + size_t k = sizeof(_WS1__getSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getSrv); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getSrv, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getSrv::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getSrv(soap, tag ? tag : "WS1:getSrv", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getSrv::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getSrv(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getSrv * SOAP_FMAC4 soap_get__WS1__getSrv(struct soap *soap, _WS1__getSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getProdResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getProdResponse::getProdReturn); +} + +void _WS1__getProdResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getProdResponse::getProdReturn); +#endif +} + +int _WS1__getProdResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getProdResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProdResponse(struct soap *soap, const char *tag, int id, const _WS1__getProdResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getProdResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getProdReturn"); + if (soap_out_std__string(soap, "WS1:getProdReturn", -1, &a->_WS1__getProdResponse::getProdReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getProdResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getProdResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getProdResponse * SOAP_FMAC4 soap_in__WS1__getProdResponse(struct soap *soap, const char *tag, _WS1__getProdResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getProdResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getProdResponse, sizeof(_WS1__getProdResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getProdResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getProdResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getProdReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getProdReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getProdReturn", &a->_WS1__getProdResponse::getProdReturn, "xsd:string")) + { soap_flag_getProdReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getProdReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getProdReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getProdResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getProdResponse, SOAP_TYPE__WS1__getProdResponse, sizeof(_WS1__getProdResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getProdResponse * SOAP_FMAC2 cross_instantiate__WS1__getProdResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getProdResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getProdResponse *p; + size_t k = sizeof(_WS1__getProdResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getProdResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getProdResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getProdResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getProdResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getProdResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getProdResponse(soap, tag ? tag : "WS1:getProdResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getProdResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getProdResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getProdResponse * SOAP_FMAC4 soap_get__WS1__getProdResponse(struct soap *soap, _WS1__getProdResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getProdResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getProd::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getProd::in0); +} + +void _WS1__getProd::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getProd::in0); +#endif +} + +int _WS1__getProd::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getProd(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProd(struct soap *soap, const char *tag, int id, const _WS1__getProd *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getProd), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__getProd::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getProd::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getProd(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getProd * SOAP_FMAC4 soap_in__WS1__getProd(struct soap *soap, const char *tag, _WS1__getProd *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getProd*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getProd, sizeof(_WS1__getProd), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getProd) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getProd *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__getProd::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getProd *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getProd, SOAP_TYPE__WS1__getProd, sizeof(_WS1__getProd), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getProd * SOAP_FMAC2 cross_instantiate__WS1__getProd(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getProd(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getProd *p; + size_t k = sizeof(_WS1__getProd); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getProd, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getProd); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getProd, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getProd location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getProd::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getProd(soap, tag ? tag : "WS1:getProd", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getProd::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getProd(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getProd * SOAP_FMAC4 soap_get__WS1__getProd(struct soap *soap, _WS1__getProd *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getProd(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeMdmResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeMdmResponse::invokeMdmReturn); +} + +void _WS1__invokeMdmResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeMdmResponse::invokeMdmReturn); +#endif +} + +int _WS1__invokeMdmResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeMdmResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeMdmResponse(struct soap *soap, const char *tag, int id, const _WS1__invokeMdmResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeMdmResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:invokeMdmReturn"); + if (soap_out_std__string(soap, "WS1:invokeMdmReturn", -1, &a->_WS1__invokeMdmResponse::invokeMdmReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeMdmResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeMdmResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeMdmResponse * SOAP_FMAC4 soap_in__WS1__invokeMdmResponse(struct soap *soap, const char *tag, _WS1__invokeMdmResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeMdmResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeMdmResponse, sizeof(_WS1__invokeMdmResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeMdmResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeMdmResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_invokeMdmReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_invokeMdmReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:invokeMdmReturn", &a->_WS1__invokeMdmResponse::invokeMdmReturn, "xsd:string")) + { soap_flag_invokeMdmReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:invokeMdmReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_invokeMdmReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeMdmResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeMdmResponse, SOAP_TYPE__WS1__invokeMdmResponse, sizeof(_WS1__invokeMdmResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeMdmResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeMdmResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeMdmResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeMdmResponse *p; + size_t k = sizeof(_WS1__invokeMdmResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeMdmResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeMdmResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeMdmResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeMdmResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeMdmResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeMdmResponse(soap, tag ? tag : "WS1:invokeMdmResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeMdmResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeMdmResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeMdmResponse * SOAP_FMAC4 soap_get__WS1__invokeMdmResponse(struct soap *soap, _WS1__invokeMdmResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeMdmResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeMdm::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeMdm::in0); +} + +void _WS1__invokeMdm::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeMdm::in0); +#endif +} + +int _WS1__invokeMdm::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeMdm(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeMdm(struct soap *soap, const char *tag, int id, const _WS1__invokeMdm *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeMdm), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__invokeMdm::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeMdm::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeMdm(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeMdm * SOAP_FMAC4 soap_in__WS1__invokeMdm(struct soap *soap, const char *tag, _WS1__invokeMdm *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeMdm*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeMdm, sizeof(_WS1__invokeMdm), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeMdm) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeMdm *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__invokeMdm::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeMdm *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeMdm, SOAP_TYPE__WS1__invokeMdm, sizeof(_WS1__invokeMdm), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeMdm * SOAP_FMAC2 cross_instantiate__WS1__invokeMdm(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeMdm(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeMdm *p; + size_t k = sizeof(_WS1__invokeMdm); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeMdm, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeMdm); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeMdm, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeMdm location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeMdm::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeMdm(soap, tag ? tag : "WS1:invokeMdm", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeMdm::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeMdm(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeMdm * SOAP_FMAC4 soap_get__WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeMdm(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeUnionResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeUnionResponse::invokeUnionReturn); +} + +void _WS1__invokeUnionResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeUnionResponse::invokeUnionReturn); +#endif +} + +int _WS1__invokeUnionResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeUnionResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeUnionResponse(struct soap *soap, const char *tag, int id, const _WS1__invokeUnionResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeUnionResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:invokeUnionReturn"); + if (soap_out_std__string(soap, "WS1:invokeUnionReturn", -1, &a->_WS1__invokeUnionResponse::invokeUnionReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeUnionResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeUnionResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeUnionResponse * SOAP_FMAC4 soap_in__WS1__invokeUnionResponse(struct soap *soap, const char *tag, _WS1__invokeUnionResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeUnionResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeUnionResponse, sizeof(_WS1__invokeUnionResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeUnionResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeUnionResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_invokeUnionReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_invokeUnionReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:invokeUnionReturn", &a->_WS1__invokeUnionResponse::invokeUnionReturn, "xsd:string")) + { soap_flag_invokeUnionReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:invokeUnionReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_invokeUnionReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeUnionResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeUnionResponse, SOAP_TYPE__WS1__invokeUnionResponse, sizeof(_WS1__invokeUnionResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeUnionResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeUnionResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeUnionResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeUnionResponse *p; + size_t k = sizeof(_WS1__invokeUnionResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeUnionResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeUnionResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeUnionResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeUnionResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeUnionResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeUnionResponse(soap, tag ? tag : "WS1:invokeUnionResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeUnionResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeUnionResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeUnionResponse * SOAP_FMAC4 soap_get__WS1__invokeUnionResponse(struct soap *soap, _WS1__invokeUnionResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeUnionResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeUnion::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeUnion::in0); + soap_default_std__string(soap, &this->_WS1__invokeUnion::in1); +} + +void _WS1__invokeUnion::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeUnion::in0); + soap_serialize_std__string(soap, &this->_WS1__invokeUnion::in1); +#endif +} + +int _WS1__invokeUnion::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeUnion(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeUnion(struct soap *soap, const char *tag, int id, const _WS1__invokeUnion *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeUnion), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__invokeUnion::in0, "")) + return soap->error; + if (soap_out_std__string(soap, "WS1:in1", -1, &a->_WS1__invokeUnion::in1, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeUnion::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeUnion(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeUnion * SOAP_FMAC4 soap_in__WS1__invokeUnion(struct soap *soap, const char *tag, _WS1__invokeUnion *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeUnion*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeUnion, sizeof(_WS1__invokeUnion), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeUnion) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeUnion *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + size_t soap_flag_in11 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__invokeUnion::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap_flag_in11 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in1", &a->_WS1__invokeUnion::in1, "xsd:string")) + { soap_flag_in11--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0 || soap_flag_in11 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeUnion *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeUnion, SOAP_TYPE__WS1__invokeUnion, sizeof(_WS1__invokeUnion), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeUnion * SOAP_FMAC2 cross_instantiate__WS1__invokeUnion(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeUnion(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeUnion *p; + size_t k = sizeof(_WS1__invokeUnion); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeUnion, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeUnion); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeUnion, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeUnion location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeUnion::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeUnion(soap, tag ? tag : "WS1:invokeUnion", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeUnion::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeUnion(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeUnion * SOAP_FMAC4 soap_get__WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeUnion(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__regProdAPResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__regProdAPResponse::regProdAPReturn); +} + +void _WS1__regProdAPResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__regProdAPResponse::regProdAPReturn); +#endif +} + +int _WS1__regProdAPResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__regProdAPResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regProdAPResponse(struct soap *soap, const char *tag, int id, const _WS1__regProdAPResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__regProdAPResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:regProdAPReturn"); + if (soap_out_std__string(soap, "WS1:regProdAPReturn", -1, &a->_WS1__regProdAPResponse::regProdAPReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__regProdAPResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__regProdAPResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__regProdAPResponse * SOAP_FMAC4 soap_in__WS1__regProdAPResponse(struct soap *soap, const char *tag, _WS1__regProdAPResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__regProdAPResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__regProdAPResponse, sizeof(_WS1__regProdAPResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__regProdAPResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__regProdAPResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_regProdAPReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_regProdAPReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:regProdAPReturn", &a->_WS1__regProdAPResponse::regProdAPReturn, "xsd:string")) + { soap_flag_regProdAPReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:regProdAPReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_regProdAPReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__regProdAPResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__regProdAPResponse, SOAP_TYPE__WS1__regProdAPResponse, sizeof(_WS1__regProdAPResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__regProdAPResponse * SOAP_FMAC2 cross_instantiate__WS1__regProdAPResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__regProdAPResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__regProdAPResponse *p; + size_t k = sizeof(_WS1__regProdAPResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__regProdAPResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__regProdAPResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__regProdAPResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__regProdAPResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__regProdAPResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__regProdAPResponse(soap, tag ? tag : "WS1:regProdAPResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__regProdAPResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__regProdAPResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__regProdAPResponse * SOAP_FMAC4 soap_get__WS1__regProdAPResponse(struct soap *soap, _WS1__regProdAPResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__regProdAPResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__regProdAP::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__regProdAP::in0); +} + +void _WS1__regProdAP::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__regProdAP::in0); +#endif +} + +int _WS1__regProdAP::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__regProdAP(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regProdAP(struct soap *soap, const char *tag, int id, const _WS1__regProdAP *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__regProdAP), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__regProdAP::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__regProdAP::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__regProdAP(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__regProdAP * SOAP_FMAC4 soap_in__WS1__regProdAP(struct soap *soap, const char *tag, _WS1__regProdAP *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__regProdAP*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__regProdAP, sizeof(_WS1__regProdAP), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__regProdAP) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__regProdAP *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__regProdAP::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__regProdAP *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__regProdAP, SOAP_TYPE__WS1__regProdAP, sizeof(_WS1__regProdAP), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__regProdAP * SOAP_FMAC2 cross_instantiate__WS1__regProdAP(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__regProdAP(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__regProdAP *p; + size_t k = sizeof(_WS1__regProdAP); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__regProdAP, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__regProdAP); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__regProdAP, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__regProdAP location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__regProdAP::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__regProdAP(soap, tag ? tag : "WS1:regProdAP", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__regProdAP::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__regProdAP(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__regProdAP * SOAP_FMAC4 soap_get__WS1__regProdAP(struct soap *soap, _WS1__regProdAP *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__regProdAP(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getProdListResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getProdListResponse::getProdListReturn); +} + +void _WS1__getProdListResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getProdListResponse::getProdListReturn); +#endif +} + +int _WS1__getProdListResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getProdListResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProdListResponse(struct soap *soap, const char *tag, int id, const _WS1__getProdListResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getProdListResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getProdListReturn"); + if (soap_out_std__string(soap, "WS1:getProdListReturn", -1, &a->_WS1__getProdListResponse::getProdListReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getProdListResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getProdListResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getProdListResponse * SOAP_FMAC4 soap_in__WS1__getProdListResponse(struct soap *soap, const char *tag, _WS1__getProdListResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getProdListResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getProdListResponse, sizeof(_WS1__getProdListResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getProdListResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getProdListResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getProdListReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getProdListReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getProdListReturn", &a->_WS1__getProdListResponse::getProdListReturn, "xsd:string")) + { soap_flag_getProdListReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getProdListReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getProdListReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getProdListResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getProdListResponse, SOAP_TYPE__WS1__getProdListResponse, sizeof(_WS1__getProdListResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getProdListResponse * SOAP_FMAC2 cross_instantiate__WS1__getProdListResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getProdListResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getProdListResponse *p; + size_t k = sizeof(_WS1__getProdListResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getProdListResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getProdListResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getProdListResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getProdListResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getProdListResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getProdListResponse(soap, tag ? tag : "WS1:getProdListResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getProdListResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getProdListResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getProdListResponse * SOAP_FMAC4 soap_get__WS1__getProdListResponse(struct soap *soap, _WS1__getProdListResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getProdListResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getProdList::soap_default(struct soap *soap) +{ + this->soap = soap; +} + +void _WS1__getProdList::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +int _WS1__getProdList::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getProdList(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProdList(struct soap *soap, const char *tag, int id, const _WS1__getProdList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getProdList), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getProdList::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getProdList(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getProdList * SOAP_FMAC4 soap_in__WS1__getProdList(struct soap *soap, const char *tag, _WS1__getProdList *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getProdList*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getProdList, sizeof(_WS1__getProdList), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getProdList) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getProdList *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_WS1__getProdList *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getProdList, SOAP_TYPE__WS1__getProdList, sizeof(_WS1__getProdList), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getProdList * SOAP_FMAC2 cross_instantiate__WS1__getProdList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getProdList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getProdList *p; + size_t k = sizeof(_WS1__getProdList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getProdList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getProdList); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getProdList, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getProdList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getProdList::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getProdList(soap, tag ? tag : "WS1:getProdList", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getProdList::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getProdList(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getProdList * SOAP_FMAC4 soap_get__WS1__getProdList(struct soap *soap, _WS1__getProdList *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getProdList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getParamListResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getParamListResponse::getParamListReturn); +} + +void _WS1__getParamListResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getParamListResponse::getParamListReturn); +#endif +} + +int _WS1__getParamListResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getParamListResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getParamListResponse(struct soap *soap, const char *tag, int id, const _WS1__getParamListResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getParamListResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getParamListReturn"); + if (soap_out_std__string(soap, "WS1:getParamListReturn", -1, &a->_WS1__getParamListResponse::getParamListReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getParamListResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getParamListResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getParamListResponse * SOAP_FMAC4 soap_in__WS1__getParamListResponse(struct soap *soap, const char *tag, _WS1__getParamListResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getParamListResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getParamListResponse, sizeof(_WS1__getParamListResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getParamListResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getParamListResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getParamListReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getParamListReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getParamListReturn", &a->_WS1__getParamListResponse::getParamListReturn, "xsd:string")) + { soap_flag_getParamListReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getParamListReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getParamListReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getParamListResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getParamListResponse, SOAP_TYPE__WS1__getParamListResponse, sizeof(_WS1__getParamListResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getParamListResponse * SOAP_FMAC2 cross_instantiate__WS1__getParamListResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getParamListResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getParamListResponse *p; + size_t k = sizeof(_WS1__getParamListResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getParamListResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getParamListResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getParamListResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getParamListResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getParamListResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getParamListResponse(soap, tag ? tag : "WS1:getParamListResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getParamListResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getParamListResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getParamListResponse * SOAP_FMAC4 soap_get__WS1__getParamListResponse(struct soap *soap, _WS1__getParamListResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getParamListResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getParamList::soap_default(struct soap *soap) +{ + this->soap = soap; +} + +void _WS1__getParamList::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +int _WS1__getParamList::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getParamList(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getParamList(struct soap *soap, const char *tag, int id, const _WS1__getParamList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getParamList), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getParamList::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getParamList(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getParamList * SOAP_FMAC4 soap_in__WS1__getParamList(struct soap *soap, const char *tag, _WS1__getParamList *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getParamList*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getParamList, sizeof(_WS1__getParamList), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getParamList) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getParamList *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (_WS1__getParamList *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getParamList, SOAP_TYPE__WS1__getParamList, sizeof(_WS1__getParamList), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getParamList * SOAP_FMAC2 cross_instantiate__WS1__getParamList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getParamList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getParamList *p; + size_t k = sizeof(_WS1__getParamList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getParamList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getParamList); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getParamList, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getParamList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getParamList::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getParamList(soap, tag ? tag : "WS1:getParamList", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getParamList::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getParamList(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getParamList * SOAP_FMAC4 soap_get__WS1__getParamList(struct soap *soap, _WS1__getParamList *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getParamList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getEtlJobListResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getEtlJobListResponse::getEtlJobListReturn); +} + +void _WS1__getEtlJobListResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getEtlJobListResponse::getEtlJobListReturn); +#endif +} + +int _WS1__getEtlJobListResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getEtlJobListResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getEtlJobListResponse(struct soap *soap, const char *tag, int id, const _WS1__getEtlJobListResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getEtlJobListResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:getEtlJobListReturn"); + if (soap_out_std__string(soap, "WS1:getEtlJobListReturn", -1, &a->_WS1__getEtlJobListResponse::getEtlJobListReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getEtlJobListResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getEtlJobListResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getEtlJobListResponse * SOAP_FMAC4 soap_in__WS1__getEtlJobListResponse(struct soap *soap, const char *tag, _WS1__getEtlJobListResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getEtlJobListResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getEtlJobListResponse, sizeof(_WS1__getEtlJobListResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getEtlJobListResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getEtlJobListResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_getEtlJobListReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_getEtlJobListReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:getEtlJobListReturn", &a->_WS1__getEtlJobListResponse::getEtlJobListReturn, "xsd:string")) + { soap_flag_getEtlJobListReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:getEtlJobListReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_getEtlJobListReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getEtlJobListResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getEtlJobListResponse, SOAP_TYPE__WS1__getEtlJobListResponse, sizeof(_WS1__getEtlJobListResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getEtlJobListResponse * SOAP_FMAC2 cross_instantiate__WS1__getEtlJobListResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getEtlJobListResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getEtlJobListResponse *p; + size_t k = sizeof(_WS1__getEtlJobListResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getEtlJobListResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getEtlJobListResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getEtlJobListResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getEtlJobListResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getEtlJobListResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getEtlJobListResponse(soap, tag ? tag : "WS1:getEtlJobListResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getEtlJobListResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getEtlJobListResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getEtlJobListResponse * SOAP_FMAC4 soap_get__WS1__getEtlJobListResponse(struct soap *soap, _WS1__getEtlJobListResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getEtlJobListResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__getEtlJobList::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__getEtlJobList::in0); +} + +void _WS1__getEtlJobList::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__getEtlJobList::in0); +#endif +} + +int _WS1__getEtlJobList::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__getEtlJobList(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getEtlJobList(struct soap *soap, const char *tag, int id, const _WS1__getEtlJobList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__getEtlJobList), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__getEtlJobList::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__getEtlJobList::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__getEtlJobList(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__getEtlJobList * SOAP_FMAC4 soap_in__WS1__getEtlJobList(struct soap *soap, const char *tag, _WS1__getEtlJobList *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__getEtlJobList*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__getEtlJobList, sizeof(_WS1__getEtlJobList), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__getEtlJobList) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__getEtlJobList *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__getEtlJobList::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__getEtlJobList *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__getEtlJobList, SOAP_TYPE__WS1__getEtlJobList, sizeof(_WS1__getEtlJobList), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__getEtlJobList * SOAP_FMAC2 cross_instantiate__WS1__getEtlJobList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__getEtlJobList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__getEtlJobList *p; + size_t k = sizeof(_WS1__getEtlJobList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__getEtlJobList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__getEtlJobList); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__getEtlJobList, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__getEtlJobList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__getEtlJobList::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__getEtlJobList(soap, tag ? tag : "WS1:getEtlJobList", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__getEtlJobList::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__getEtlJobList(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__getEtlJobList * SOAP_FMAC4 soap_get__WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__getEtlJobList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeEtlResponse::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeEtlResponse::invokeEtlReturn); +} + +void _WS1__invokeEtlResponse::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeEtlResponse::invokeEtlReturn); +#endif +} + +int _WS1__invokeEtlResponse::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeEtlResponse(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeEtlResponse(struct soap *soap, const char *tag, int id, const _WS1__invokeEtlResponse *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeEtlResponse), type)) + return soap->error; + soap_element_result(soap, "WS1:invokeEtlReturn"); + if (soap_out_std__string(soap, "WS1:invokeEtlReturn", -1, &a->_WS1__invokeEtlResponse::invokeEtlReturn, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeEtlResponse::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeEtlResponse(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeEtlResponse * SOAP_FMAC4 soap_in__WS1__invokeEtlResponse(struct soap *soap, const char *tag, _WS1__invokeEtlResponse *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeEtlResponse*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeEtlResponse, sizeof(_WS1__invokeEtlResponse), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeEtlResponse) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeEtlResponse *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_invokeEtlReturn1 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_invokeEtlReturn1 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:invokeEtlReturn", &a->_WS1__invokeEtlResponse::invokeEtlReturn, "xsd:string")) + { soap_flag_invokeEtlReturn1--; + continue; + } + } + soap_check_result(soap, "WS1:invokeEtlReturn"); + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_invokeEtlReturn1 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeEtlResponse *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeEtlResponse, SOAP_TYPE__WS1__invokeEtlResponse, sizeof(_WS1__invokeEtlResponse), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeEtlResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeEtlResponse(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeEtlResponse(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeEtlResponse *p; + size_t k = sizeof(_WS1__invokeEtlResponse); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeEtlResponse, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeEtlResponse); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeEtlResponse, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeEtlResponse location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeEtlResponse::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeEtlResponse(soap, tag ? tag : "WS1:invokeEtlResponse", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeEtlResponse::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeEtlResponse(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeEtlResponse * SOAP_FMAC4 soap_get__WS1__invokeEtlResponse(struct soap *soap, _WS1__invokeEtlResponse *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeEtlResponse(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +void _WS1__invokeEtl::soap_default(struct soap *soap) +{ + this->soap = soap; + soap_default_std__string(soap, &this->_WS1__invokeEtl::in0); +} + +void _WS1__invokeEtl::soap_serialize(struct soap *soap) const +{ + (void)soap; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_std__string(soap, &this->_WS1__invokeEtl::in0); +#endif +} + +int _WS1__invokeEtl::soap_out(struct soap *soap, const char *tag, int id, const char *type) const +{ + return soap_out__WS1__invokeEtl(soap, tag, id, this, type); +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeEtl(struct soap *soap, const char *tag, int id, const _WS1__invokeEtl *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE__WS1__invokeEtl), type)) + return soap->error; + if (soap_out_std__string(soap, "WS1:in0", -1, &a->_WS1__invokeEtl::in0, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +void *_WS1__invokeEtl::soap_in(struct soap *soap, const char *tag, const char *type) +{ + return soap_in__WS1__invokeEtl(soap, tag, this, type); +} + +SOAP_FMAC3 _WS1__invokeEtl * SOAP_FMAC4 soap_in__WS1__invokeEtl(struct soap *soap, const char *tag, _WS1__invokeEtl *a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + a = (_WS1__invokeEtl*)soap_id_enter(soap, soap->id, a, SOAP_TYPE__WS1__invokeEtl, sizeof(_WS1__invokeEtl), soap->type, soap->arrayType, cross_instantiate, cross_fbase); + if (!a) + return NULL; + if (soap->alloced && soap->alloced != SOAP_TYPE__WS1__invokeEtl) + { soap_revert(soap); + *soap->id = '\0'; + return (_WS1__invokeEtl *)a->soap_in(soap, tag, type); + } + if (soap->alloced) + a->soap_default(soap); + size_t soap_flag_in01 = 1; + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_in01 && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_std__string(soap, "WS1:in0", &a->_WS1__invokeEtl::in0, "xsd:string")) + { soap_flag_in01--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + if ((soap->mode & SOAP_XML_STRICT) && (soap_flag_in01 > 0)) + { soap->error = SOAP_OCCURS; + return NULL; + } + } + else if ((soap->mode & SOAP_XML_STRICT) && *soap->href != '#') + { soap->error = SOAP_OCCURS; + return NULL; + } + else + { a = (_WS1__invokeEtl *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE__WS1__invokeEtl, SOAP_TYPE__WS1__invokeEtl, sizeof(_WS1__invokeEtl), 0, cross_finsert, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 _WS1__invokeEtl * SOAP_FMAC2 cross_instantiate__WS1__invokeEtl(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate__WS1__invokeEtl(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + _WS1__invokeEtl *p; + size_t k = sizeof(_WS1__invokeEtl); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE__WS1__invokeEtl, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, _WS1__invokeEtl); + if (p) + p->soap = soap; + } + else + { p = SOAP_NEW_ARRAY(soap, _WS1__invokeEtl, n); + k *= n; + if (p) + for (int i = 0; i < n; i++) + p[i].soap = soap; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated _WS1__invokeEtl location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +int _WS1__invokeEtl::soap_put(struct soap *soap, const char *tag, const char *type) const +{ + if (soap_out__WS1__invokeEtl(soap, tag ? tag : "WS1:invokeEtl", -2, this, type)) + return soap->error; + return soap_putindependent(soap); +} + +void *_WS1__invokeEtl::soap_get(struct soap *soap, const char *tag, const char *type) +{ + return soap_get__WS1__invokeEtl(soap, this, tag, type); +} + +SOAP_FMAC3 _WS1__invokeEtl * SOAP_FMAC4 soap_get__WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl *p, const char *tag, const char *type) +{ + if ((p = soap_in__WS1__invokeEtl(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default__QName(soap, &a->faultcode); + soap_default_string(soap, &a->faultstring); + soap_default_string(soap, &a->faultactor); + a->detail = NULL; + a->SOAP_ENV__Code = NULL; + a->SOAP_ENV__Reason = NULL; + soap_default_string(soap, &a->SOAP_ENV__Node); + soap_default_string(soap, &a->SOAP_ENV__Role); + a->SOAP_ENV__Detail = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize__QName(soap, (char*const*)&a->faultcode); + soap_serialize_string(soap, (char*const*)&a->faultstring); + soap_serialize_string(soap, (char*const*)&a->faultactor); + soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->detail); + soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Code); + soap_serialize_PointerToSOAP_ENV__Reason(soap, &a->SOAP_ENV__Reason); + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Node); + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Role); + soap_serialize_PointerToSOAP_ENV__Detail(soap, &a->SOAP_ENV__Detail); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Fault *a, const char *type) +{ + const char *soap_tmp_faultcode; + soap_tmp_faultcode = soap_QName2s(soap, a->faultcode); + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Fault), type)) + return soap->error; + if (soap_out__QName(soap, "faultcode", -1, (char*const*)(void*)&soap_tmp_faultcode, "")) + return soap->error; + if (soap_out_string(soap, "faultstring", -1, (char*const*)&a->faultstring, "")) + return soap->error; + if (soap_out_string(soap, "faultactor", -1, (char*const*)&a->faultactor, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Detail(soap, "detail", -1, &a->detail, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Code", -1, &a->SOAP_ENV__Code, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", -1, &a->SOAP_ENV__Reason, "")) + return soap->error; + if (soap_out_string(soap, "SOAP-ENV:Node", -1, (char*const*)&a->SOAP_ENV__Node, "")) + return soap->error; + if (soap_out_string(soap, "SOAP-ENV:Role", -1, (char*const*)&a->SOAP_ENV__Role, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", -1, &a->SOAP_ENV__Detail, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap *soap, const char *tag, struct SOAP_ENV__Fault *a, const char *type) +{ + size_t soap_flag_faultcode = 1; + size_t soap_flag_faultstring = 1; + size_t soap_flag_faultactor = 1; + size_t soap_flag_detail = 1; + size_t soap_flag_SOAP_ENV__Code = 1; + size_t soap_flag_SOAP_ENV__Reason = 1; + size_t soap_flag_SOAP_ENV__Node = 1; + size_t soap_flag_SOAP_ENV__Role = 1; + size_t soap_flag_SOAP_ENV__Detail = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Fault*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Fault(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_faultcode && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in__QName(soap, "faultcode", (char**)&a->faultcode, "xsd:QName")) + { soap_flag_faultcode--; + continue; + } + } + if (soap_flag_faultstring && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "faultstring", (char**)&a->faultstring, "xsd:string")) + { soap_flag_faultstring--; + continue; + } + } + if (soap_flag_faultactor && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "faultactor", (char**)&a->faultactor, "xsd:string")) + { soap_flag_faultactor--; + continue; + } + } + if (soap_flag_detail && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Detail(soap, "detail", &a->detail, "")) + { soap_flag_detail--; + continue; + } + } + if (soap_flag_SOAP_ENV__Code && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Code", &a->SOAP_ENV__Code, "")) + { soap_flag_SOAP_ENV__Code--; + continue; + } + } + if (soap_flag_SOAP_ENV__Reason && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Reason(soap, "SOAP-ENV:Reason", &a->SOAP_ENV__Reason, "")) + { soap_flag_SOAP_ENV__Reason--; + continue; + } + } + if (soap_flag_SOAP_ENV__Node && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Node", (char**)&a->SOAP_ENV__Node, "xsd:string")) + { soap_flag_SOAP_ENV__Node--; + continue; + } + } + if (soap_flag_SOAP_ENV__Role && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Role", (char**)&a->SOAP_ENV__Role, "xsd:string")) + { soap_flag_SOAP_ENV__Role--; + continue; + } + } + if (soap_flag_SOAP_ENV__Detail && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Detail(soap, "SOAP-ENV:Detail", &a->SOAP_ENV__Detail, "")) + { soap_flag_SOAP_ENV__Detail--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Fault *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Fault, SOAP_TYPE_SOAP_ENV__Fault, sizeof(struct SOAP_ENV__Fault), 0, cross_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Fault(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate_SOAP_ENV__Fault(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Fault *p; + size_t k = sizeof(struct SOAP_ENV__Fault); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Fault, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Fault); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Fault, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Fault location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Fault(soap, tag ? tag : "SOAP-ENV:Fault", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Fault(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default_string(soap, &a->SOAP_ENV__Text); +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_string(soap, (char*const*)&a->SOAP_ENV__Text); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Reason *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Reason), type)) + return soap->error; + if (soap->lang) + soap_set_attr(soap, "xml:lang", soap->lang, 1); + if (soap_out_string(soap, "SOAP-ENV:Text", -1, (char*const*)&a->SOAP_ENV__Text, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason *a, const char *type) +{ + size_t soap_flag_SOAP_ENV__Text = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Reason*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Reason(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SOAP_ENV__Text && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in_string(soap, "SOAP-ENV:Text", (char**)&a->SOAP_ENV__Text, "xsd:string")) + { soap_flag_SOAP_ENV__Text--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Reason *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Reason, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, cross_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Reason(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate_SOAP_ENV__Reason(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Reason *p; + size_t k = sizeof(struct SOAP_ENV__Reason); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Reason, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Reason); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Reason, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Reason location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap *soap, const struct SOAP_ENV__Reason *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Reason(soap, tag ? tag : "SOAP-ENV:Reason", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Reason(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->__any = NULL; + a->__type = 0; + a->fault = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_markelement(soap, a->fault, a->__type); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Detail *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Detail), type)) + return soap->error; + if (soap_outliteral(soap, "-any", (char*const*)&a->__any, NULL)) + return soap->error; + if (soap_putelement(soap, a->fault, "fault", -1, a->__type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail *a, const char *type) +{ + size_t soap_flag___any = 1; + size_t soap_flag_fault = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Detail*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Detail(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_fault && soap->error == SOAP_TAG_MISMATCH) + { if ((a->fault = soap_getelement(soap, "fault", &a->__type))) + { soap_flag_fault = 0; + continue; + } + } + if (soap_flag___any && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_inliteral(soap, "-any", (char**)&a->__any)) + { soap_flag___any--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Detail *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Detail, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, cross_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Detail(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate_SOAP_ENV__Detail(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Detail *p; + size_t k = sizeof(struct SOAP_ENV__Detail); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Detail, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Detail); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Detail, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Detail location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap *soap, const struct SOAP_ENV__Detail *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Detail(soap, tag ? tag : "SOAP-ENV:Detail", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Detail(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + soap_default__QName(soap, &a->SOAP_ENV__Value); + a->SOAP_ENV__Subcode = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize__QName(soap, (char*const*)&a->SOAP_ENV__Value); + soap_serialize_PointerToSOAP_ENV__Code(soap, &a->SOAP_ENV__Subcode); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Code *a, const char *type) +{ + const char *soap_tmp_SOAP_ENV__Value; + soap_tmp_SOAP_ENV__Value = soap_QName2s(soap, a->SOAP_ENV__Value); + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Code), type)) + return soap->error; + if (soap_out__QName(soap, "SOAP-ENV:Value", -1, (char*const*)(void*)&soap_tmp_SOAP_ENV__Value, "")) + return soap->error; + if (soap_out_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", -1, &a->SOAP_ENV__Subcode, "")) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code *a, const char *type) +{ + size_t soap_flag_SOAP_ENV__Value = 1; + size_t soap_flag_SOAP_ENV__Subcode = 1; + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Code*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Code(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_SOAP_ENV__Value && (soap->error == SOAP_TAG_MISMATCH || soap->error == SOAP_NO_TAG)) + { if (soap_in__QName(soap, "SOAP-ENV:Value", (char**)&a->SOAP_ENV__Value, "xsd:QName")) + { soap_flag_SOAP_ENV__Value--; + continue; + } + } + if (soap_flag_SOAP_ENV__Subcode && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerToSOAP_ENV__Code(soap, "SOAP-ENV:Subcode", &a->SOAP_ENV__Subcode, "")) + { soap_flag_SOAP_ENV__Subcode--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Code *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Code, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, cross_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Code(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate_SOAP_ENV__Code(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Code *p; + size_t k = sizeof(struct SOAP_ENV__Code); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Code, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Code); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Code, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Code location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap *soap, const struct SOAP_ENV__Code *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Code(soap, tag ? tag : "SOAP-ENV:Code", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Code(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap *soap, const char *tag, struct SOAP_ENV__Header *a, const char *type) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + (void)type; /* appease -Wall -Werror */ + a = (struct SOAP_ENV__Header*)soap_id_enter(soap, soap->id, a, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default_SOAP_ENV__Header(soap, a); + if (soap->body && *soap->href != '#') + { + for (;;) + { soap->error = SOAP_TAG_MISMATCH; + if (soap->error == SOAP_TAG_MISMATCH) + soap->error = soap_ignore_element(soap); + if (soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + if (soap_element_end_in(soap, tag)) + return NULL; + } + else + { a = (struct SOAP_ENV__Header *)soap_id_forward(soap, soap->href, (void*)a, 0, SOAP_TYPE_SOAP_ENV__Header, SOAP_TYPE_SOAP_ENV__Header, sizeof(struct SOAP_ENV__Header), 0, cross_finsert, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Header(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate_SOAP_ENV__Header(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct SOAP_ENV__Header *p; + size_t k = sizeof(struct SOAP_ENV__Header); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE_SOAP_ENV__Header, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct SOAP_ENV__Header); + } + else + { p = SOAP_NEW_ARRAY(soap, struct SOAP_ENV__Header, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct SOAP_ENV__Header location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a, const char *tag, const char *type) +{ + if (soap_out_SOAP_ENV__Header(soap, tag ? tag : "SOAP-ENV:Header", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p, const char *tag, const char *type) +{ + if ((p = soap_in_SOAP_ENV__Header(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__escrowResendSrv(struct soap *soap, struct __WS1__escrowResendSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__escrowResendSrv = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__escrowResendSrv(struct soap *soap, const struct __WS1__escrowResendSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__escrowResendSrv(soap, &a->WS1__escrowResendSrv); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__escrowResendSrv(struct soap *soap, const char *tag, int id, const struct __WS1__escrowResendSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__escrowResendSrv(soap, "WS1:escrowResendSrv", -1, &a->WS1__escrowResendSrv, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__escrowResendSrv * SOAP_FMAC4 soap_in___WS1__escrowResendSrv(struct soap *soap, const char *tag, struct __WS1__escrowResendSrv *a, const char *type) +{ + size_t soap_flag_WS1__escrowResendSrv = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__escrowResendSrv*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__escrowResendSrv, sizeof(struct __WS1__escrowResendSrv), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__escrowResendSrv(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__escrowResendSrv && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__escrowResendSrv(soap, "WS1:escrowResendSrv", &a->WS1__escrowResendSrv, "")) + { soap_flag_WS1__escrowResendSrv--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__escrowResendSrv * SOAP_FMAC2 cross_instantiate___WS1__escrowResendSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__escrowResendSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__escrowResendSrv *p; + size_t k = sizeof(struct __WS1__escrowResendSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__escrowResendSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__escrowResendSrv); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__escrowResendSrv, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__escrowResendSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__escrowResendSrv(struct soap *soap, const struct __WS1__escrowResendSrv *a, const char *tag, const char *type) +{ + if (soap_out___WS1__escrowResendSrv(soap, tag ? tag : "-WS1:escrowResendSrv", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__escrowResendSrv * SOAP_FMAC4 soap_get___WS1__escrowResendSrv(struct soap *soap, struct __WS1__escrowResendSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__escrowResendSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeSrv(struct soap *soap, struct __WS1__invokeSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__invokeSrv = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeSrv(struct soap *soap, const struct __WS1__invokeSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__invokeSrv(soap, &a->WS1__invokeSrv); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeSrv(struct soap *soap, const char *tag, int id, const struct __WS1__invokeSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__invokeSrv(soap, "WS1:invokeSrv", -1, &a->WS1__invokeSrv, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeSrv * SOAP_FMAC4 soap_in___WS1__invokeSrv(struct soap *soap, const char *tag, struct __WS1__invokeSrv *a, const char *type) +{ + size_t soap_flag_WS1__invokeSrv = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__invokeSrv*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__invokeSrv, sizeof(struct __WS1__invokeSrv), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__invokeSrv(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__invokeSrv && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__invokeSrv(soap, "WS1:invokeSrv", &a->WS1__invokeSrv, "")) + { soap_flag_WS1__invokeSrv--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__invokeSrv * SOAP_FMAC2 cross_instantiate___WS1__invokeSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__invokeSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__invokeSrv *p; + size_t k = sizeof(struct __WS1__invokeSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__invokeSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__invokeSrv); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__invokeSrv, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__invokeSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeSrv(struct soap *soap, const struct __WS1__invokeSrv *a, const char *tag, const char *type) +{ + if (soap_out___WS1__invokeSrv(soap, tag ? tag : "-WS1:invokeSrv", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeSrv * SOAP_FMAC4 soap_get___WS1__invokeSrv(struct soap *soap, struct __WS1__invokeSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__invokeSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__regEAI(struct soap *soap, struct __WS1__regEAI *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__regEAI = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__regEAI(struct soap *soap, const struct __WS1__regEAI *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__regEAI(soap, &a->WS1__regEAI); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__regEAI(struct soap *soap, const char *tag, int id, const struct __WS1__regEAI *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__regEAI(soap, "WS1:regEAI", -1, &a->WS1__regEAI, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__regEAI * SOAP_FMAC4 soap_in___WS1__regEAI(struct soap *soap, const char *tag, struct __WS1__regEAI *a, const char *type) +{ + size_t soap_flag_WS1__regEAI = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__regEAI*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__regEAI, sizeof(struct __WS1__regEAI), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__regEAI(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__regEAI && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__regEAI(soap, "WS1:regEAI", &a->WS1__regEAI, "")) + { soap_flag_WS1__regEAI--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__regEAI * SOAP_FMAC2 cross_instantiate___WS1__regEAI(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__regEAI(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__regEAI *p; + size_t k = sizeof(struct __WS1__regEAI); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__regEAI, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__regEAI); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__regEAI, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__regEAI location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__regEAI(struct soap *soap, const struct __WS1__regEAI *a, const char *tag, const char *type) +{ + if (soap_out___WS1__regEAI(soap, tag ? tag : "-WS1:regEAI", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__regEAI * SOAP_FMAC4 soap_get___WS1__regEAI(struct soap *soap, struct __WS1__regEAI *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__regEAI(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__regSrv(struct soap *soap, struct __WS1__regSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__regSrv = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__regSrv(struct soap *soap, const struct __WS1__regSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__regSrv(soap, &a->WS1__regSrv); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__regSrv(struct soap *soap, const char *tag, int id, const struct __WS1__regSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__regSrv(soap, "WS1:regSrv", -1, &a->WS1__regSrv, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__regSrv * SOAP_FMAC4 soap_in___WS1__regSrv(struct soap *soap, const char *tag, struct __WS1__regSrv *a, const char *type) +{ + size_t soap_flag_WS1__regSrv = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__regSrv*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__regSrv, sizeof(struct __WS1__regSrv), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__regSrv(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__regSrv && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__regSrv(soap, "WS1:regSrv", &a->WS1__regSrv, "")) + { soap_flag_WS1__regSrv--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__regSrv * SOAP_FMAC2 cross_instantiate___WS1__regSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__regSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__regSrv *p; + size_t k = sizeof(struct __WS1__regSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__regSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__regSrv); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__regSrv, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__regSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__regSrv(struct soap *soap, const struct __WS1__regSrv *a, const char *tag, const char *type) +{ + if (soap_out___WS1__regSrv(soap, tag ? tag : "-WS1:regSrv", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__regSrv * SOAP_FMAC4 soap_get___WS1__regSrv(struct soap *soap, struct __WS1__regSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__regSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getStandardDataNameList(struct soap *soap, struct __WS1__getStandardDataNameList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getStandardDataNameList = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getStandardDataNameList(struct soap *soap, const struct __WS1__getStandardDataNameList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getStandardDataNameList(soap, &a->WS1__getStandardDataNameList); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getStandardDataNameList(struct soap *soap, const char *tag, int id, const struct __WS1__getStandardDataNameList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getStandardDataNameList(soap, "WS1:getStandardDataNameList", -1, &a->WS1__getStandardDataNameList, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getStandardDataNameList * SOAP_FMAC4 soap_in___WS1__getStandardDataNameList(struct soap *soap, const char *tag, struct __WS1__getStandardDataNameList *a, const char *type) +{ + size_t soap_flag_WS1__getStandardDataNameList = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getStandardDataNameList*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getStandardDataNameList, sizeof(struct __WS1__getStandardDataNameList), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getStandardDataNameList(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getStandardDataNameList && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getStandardDataNameList(soap, "WS1:getStandardDataNameList", &a->WS1__getStandardDataNameList, "")) + { soap_flag_WS1__getStandardDataNameList--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getStandardDataNameList * SOAP_FMAC2 cross_instantiate___WS1__getStandardDataNameList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getStandardDataNameList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getStandardDataNameList *p; + size_t k = sizeof(struct __WS1__getStandardDataNameList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getStandardDataNameList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getStandardDataNameList); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getStandardDataNameList, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getStandardDataNameList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getStandardDataNameList(struct soap *soap, const struct __WS1__getStandardDataNameList *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getStandardDataNameList(soap, tag ? tag : "-WS1:getStandardDataNameList", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getStandardDataNameList * SOAP_FMAC4 soap_get___WS1__getStandardDataNameList(struct soap *soap, struct __WS1__getStandardDataNameList *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getStandardDataNameList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getStandardServiceList(struct soap *soap, struct __WS1__getStandardServiceList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getStandardServiceList = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getStandardServiceList(struct soap *soap, const struct __WS1__getStandardServiceList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getStandardServiceList(soap, &a->WS1__getStandardServiceList); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getStandardServiceList(struct soap *soap, const char *tag, int id, const struct __WS1__getStandardServiceList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getStandardServiceList(soap, "WS1:getStandardServiceList", -1, &a->WS1__getStandardServiceList, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getStandardServiceList * SOAP_FMAC4 soap_in___WS1__getStandardServiceList(struct soap *soap, const char *tag, struct __WS1__getStandardServiceList *a, const char *type) +{ + size_t soap_flag_WS1__getStandardServiceList = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getStandardServiceList*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getStandardServiceList, sizeof(struct __WS1__getStandardServiceList), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getStandardServiceList(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getStandardServiceList && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getStandardServiceList(soap, "WS1:getStandardServiceList", &a->WS1__getStandardServiceList, "")) + { soap_flag_WS1__getStandardServiceList--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getStandardServiceList * SOAP_FMAC2 cross_instantiate___WS1__getStandardServiceList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getStandardServiceList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getStandardServiceList *p; + size_t k = sizeof(struct __WS1__getStandardServiceList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getStandardServiceList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getStandardServiceList); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getStandardServiceList, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getStandardServiceList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getStandardServiceList(struct soap *soap, const struct __WS1__getStandardServiceList *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getStandardServiceList(soap, tag ? tag : "-WS1:getStandardServiceList", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getStandardServiceList * SOAP_FMAC4 soap_get___WS1__getStandardServiceList(struct soap *soap, struct __WS1__getStandardServiceList *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getStandardServiceList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__fpInvoke(struct soap *soap, struct __WS1__fpInvoke *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__fpInvoke = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__fpInvoke(struct soap *soap, const struct __WS1__fpInvoke *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__fpInvoke(soap, &a->WS1__fpInvoke); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__fpInvoke(struct soap *soap, const char *tag, int id, const struct __WS1__fpInvoke *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__fpInvoke(soap, "WS1:fpInvoke", -1, &a->WS1__fpInvoke, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__fpInvoke * SOAP_FMAC4 soap_in___WS1__fpInvoke(struct soap *soap, const char *tag, struct __WS1__fpInvoke *a, const char *type) +{ + size_t soap_flag_WS1__fpInvoke = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__fpInvoke*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__fpInvoke, sizeof(struct __WS1__fpInvoke), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__fpInvoke(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__fpInvoke && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__fpInvoke(soap, "WS1:fpInvoke", &a->WS1__fpInvoke, "")) + { soap_flag_WS1__fpInvoke--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__fpInvoke * SOAP_FMAC2 cross_instantiate___WS1__fpInvoke(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__fpInvoke(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__fpInvoke *p; + size_t k = sizeof(struct __WS1__fpInvoke); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__fpInvoke, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__fpInvoke); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__fpInvoke, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__fpInvoke location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__fpInvoke(struct soap *soap, const struct __WS1__fpInvoke *a, const char *tag, const char *type) +{ + if (soap_out___WS1__fpInvoke(soap, tag ? tag : "-WS1:fpInvoke", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__fpInvoke * SOAP_FMAC4 soap_get___WS1__fpInvoke(struct soap *soap, struct __WS1__fpInvoke *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__fpInvoke(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getSrv(struct soap *soap, struct __WS1__getSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getSrv = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getSrv(struct soap *soap, const struct __WS1__getSrv *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getSrv(soap, &a->WS1__getSrv); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getSrv(struct soap *soap, const char *tag, int id, const struct __WS1__getSrv *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getSrv(soap, "WS1:getSrv", -1, &a->WS1__getSrv, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getSrv * SOAP_FMAC4 soap_in___WS1__getSrv(struct soap *soap, const char *tag, struct __WS1__getSrv *a, const char *type) +{ + size_t soap_flag_WS1__getSrv = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getSrv*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getSrv, sizeof(struct __WS1__getSrv), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getSrv(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getSrv && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getSrv(soap, "WS1:getSrv", &a->WS1__getSrv, "")) + { soap_flag_WS1__getSrv--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getSrv * SOAP_FMAC2 cross_instantiate___WS1__getSrv(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getSrv(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getSrv *p; + size_t k = sizeof(struct __WS1__getSrv); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getSrv, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getSrv); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getSrv, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getSrv location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getSrv(struct soap *soap, const struct __WS1__getSrv *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getSrv(soap, tag ? tag : "-WS1:getSrv", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getSrv * SOAP_FMAC4 soap_get___WS1__getSrv(struct soap *soap, struct __WS1__getSrv *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getProd(struct soap *soap, struct __WS1__getProd *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getProd = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getProd(struct soap *soap, const struct __WS1__getProd *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getProd(soap, &a->WS1__getProd); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getProd(struct soap *soap, const char *tag, int id, const struct __WS1__getProd *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getProd(soap, "WS1:getProd", -1, &a->WS1__getProd, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getProd * SOAP_FMAC4 soap_in___WS1__getProd(struct soap *soap, const char *tag, struct __WS1__getProd *a, const char *type) +{ + size_t soap_flag_WS1__getProd = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getProd*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getProd, sizeof(struct __WS1__getProd), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getProd(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getProd && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getProd(soap, "WS1:getProd", &a->WS1__getProd, "")) + { soap_flag_WS1__getProd--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getProd * SOAP_FMAC2 cross_instantiate___WS1__getProd(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getProd(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getProd *p; + size_t k = sizeof(struct __WS1__getProd); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getProd, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getProd); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getProd, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getProd location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getProd(struct soap *soap, const struct __WS1__getProd *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getProd(soap, tag ? tag : "-WS1:getProd", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getProd * SOAP_FMAC4 soap_get___WS1__getProd(struct soap *soap, struct __WS1__getProd *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getProd(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeMdm(struct soap *soap, struct __WS1__invokeMdm *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__invokeMdm = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeMdm(struct soap *soap, const struct __WS1__invokeMdm *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__invokeMdm(soap, &a->WS1__invokeMdm); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeMdm(struct soap *soap, const char *tag, int id, const struct __WS1__invokeMdm *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__invokeMdm(soap, "WS1:invokeMdm", -1, &a->WS1__invokeMdm, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeMdm * SOAP_FMAC4 soap_in___WS1__invokeMdm(struct soap *soap, const char *tag, struct __WS1__invokeMdm *a, const char *type) +{ + size_t soap_flag_WS1__invokeMdm = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__invokeMdm*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__invokeMdm, sizeof(struct __WS1__invokeMdm), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__invokeMdm(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__invokeMdm && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__invokeMdm(soap, "WS1:invokeMdm", &a->WS1__invokeMdm, "")) + { soap_flag_WS1__invokeMdm--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__invokeMdm * SOAP_FMAC2 cross_instantiate___WS1__invokeMdm(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__invokeMdm(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__invokeMdm *p; + size_t k = sizeof(struct __WS1__invokeMdm); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__invokeMdm, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__invokeMdm); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__invokeMdm, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__invokeMdm location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeMdm(struct soap *soap, const struct __WS1__invokeMdm *a, const char *tag, const char *type) +{ + if (soap_out___WS1__invokeMdm(soap, tag ? tag : "-WS1:invokeMdm", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeMdm * SOAP_FMAC4 soap_get___WS1__invokeMdm(struct soap *soap, struct __WS1__invokeMdm *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__invokeMdm(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeUnion(struct soap *soap, struct __WS1__invokeUnion *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__invokeUnion = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeUnion(struct soap *soap, const struct __WS1__invokeUnion *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__invokeUnion(soap, &a->WS1__invokeUnion); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeUnion(struct soap *soap, const char *tag, int id, const struct __WS1__invokeUnion *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__invokeUnion(soap, "WS1:invokeUnion", -1, &a->WS1__invokeUnion, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeUnion * SOAP_FMAC4 soap_in___WS1__invokeUnion(struct soap *soap, const char *tag, struct __WS1__invokeUnion *a, const char *type) +{ + size_t soap_flag_WS1__invokeUnion = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__invokeUnion*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__invokeUnion, sizeof(struct __WS1__invokeUnion), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__invokeUnion(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__invokeUnion && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__invokeUnion(soap, "WS1:invokeUnion", &a->WS1__invokeUnion, "")) + { soap_flag_WS1__invokeUnion--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__invokeUnion * SOAP_FMAC2 cross_instantiate___WS1__invokeUnion(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__invokeUnion(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__invokeUnion *p; + size_t k = sizeof(struct __WS1__invokeUnion); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__invokeUnion, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__invokeUnion); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__invokeUnion, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__invokeUnion location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeUnion(struct soap *soap, const struct __WS1__invokeUnion *a, const char *tag, const char *type) +{ + if (soap_out___WS1__invokeUnion(soap, tag ? tag : "-WS1:invokeUnion", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeUnion * SOAP_FMAC4 soap_get___WS1__invokeUnion(struct soap *soap, struct __WS1__invokeUnion *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__invokeUnion(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__regProdAP(struct soap *soap, struct __WS1__regProdAP *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__regProdAP = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__regProdAP(struct soap *soap, const struct __WS1__regProdAP *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__regProdAP(soap, &a->WS1__regProdAP); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__regProdAP(struct soap *soap, const char *tag, int id, const struct __WS1__regProdAP *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__regProdAP(soap, "WS1:regProdAP", -1, &a->WS1__regProdAP, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__regProdAP * SOAP_FMAC4 soap_in___WS1__regProdAP(struct soap *soap, const char *tag, struct __WS1__regProdAP *a, const char *type) +{ + size_t soap_flag_WS1__regProdAP = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__regProdAP*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__regProdAP, sizeof(struct __WS1__regProdAP), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__regProdAP(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__regProdAP && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__regProdAP(soap, "WS1:regProdAP", &a->WS1__regProdAP, "")) + { soap_flag_WS1__regProdAP--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__regProdAP * SOAP_FMAC2 cross_instantiate___WS1__regProdAP(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__regProdAP(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__regProdAP *p; + size_t k = sizeof(struct __WS1__regProdAP); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__regProdAP, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__regProdAP); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__regProdAP, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__regProdAP location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__regProdAP(struct soap *soap, const struct __WS1__regProdAP *a, const char *tag, const char *type) +{ + if (soap_out___WS1__regProdAP(soap, tag ? tag : "-WS1:regProdAP", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__regProdAP * SOAP_FMAC4 soap_get___WS1__regProdAP(struct soap *soap, struct __WS1__regProdAP *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__regProdAP(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getProdList(struct soap *soap, struct __WS1__getProdList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getProdList = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getProdList(struct soap *soap, const struct __WS1__getProdList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getProdList(soap, &a->WS1__getProdList); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getProdList(struct soap *soap, const char *tag, int id, const struct __WS1__getProdList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getProdList(soap, "WS1:getProdList", -1, &a->WS1__getProdList, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getProdList * SOAP_FMAC4 soap_in___WS1__getProdList(struct soap *soap, const char *tag, struct __WS1__getProdList *a, const char *type) +{ + size_t soap_flag_WS1__getProdList = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getProdList*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getProdList, sizeof(struct __WS1__getProdList), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getProdList(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getProdList && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getProdList(soap, "WS1:getProdList", &a->WS1__getProdList, "")) + { soap_flag_WS1__getProdList--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getProdList * SOAP_FMAC2 cross_instantiate___WS1__getProdList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getProdList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getProdList *p; + size_t k = sizeof(struct __WS1__getProdList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getProdList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getProdList); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getProdList, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getProdList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getProdList(struct soap *soap, const struct __WS1__getProdList *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getProdList(soap, tag ? tag : "-WS1:getProdList", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getProdList * SOAP_FMAC4 soap_get___WS1__getProdList(struct soap *soap, struct __WS1__getProdList *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getProdList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getParamList(struct soap *soap, struct __WS1__getParamList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getParamList = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getParamList(struct soap *soap, const struct __WS1__getParamList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getParamList(soap, &a->WS1__getParamList); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getParamList(struct soap *soap, const char *tag, int id, const struct __WS1__getParamList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getParamList(soap, "WS1:getParamList", -1, &a->WS1__getParamList, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getParamList * SOAP_FMAC4 soap_in___WS1__getParamList(struct soap *soap, const char *tag, struct __WS1__getParamList *a, const char *type) +{ + size_t soap_flag_WS1__getParamList = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getParamList*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getParamList, sizeof(struct __WS1__getParamList), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getParamList(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getParamList && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getParamList(soap, "WS1:getParamList", &a->WS1__getParamList, "")) + { soap_flag_WS1__getParamList--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getParamList * SOAP_FMAC2 cross_instantiate___WS1__getParamList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getParamList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getParamList *p; + size_t k = sizeof(struct __WS1__getParamList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getParamList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getParamList); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getParamList, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getParamList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getParamList(struct soap *soap, const struct __WS1__getParamList *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getParamList(soap, tag ? tag : "-WS1:getParamList", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getParamList * SOAP_FMAC4 soap_get___WS1__getParamList(struct soap *soap, struct __WS1__getParamList *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getParamList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getEtlJobList(struct soap *soap, struct __WS1__getEtlJobList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__getEtlJobList = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getEtlJobList(struct soap *soap, const struct __WS1__getEtlJobList *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__getEtlJobList(soap, &a->WS1__getEtlJobList); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getEtlJobList(struct soap *soap, const char *tag, int id, const struct __WS1__getEtlJobList *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__getEtlJobList(soap, "WS1:getEtlJobList", -1, &a->WS1__getEtlJobList, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getEtlJobList * SOAP_FMAC4 soap_in___WS1__getEtlJobList(struct soap *soap, const char *tag, struct __WS1__getEtlJobList *a, const char *type) +{ + size_t soap_flag_WS1__getEtlJobList = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__getEtlJobList*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__getEtlJobList, sizeof(struct __WS1__getEtlJobList), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__getEtlJobList(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__getEtlJobList && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__getEtlJobList(soap, "WS1:getEtlJobList", &a->WS1__getEtlJobList, "")) + { soap_flag_WS1__getEtlJobList--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__getEtlJobList * SOAP_FMAC2 cross_instantiate___WS1__getEtlJobList(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__getEtlJobList(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__getEtlJobList *p; + size_t k = sizeof(struct __WS1__getEtlJobList); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__getEtlJobList, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__getEtlJobList); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__getEtlJobList, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__getEtlJobList location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getEtlJobList(struct soap *soap, const struct __WS1__getEtlJobList *a, const char *tag, const char *type) +{ + if (soap_out___WS1__getEtlJobList(soap, tag ? tag : "-WS1:getEtlJobList", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__getEtlJobList * SOAP_FMAC4 soap_get___WS1__getEtlJobList(struct soap *soap, struct __WS1__getEtlJobList *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__getEtlJobList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeEtl(struct soap *soap, struct __WS1__invokeEtl *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ + a->WS1__invokeEtl = NULL; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeEtl(struct soap *soap, const struct __WS1__invokeEtl *a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + soap_serialize_PointerTo_WS1__invokeEtl(soap, &a->WS1__invokeEtl); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeEtl(struct soap *soap, const char *tag, int id, const struct __WS1__invokeEtl *a, const char *type) +{ + (void)soap; (void)tag; (void)id; (void)a; (void)type; /* appease -Wall -Werror */ + if (soap_out_PointerTo_WS1__invokeEtl(soap, "WS1:invokeEtl", -1, &a->WS1__invokeEtl, "")) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeEtl * SOAP_FMAC4 soap_in___WS1__invokeEtl(struct soap *soap, const char *tag, struct __WS1__invokeEtl *a, const char *type) +{ + size_t soap_flag_WS1__invokeEtl = 1; + short soap_flag; + (void)tag; (void)type; /* appease -Wall -Werror */ + a = (struct __WS1__invokeEtl*)soap_id_enter(soap, "", a, SOAP_TYPE___WS1__invokeEtl, sizeof(struct __WS1__invokeEtl), NULL, NULL, NULL, NULL); + if (!a) + return NULL; + soap_default___WS1__invokeEtl(soap, a); + for (soap_flag = 0;; soap_flag = 1) + { soap->error = SOAP_TAG_MISMATCH; + if (soap_flag_WS1__invokeEtl && soap->error == SOAP_TAG_MISMATCH) + { if (soap_in_PointerTo_WS1__invokeEtl(soap, "WS1:invokeEtl", &a->WS1__invokeEtl, "")) + { soap_flag_WS1__invokeEtl--; + continue; + } + } + if (soap->error == SOAP_TAG_MISMATCH && soap_flag) + { soap->error = SOAP_OK; + break; + } + if (soap_flag && soap->error == SOAP_NO_TAG) + break; + if (soap->error) + return NULL; + } + return a; +} + +SOAP_FMAC1 struct __WS1__invokeEtl * SOAP_FMAC2 cross_instantiate___WS1__invokeEtl(struct soap *soap, int n, const char *type, const char *arrayType, size_t *size) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "cross_instantiate___WS1__invokeEtl(%p, %d, %s, %s)\n", (void*)soap, n, type?type:"", arrayType?arrayType:"")); + (void)type; (void)arrayType; /* appease -Wall -Werror */ + struct __WS1__invokeEtl *p; + size_t k = sizeof(struct __WS1__invokeEtl); + struct soap_clist *cp = soap_link(soap, SOAP_TYPE___WS1__invokeEtl, n, cross_fdelete); + if (!cp && soap && n != SOAP_NO_LINK_TO_DELETE) + return NULL; + if (n < 0) + { p = SOAP_NEW(soap, struct __WS1__invokeEtl); + } + else + { p = SOAP_NEW_ARRAY(soap, struct __WS1__invokeEtl, n); + k *= n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Instantiated struct __WS1__invokeEtl location=%p n=%d\n", (void*)p, n)); + if (size) + *size = k; + if (!p) + soap->error = SOAP_EOM; + else if (cp) + cp->ptr = (void*)p; + return p; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeEtl(struct soap *soap, const struct __WS1__invokeEtl *a, const char *tag, const char *type) +{ + if (soap_out___WS1__invokeEtl(soap, tag ? tag : "-WS1:invokeEtl", -2, a, type)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC3 struct __WS1__invokeEtl * SOAP_FMAC4 soap_get___WS1__invokeEtl(struct soap *soap, struct __WS1__invokeEtl *p, const char *tag, const char *type) +{ + if ((p = soap_in___WS1__invokeEtl(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Reason)) + soap_serialize_SOAP_ENV__Reason(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Reason *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Reason, NULL); + if (id < 0) + return soap->error; + return soap_out_SOAP_ENV__Reason(soap, tag, id, *a, type); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap *soap, const char *tag, struct SOAP_ENV__Reason **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Reason **)soap_malloc(soap, sizeof(struct SOAP_ENV__Reason *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Reason(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Reason **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Reason, sizeof(struct SOAP_ENV__Reason), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Reason(soap, tag ? tag : "SOAP-ENV:Reason", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Reason(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Detail)) + soap_serialize_SOAP_ENV__Detail(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Detail *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Detail, NULL); + if (id < 0) + return soap->error; + return soap_out_SOAP_ENV__Detail(soap, tag, id, *a, type); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap *soap, const char *tag, struct SOAP_ENV__Detail **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Detail **)soap_malloc(soap, sizeof(struct SOAP_ENV__Detail *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Detail(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Detail **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Detail, sizeof(struct SOAP_ENV__Detail), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Detail(soap, tag ? tag : "SOAP-ENV:Detail", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Detail(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +#ifndef WITH_NOGLOBAL + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE_SOAP_ENV__Code)) + soap_serialize_SOAP_ENV__Code(soap, *a); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, int id, struct SOAP_ENV__Code *const*a, const char *type) +{ + char *mark; + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE_SOAP_ENV__Code, &mark); + if (id < 0) + return soap->error; + (void)soap_out_SOAP_ENV__Code(soap, tag, id, *a, type); + soap_unmark(soap, mark); + return soap->error; +} + +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap *soap, const char *tag, struct SOAP_ENV__Code **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (struct SOAP_ENV__Code **)soap_malloc(soap, sizeof(struct SOAP_ENV__Code *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = soap_in_SOAP_ENV__Code(soap, tag, *a, type))) + return NULL; + } + else + { a = (struct SOAP_ENV__Code **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE_SOAP_ENV__Code, sizeof(struct SOAP_ENV__Code), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerToSOAP_ENV__Code(soap, tag ? tag : "SOAP-ENV:Code", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerToSOAP_ENV__Code(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__escrowResendSrv)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__escrowResendSrv(struct soap *soap, const char *tag, int id, _WS1__escrowResendSrv *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__escrowResendSrv, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__escrowResendSrv ? type : NULL); +} + +SOAP_FMAC3 _WS1__escrowResendSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__escrowResendSrv(struct soap *soap, const char *tag, _WS1__escrowResendSrv **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__escrowResendSrv **)soap_malloc(soap, sizeof(_WS1__escrowResendSrv *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__escrowResendSrv *)cross_instantiate__WS1__escrowResendSrv(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__escrowResendSrv **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__escrowResendSrv, sizeof(_WS1__escrowResendSrv), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__escrowResendSrv(soap, tag ? tag : "WS1:escrowResendSrv", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__escrowResendSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__escrowResendSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__invokeSrv)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeSrv(struct soap *soap, const char *tag, int id, _WS1__invokeSrv *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__invokeSrv, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__invokeSrv ? type : NULL); +} + +SOAP_FMAC3 _WS1__invokeSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeSrv(struct soap *soap, const char *tag, _WS1__invokeSrv **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__invokeSrv **)soap_malloc(soap, sizeof(_WS1__invokeSrv *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__invokeSrv *)cross_instantiate__WS1__invokeSrv(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__invokeSrv **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__invokeSrv, sizeof(_WS1__invokeSrv), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__invokeSrv(soap, tag ? tag : "WS1:invokeSrv", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__invokeSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__invokeSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__regEAI(struct soap *soap, _WS1__regEAI *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__regEAI)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__regEAI(struct soap *soap, const char *tag, int id, _WS1__regEAI *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__regEAI, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__regEAI ? type : NULL); +} + +SOAP_FMAC3 _WS1__regEAI ** SOAP_FMAC4 soap_in_PointerTo_WS1__regEAI(struct soap *soap, const char *tag, _WS1__regEAI **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__regEAI **)soap_malloc(soap, sizeof(_WS1__regEAI *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__regEAI *)cross_instantiate__WS1__regEAI(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__regEAI **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__regEAI, sizeof(_WS1__regEAI), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__regEAI(struct soap *soap, _WS1__regEAI *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__regEAI(soap, tag ? tag : "WS1:regEAI", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__regEAI ** SOAP_FMAC4 soap_get_PointerTo_WS1__regEAI(struct soap *soap, _WS1__regEAI **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__regEAI(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__regSrv(struct soap *soap, _WS1__regSrv *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__regSrv)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__regSrv(struct soap *soap, const char *tag, int id, _WS1__regSrv *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__regSrv, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__regSrv ? type : NULL); +} + +SOAP_FMAC3 _WS1__regSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__regSrv(struct soap *soap, const char *tag, _WS1__regSrv **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__regSrv **)soap_malloc(soap, sizeof(_WS1__regSrv *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__regSrv *)cross_instantiate__WS1__regSrv(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__regSrv **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__regSrv, sizeof(_WS1__regSrv), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__regSrv(struct soap *soap, _WS1__regSrv *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__regSrv(soap, tag ? tag : "WS1:regSrv", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__regSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__regSrv(struct soap *soap, _WS1__regSrv **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__regSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getStandardDataNameList)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getStandardDataNameList(struct soap *soap, const char *tag, int id, _WS1__getStandardDataNameList *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getStandardDataNameList, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getStandardDataNameList ? type : NULL); +} + +SOAP_FMAC3 _WS1__getStandardDataNameList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getStandardDataNameList(struct soap *soap, const char *tag, _WS1__getStandardDataNameList **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getStandardDataNameList **)soap_malloc(soap, sizeof(_WS1__getStandardDataNameList *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getStandardDataNameList *)cross_instantiate__WS1__getStandardDataNameList(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getStandardDataNameList **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getStandardDataNameList, sizeof(_WS1__getStandardDataNameList), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getStandardDataNameList(soap, tag ? tag : "WS1:getStandardDataNameList", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getStandardDataNameList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getStandardDataNameList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getStandardServiceList)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getStandardServiceList(struct soap *soap, const char *tag, int id, _WS1__getStandardServiceList *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getStandardServiceList, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getStandardServiceList ? type : NULL); +} + +SOAP_FMAC3 _WS1__getStandardServiceList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getStandardServiceList(struct soap *soap, const char *tag, _WS1__getStandardServiceList **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getStandardServiceList **)soap_malloc(soap, sizeof(_WS1__getStandardServiceList *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getStandardServiceList *)cross_instantiate__WS1__getStandardServiceList(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getStandardServiceList **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getStandardServiceList, sizeof(_WS1__getStandardServiceList), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getStandardServiceList(soap, tag ? tag : "WS1:getStandardServiceList", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getStandardServiceList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getStandardServiceList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__fpInvoke)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__fpInvoke(struct soap *soap, const char *tag, int id, _WS1__fpInvoke *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__fpInvoke, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__fpInvoke ? type : NULL); +} + +SOAP_FMAC3 _WS1__fpInvoke ** SOAP_FMAC4 soap_in_PointerTo_WS1__fpInvoke(struct soap *soap, const char *tag, _WS1__fpInvoke **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__fpInvoke **)soap_malloc(soap, sizeof(_WS1__fpInvoke *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__fpInvoke *)cross_instantiate__WS1__fpInvoke(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__fpInvoke **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__fpInvoke, sizeof(_WS1__fpInvoke), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__fpInvoke(soap, tag ? tag : "WS1:fpInvoke", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__fpInvoke ** SOAP_FMAC4 soap_get_PointerTo_WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__fpInvoke(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getSrv(struct soap *soap, _WS1__getSrv *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getSrv)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getSrv(struct soap *soap, const char *tag, int id, _WS1__getSrv *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getSrv, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getSrv ? type : NULL); +} + +SOAP_FMAC3 _WS1__getSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__getSrv(struct soap *soap, const char *tag, _WS1__getSrv **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getSrv **)soap_malloc(soap, sizeof(_WS1__getSrv *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getSrv *)cross_instantiate__WS1__getSrv(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getSrv **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getSrv, sizeof(_WS1__getSrv), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getSrv(struct soap *soap, _WS1__getSrv *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getSrv(soap, tag ? tag : "WS1:getSrv", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__getSrv(struct soap *soap, _WS1__getSrv **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getSrv(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getProd(struct soap *soap, _WS1__getProd *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getProd)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getProd(struct soap *soap, const char *tag, int id, _WS1__getProd *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getProd, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getProd ? type : NULL); +} + +SOAP_FMAC3 _WS1__getProd ** SOAP_FMAC4 soap_in_PointerTo_WS1__getProd(struct soap *soap, const char *tag, _WS1__getProd **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getProd **)soap_malloc(soap, sizeof(_WS1__getProd *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getProd *)cross_instantiate__WS1__getProd(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getProd **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getProd, sizeof(_WS1__getProd), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getProd(struct soap *soap, _WS1__getProd *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getProd(soap, tag ? tag : "WS1:getProd", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getProd ** SOAP_FMAC4 soap_get_PointerTo_WS1__getProd(struct soap *soap, _WS1__getProd **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getProd(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__invokeMdm)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeMdm(struct soap *soap, const char *tag, int id, _WS1__invokeMdm *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__invokeMdm, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__invokeMdm ? type : NULL); +} + +SOAP_FMAC3 _WS1__invokeMdm ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeMdm(struct soap *soap, const char *tag, _WS1__invokeMdm **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__invokeMdm **)soap_malloc(soap, sizeof(_WS1__invokeMdm *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__invokeMdm *)cross_instantiate__WS1__invokeMdm(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__invokeMdm **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__invokeMdm, sizeof(_WS1__invokeMdm), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__invokeMdm(soap, tag ? tag : "WS1:invokeMdm", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__invokeMdm ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__invokeMdm(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__invokeUnion)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeUnion(struct soap *soap, const char *tag, int id, _WS1__invokeUnion *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__invokeUnion, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__invokeUnion ? type : NULL); +} + +SOAP_FMAC3 _WS1__invokeUnion ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeUnion(struct soap *soap, const char *tag, _WS1__invokeUnion **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__invokeUnion **)soap_malloc(soap, sizeof(_WS1__invokeUnion *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__invokeUnion *)cross_instantiate__WS1__invokeUnion(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__invokeUnion **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__invokeUnion, sizeof(_WS1__invokeUnion), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__invokeUnion(soap, tag ? tag : "WS1:invokeUnion", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__invokeUnion ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__invokeUnion(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__regProdAP(struct soap *soap, _WS1__regProdAP *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__regProdAP)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__regProdAP(struct soap *soap, const char *tag, int id, _WS1__regProdAP *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__regProdAP, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__regProdAP ? type : NULL); +} + +SOAP_FMAC3 _WS1__regProdAP ** SOAP_FMAC4 soap_in_PointerTo_WS1__regProdAP(struct soap *soap, const char *tag, _WS1__regProdAP **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__regProdAP **)soap_malloc(soap, sizeof(_WS1__regProdAP *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__regProdAP *)cross_instantiate__WS1__regProdAP(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__regProdAP **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__regProdAP, sizeof(_WS1__regProdAP), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__regProdAP(struct soap *soap, _WS1__regProdAP *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__regProdAP(soap, tag ? tag : "WS1:regProdAP", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__regProdAP ** SOAP_FMAC4 soap_get_PointerTo_WS1__regProdAP(struct soap *soap, _WS1__regProdAP **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__regProdAP(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getProdList(struct soap *soap, _WS1__getProdList *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getProdList)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getProdList(struct soap *soap, const char *tag, int id, _WS1__getProdList *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getProdList, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getProdList ? type : NULL); +} + +SOAP_FMAC3 _WS1__getProdList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getProdList(struct soap *soap, const char *tag, _WS1__getProdList **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getProdList **)soap_malloc(soap, sizeof(_WS1__getProdList *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getProdList *)cross_instantiate__WS1__getProdList(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getProdList **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getProdList, sizeof(_WS1__getProdList), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getProdList(struct soap *soap, _WS1__getProdList *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getProdList(soap, tag ? tag : "WS1:getProdList", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getProdList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getProdList(struct soap *soap, _WS1__getProdList **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getProdList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getParamList(struct soap *soap, _WS1__getParamList *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getParamList)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getParamList(struct soap *soap, const char *tag, int id, _WS1__getParamList *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getParamList, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getParamList ? type : NULL); +} + +SOAP_FMAC3 _WS1__getParamList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getParamList(struct soap *soap, const char *tag, _WS1__getParamList **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getParamList **)soap_malloc(soap, sizeof(_WS1__getParamList *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getParamList *)cross_instantiate__WS1__getParamList(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getParamList **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getParamList, sizeof(_WS1__getParamList), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getParamList(struct soap *soap, _WS1__getParamList *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getParamList(soap, tag ? tag : "WS1:getParamList", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getParamList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getParamList(struct soap *soap, _WS1__getParamList **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getParamList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__getEtlJobList)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getEtlJobList(struct soap *soap, const char *tag, int id, _WS1__getEtlJobList *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__getEtlJobList, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__getEtlJobList ? type : NULL); +} + +SOAP_FMAC3 _WS1__getEtlJobList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getEtlJobList(struct soap *soap, const char *tag, _WS1__getEtlJobList **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__getEtlJobList **)soap_malloc(soap, sizeof(_WS1__getEtlJobList *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__getEtlJobList *)cross_instantiate__WS1__getEtlJobList(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__getEtlJobList **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__getEtlJobList, sizeof(_WS1__getEtlJobList), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__getEtlJobList(soap, tag ? tag : "WS1:getEtlJobList", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__getEtlJobList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__getEtlJobList(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + if (!soap_reference(soap, *a, SOAP_TYPE__WS1__invokeEtl)) + (*a)->soap_serialize(soap); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeEtl(struct soap *soap, const char *tag, int id, _WS1__invokeEtl *const*a, const char *type) +{ + id = soap_element_id(soap, tag, id, *a, NULL, 0, type, SOAP_TYPE__WS1__invokeEtl, NULL); + if (id < 0) + return soap->error; + return (*a)->soap_out(soap, tag, id, (*a)->soap_type() == SOAP_TYPE__WS1__invokeEtl ? type : NULL); +} + +SOAP_FMAC3 _WS1__invokeEtl ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeEtl(struct soap *soap, const char *tag, _WS1__invokeEtl **a, const char *type) +{ + (void)type; /* appease -Wall -Werror */ + if (soap_element_begin_in(soap, tag, 1, NULL)) + return NULL; + if (!a) + if (!(a = (_WS1__invokeEtl **)soap_malloc(soap, sizeof(_WS1__invokeEtl *)))) + return NULL; + *a = NULL; + if (!soap->null && *soap->href != '#') + { soap_revert(soap); + if (!(*a = (_WS1__invokeEtl *)cross_instantiate__WS1__invokeEtl(soap, -1, soap->type, soap->arrayType, NULL))) + return NULL; + (*a)->soap_default(soap); + if (!(*a)->soap_in(soap, tag, NULL)) + { *a = NULL; + return NULL; + } + } + else + { a = (_WS1__invokeEtl **)soap_id_lookup(soap, soap->href, (void**)a, SOAP_TYPE__WS1__invokeEtl, sizeof(_WS1__invokeEtl), 0, cross_fbase); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl *const*a, const char *tag, const char *type) +{ + if (soap_out_PointerTo_WS1__invokeEtl(soap, tag ? tag : "WS1:invokeEtl", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 _WS1__invokeEtl ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl **p, const char *tag, const char *type) +{ + if ((p = soap_in_PointerTo_WS1__invokeEtl(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap *soap, char *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + (void)soap_reference(soap, *a, SOAP_TYPE__QName); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap *soap, const char *tag, int id, char *const*a, const char *type) +{ + return soap_outstring(soap, tag, id, a, type, SOAP_TYPE__QName); +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap *soap, const char *tag, char **a, const char *type) +{ + a = soap_instring(soap, tag, a, type, SOAP_TYPE__QName, 2, 0, -1, NULL); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap *soap, char *const*a, const char *tag, const char *type) +{ + if (soap_out__QName(soap, tag ? tag : "QName", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap *soap, char **p, const char *tag, const char *type) +{ + if ((p = soap_in__QName(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap *soap, char *const*a) +{ + (void)soap; (void)a; /* appease -Wall -Werror */ +#ifndef WITH_NOIDREF + (void)soap_reference(soap, *a, SOAP_TYPE_string); +#endif +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap *soap, const char *tag, int id, char *const*a, const char *type) +{ + return soap_outstring(soap, tag, id, a, type, SOAP_TYPE_string); +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap *soap, const char *tag, char **a, const char *type) +{ + a = soap_instring(soap, tag, a, type, SOAP_TYPE_string, 1, 0, -1, NULL); + return a; +} + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_new_string(struct soap *soap, int n) +{ + char * *a = static_cast(soap_malloc(soap, (n = (n < 0 ? 1 : n)) * sizeof(char *))); + for (char * *p = a; p && n--; ++p) + soap_default_string(soap, p); + return a; +} + +SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap *soap, char *const*a, const char *tag, const char *type) +{ + if (soap_out_string(soap, tag ? tag : "string", -2, a, type)) + return soap->error; + return soap_putindependent(soap); +} + +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap *soap, char **p, const char *tag, const char *type) +{ + if ((p = soap_in_string(soap, tag, p, type))) + if (soap_getindependent(soap)) + return NULL; + return p; +} + +#if defined(__BORLANDC__) +#pragma option pop +#pragma option pop +#endif + +/* End of crossC.cpp */ diff --git a/connor_erp_mes/crossClient.cpp b/connor_erp_mes/crossClient.cpp new file mode 100644 index 0000000..3e8de6c --- /dev/null +++ b/connor_erp_mes/crossClient.cpp @@ -0,0 +1,988 @@ +/* crossClient.cpp + Generated by gSOAP 2.8.91 for cross.h + +gSOAP XML Web services tools +Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#if defined(__BORLANDC__) +#pragma option push -w-8060 +#pragma option push -w-8004 +#endif +#include "crossH.h" + +SOAP_SOURCE_STAMP("@(#) crossClient.cpp ver 2.8.91 2021-05-24 02:42:29 GMT") + + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeEtl(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeEtl *WS1__invokeEtl, _WS1__invokeEtlResponse &WS1__invokeEtlResponse) +{ if (soap_send___WS1__invokeEtl(soap, soap_endpoint, soap_action, WS1__invokeEtl) || soap_recv___WS1__invokeEtl(soap, WS1__invokeEtlResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeEtl(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeEtl *WS1__invokeEtl) +{ struct __WS1__invokeEtl soap_tmp___WS1__invokeEtl; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__invokeEtl.WS1__invokeEtl = WS1__invokeEtl; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__invokeEtl(soap, &soap_tmp___WS1__invokeEtl); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeEtl(soap, &soap_tmp___WS1__invokeEtl, "-WS1:invokeEtl", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeEtl(soap, &soap_tmp___WS1__invokeEtl, "-WS1:invokeEtl", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeEtl(struct soap *soap, _WS1__invokeEtlResponse &WS1__invokeEtlResponse) +{ + WS1__invokeEtlResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__invokeEtlResponse.soap_get(soap, "WS1:invokeEtlResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getEtlJobList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getEtlJobList *WS1__getEtlJobList, _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse) +{ if (soap_send___WS1__getEtlJobList(soap, soap_endpoint, soap_action, WS1__getEtlJobList) || soap_recv___WS1__getEtlJobList(soap, WS1__getEtlJobListResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getEtlJobList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getEtlJobList *WS1__getEtlJobList) +{ struct __WS1__getEtlJobList soap_tmp___WS1__getEtlJobList; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getEtlJobList.WS1__getEtlJobList = WS1__getEtlJobList; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getEtlJobList(soap, &soap_tmp___WS1__getEtlJobList); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getEtlJobList(soap, &soap_tmp___WS1__getEtlJobList, "-WS1:getEtlJobList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getEtlJobList(soap, &soap_tmp___WS1__getEtlJobList, "-WS1:getEtlJobList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse) +{ + WS1__getEtlJobListResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getEtlJobListResponse.soap_get(soap, "WS1:getEtlJobListResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getParamList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getParamList *WS1__getParamList, _WS1__getParamListResponse &WS1__getParamListResponse) +{ if (soap_send___WS1__getParamList(soap, soap_endpoint, soap_action, WS1__getParamList) || soap_recv___WS1__getParamList(soap, WS1__getParamListResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getParamList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getParamList *WS1__getParamList) +{ struct __WS1__getParamList soap_tmp___WS1__getParamList; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getParamList.WS1__getParamList = WS1__getParamList; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getParamList(soap, &soap_tmp___WS1__getParamList); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getParamList(soap, &soap_tmp___WS1__getParamList, "-WS1:getParamList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getParamList(soap, &soap_tmp___WS1__getParamList, "-WS1:getParamList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getParamList(struct soap *soap, _WS1__getParamListResponse &WS1__getParamListResponse) +{ + WS1__getParamListResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getParamListResponse.soap_get(soap, "WS1:getParamListResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getProdList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProdList *WS1__getProdList, _WS1__getProdListResponse &WS1__getProdListResponse) +{ if (soap_send___WS1__getProdList(soap, soap_endpoint, soap_action, WS1__getProdList) || soap_recv___WS1__getProdList(soap, WS1__getProdListResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getProdList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProdList *WS1__getProdList) +{ struct __WS1__getProdList soap_tmp___WS1__getProdList; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getProdList.WS1__getProdList = WS1__getProdList; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getProdList(soap, &soap_tmp___WS1__getProdList); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getProdList(soap, &soap_tmp___WS1__getProdList, "-WS1:getProdList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getProdList(soap, &soap_tmp___WS1__getProdList, "-WS1:getProdList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getProdList(struct soap *soap, _WS1__getProdListResponse &WS1__getProdListResponse) +{ + WS1__getProdListResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getProdListResponse.soap_get(soap, "WS1:getProdListResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__regProdAP(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regProdAP *WS1__regProdAP, _WS1__regProdAPResponse &WS1__regProdAPResponse) +{ if (soap_send___WS1__regProdAP(soap, soap_endpoint, soap_action, WS1__regProdAP) || soap_recv___WS1__regProdAP(soap, WS1__regProdAPResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__regProdAP(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regProdAP *WS1__regProdAP) +{ struct __WS1__regProdAP soap_tmp___WS1__regProdAP; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__regProdAP.WS1__regProdAP = WS1__regProdAP; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__regProdAP(soap, &soap_tmp___WS1__regProdAP); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__regProdAP(soap, &soap_tmp___WS1__regProdAP, "-WS1:regProdAP", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__regProdAP(soap, &soap_tmp___WS1__regProdAP, "-WS1:regProdAP", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__regProdAP(struct soap *soap, _WS1__regProdAPResponse &WS1__regProdAPResponse) +{ + WS1__regProdAPResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__regProdAPResponse.soap_get(soap, "WS1:regProdAPResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeUnion(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeUnion *WS1__invokeUnion, _WS1__invokeUnionResponse &WS1__invokeUnionResponse) +{ if (soap_send___WS1__invokeUnion(soap, soap_endpoint, soap_action, WS1__invokeUnion) || soap_recv___WS1__invokeUnion(soap, WS1__invokeUnionResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeUnion(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeUnion *WS1__invokeUnion) +{ struct __WS1__invokeUnion soap_tmp___WS1__invokeUnion; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__invokeUnion.WS1__invokeUnion = WS1__invokeUnion; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__invokeUnion(soap, &soap_tmp___WS1__invokeUnion); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeUnion(soap, &soap_tmp___WS1__invokeUnion, "-WS1:invokeUnion", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeUnion(soap, &soap_tmp___WS1__invokeUnion, "-WS1:invokeUnion", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeUnion(struct soap *soap, _WS1__invokeUnionResponse &WS1__invokeUnionResponse) +{ + WS1__invokeUnionResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__invokeUnionResponse.soap_get(soap, "WS1:invokeUnionResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeMdm(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeMdm *WS1__invokeMdm, _WS1__invokeMdmResponse &WS1__invokeMdmResponse) +{ if (soap_send___WS1__invokeMdm(soap, soap_endpoint, soap_action, WS1__invokeMdm) || soap_recv___WS1__invokeMdm(soap, WS1__invokeMdmResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeMdm(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeMdm *WS1__invokeMdm) +{ struct __WS1__invokeMdm soap_tmp___WS1__invokeMdm; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__invokeMdm.WS1__invokeMdm = WS1__invokeMdm; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__invokeMdm(soap, &soap_tmp___WS1__invokeMdm); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeMdm(soap, &soap_tmp___WS1__invokeMdm, "-WS1:invokeMdm", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeMdm(soap, &soap_tmp___WS1__invokeMdm, "-WS1:invokeMdm", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeMdm(struct soap *soap, _WS1__invokeMdmResponse &WS1__invokeMdmResponse) +{ + WS1__invokeMdmResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__invokeMdmResponse.soap_get(soap, "WS1:invokeMdmResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getProd(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProd *WS1__getProd, _WS1__getProdResponse &WS1__getProdResponse) +{ if (soap_send___WS1__getProd(soap, soap_endpoint, soap_action, WS1__getProd) || soap_recv___WS1__getProd(soap, WS1__getProdResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getProd(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProd *WS1__getProd) +{ struct __WS1__getProd soap_tmp___WS1__getProd; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getProd.WS1__getProd = WS1__getProd; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getProd(soap, &soap_tmp___WS1__getProd); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getProd(soap, &soap_tmp___WS1__getProd, "-WS1:getProd", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getProd(soap, &soap_tmp___WS1__getProd, "-WS1:getProd", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getProd(struct soap *soap, _WS1__getProdResponse &WS1__getProdResponse) +{ + WS1__getProdResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getProdResponse.soap_get(soap, "WS1:getProdResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getSrv *WS1__getSrv, _WS1__getSrvResponse &WS1__getSrvResponse) +{ if (soap_send___WS1__getSrv(soap, soap_endpoint, soap_action, WS1__getSrv) || soap_recv___WS1__getSrv(soap, WS1__getSrvResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getSrv *WS1__getSrv) +{ struct __WS1__getSrv soap_tmp___WS1__getSrv; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getSrv.WS1__getSrv = WS1__getSrv; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getSrv(soap, &soap_tmp___WS1__getSrv); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getSrv(soap, &soap_tmp___WS1__getSrv, "-WS1:getSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getSrv(soap, &soap_tmp___WS1__getSrv, "-WS1:getSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getSrv(struct soap *soap, _WS1__getSrvResponse &WS1__getSrvResponse) +{ + WS1__getSrvResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getSrvResponse.soap_get(soap, "WS1:getSrvResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__fpInvoke(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__fpInvoke *WS1__fpInvoke, _WS1__fpInvokeResponse &WS1__fpInvokeResponse) +{ if (soap_send___WS1__fpInvoke(soap, soap_endpoint, soap_action, WS1__fpInvoke) || soap_recv___WS1__fpInvoke(soap, WS1__fpInvokeResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__fpInvoke(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__fpInvoke *WS1__fpInvoke) +{ struct __WS1__fpInvoke soap_tmp___WS1__fpInvoke; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__fpInvoke.WS1__fpInvoke = WS1__fpInvoke; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__fpInvoke(soap, &soap_tmp___WS1__fpInvoke); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__fpInvoke(soap, &soap_tmp___WS1__fpInvoke, "-WS1:fpInvoke", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__fpInvoke(soap, &soap_tmp___WS1__fpInvoke, "-WS1:fpInvoke", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__fpInvoke(struct soap *soap, _WS1__fpInvokeResponse &WS1__fpInvokeResponse) +{ + WS1__fpInvokeResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__fpInvokeResponse.soap_get(soap, "WS1:fpInvokeResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getStandardServiceList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardServiceList *WS1__getStandardServiceList, _WS1__getStandardServiceListResponse &WS1__getStandardServiceListResponse) +{ if (soap_send___WS1__getStandardServiceList(soap, soap_endpoint, soap_action, WS1__getStandardServiceList) || soap_recv___WS1__getStandardServiceList(soap, WS1__getStandardServiceListResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getStandardServiceList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardServiceList *WS1__getStandardServiceList) +{ struct __WS1__getStandardServiceList soap_tmp___WS1__getStandardServiceList; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getStandardServiceList.WS1__getStandardServiceList = WS1__getStandardServiceList; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getStandardServiceList(soap, &soap_tmp___WS1__getStandardServiceList); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getStandardServiceList(soap, &soap_tmp___WS1__getStandardServiceList, "-WS1:getStandardServiceList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getStandardServiceList(soap, &soap_tmp___WS1__getStandardServiceList, "-WS1:getStandardServiceList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceListResponse &WS1__getStandardServiceListResponse) +{ + WS1__getStandardServiceListResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getStandardServiceListResponse.soap_get(soap, "WS1:getStandardServiceListResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getStandardDataNameList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardDataNameList *WS1__getStandardDataNameList, _WS1__getStandardDataNameListResponse &WS1__getStandardDataNameListResponse) +{ if (soap_send___WS1__getStandardDataNameList(soap, soap_endpoint, soap_action, WS1__getStandardDataNameList) || soap_recv___WS1__getStandardDataNameList(soap, WS1__getStandardDataNameListResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getStandardDataNameList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardDataNameList *WS1__getStandardDataNameList) +{ struct __WS1__getStandardDataNameList soap_tmp___WS1__getStandardDataNameList; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__getStandardDataNameList.WS1__getStandardDataNameList = WS1__getStandardDataNameList; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__getStandardDataNameList(soap, &soap_tmp___WS1__getStandardDataNameList); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getStandardDataNameList(soap, &soap_tmp___WS1__getStandardDataNameList, "-WS1:getStandardDataNameList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__getStandardDataNameList(soap, &soap_tmp___WS1__getStandardDataNameList, "-WS1:getStandardDataNameList", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameListResponse &WS1__getStandardDataNameListResponse) +{ + WS1__getStandardDataNameListResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__getStandardDataNameListResponse.soap_get(soap, "WS1:getStandardDataNameListResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__regSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regSrv *WS1__regSrv, _WS1__regSrvResponse &WS1__regSrvResponse) +{ if (soap_send___WS1__regSrv(soap, soap_endpoint, soap_action, WS1__regSrv) || soap_recv___WS1__regSrv(soap, WS1__regSrvResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__regSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regSrv *WS1__regSrv) +{ struct __WS1__regSrv soap_tmp___WS1__regSrv; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__regSrv.WS1__regSrv = WS1__regSrv; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__regSrv(soap, &soap_tmp___WS1__regSrv); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__regSrv(soap, &soap_tmp___WS1__regSrv, "-WS1:regSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__regSrv(soap, &soap_tmp___WS1__regSrv, "-WS1:regSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__regSrv(struct soap *soap, _WS1__regSrvResponse &WS1__regSrvResponse) +{ + WS1__regSrvResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__regSrvResponse.soap_get(soap, "WS1:regSrvResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__regEAI(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regEAI *WS1__regEAI, _WS1__regEAIResponse &WS1__regEAIResponse) +{ if (soap_send___WS1__regEAI(soap, soap_endpoint, soap_action, WS1__regEAI) || soap_recv___WS1__regEAI(soap, WS1__regEAIResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__regEAI(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regEAI *WS1__regEAI) +{ struct __WS1__regEAI soap_tmp___WS1__regEAI; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__regEAI.WS1__regEAI = WS1__regEAI; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__regEAI(soap, &soap_tmp___WS1__regEAI); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__regEAI(soap, &soap_tmp___WS1__regEAI, "-WS1:regEAI", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__regEAI(soap, &soap_tmp___WS1__regEAI, "-WS1:regEAI", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__regEAI(struct soap *soap, _WS1__regEAIResponse &WS1__regEAIResponse) +{ + WS1__regEAIResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__regEAIResponse.soap_get(soap, "WS1:regEAIResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeSrv *WS1__invokeSrv, _WS1__invokeSrvResponse &WS1__invokeSrvResponse) +{ if (soap_send___WS1__invokeSrv(soap, soap_endpoint, soap_action, WS1__invokeSrv) || soap_recv___WS1__invokeSrv(soap, WS1__invokeSrvResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeSrv *WS1__invokeSrv) +{ struct __WS1__invokeSrv soap_tmp___WS1__invokeSrv; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__invokeSrv.WS1__invokeSrv = WS1__invokeSrv; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__invokeSrv(soap, &soap_tmp___WS1__invokeSrv); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeSrv(soap, &soap_tmp___WS1__invokeSrv, "-WS1:invokeSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__invokeSrv(soap, &soap_tmp___WS1__invokeSrv, "-WS1:invokeSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeSrv(struct soap *soap, _WS1__invokeSrvResponse &WS1__invokeSrvResponse) +{ + WS1__invokeSrvResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__invokeSrvResponse.soap_get(soap, "WS1:invokeSrvResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__escrowResendSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__escrowResendSrv *WS1__escrowResendSrv, _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse) +{ if (soap_send___WS1__escrowResendSrv(soap, soap_endpoint, soap_action, WS1__escrowResendSrv) || soap_recv___WS1__escrowResendSrv(soap, WS1__escrowResendSrvResponse)) + return soap->error; + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__escrowResendSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__escrowResendSrv *WS1__escrowResendSrv) +{ struct __WS1__escrowResendSrv soap_tmp___WS1__escrowResendSrv; + if (soap_endpoint == NULL) + soap_endpoint = "http://192.168.8.115:9999/IntegrationEntry"; + if (soap_action == NULL) + soap_action = ""; + soap_tmp___WS1__escrowResendSrv.WS1__escrowResendSrv = WS1__escrowResendSrv; + soap_begin(soap); + soap->encodingStyle = NULL; /* use SOAP literal style */ + soap_serializeheader(soap); + soap_serialize___WS1__escrowResendSrv(soap, &soap_tmp___WS1__escrowResendSrv); + if (soap_begin_count(soap)) + return soap->error; + if ((soap->mode & SOAP_IO_LENGTH)) + { if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__escrowResendSrv(soap, &soap_tmp___WS1__escrowResendSrv, "-WS1:escrowResendSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap->error; + } + if (soap_end_count(soap)) + return soap->error; + if (soap_connect(soap, soap_endpoint, soap_action) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_put___WS1__escrowResendSrv(soap, &soap_tmp___WS1__escrowResendSrv, "-WS1:escrowResendSrv", "") + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse) +{ + WS1__escrowResendSrvResponse.soap_default(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + return soap_closesock(soap); + WS1__escrowResendSrvResponse.soap_get(soap, "WS1:escrowResendSrvResponse", NULL); + if (soap->error) + return soap_recv_fault(soap, 0); + if (soap_body_end_in(soap) + || soap_envelope_end_in(soap) + || soap_end_recv(soap)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +#if defined(__BORLANDC__) +#pragma option pop +#pragma option pop +#endif + +/* End of crossClient.cpp */ diff --git a/connor_erp_mes/crossH.h b/connor_erp_mes/crossH.h new file mode 100644 index 0000000..fe37083 --- /dev/null +++ b/connor_erp_mes/crossH.h @@ -0,0 +1,5647 @@ +/* crossH.h + Generated by gSOAP 2.8.91 for cross.h + +gSOAP XML Web services tools +Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#ifndef crossH_H +#define crossH_H +#include "crossStub.h" +#ifndef WITH_NOIDREF + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void SOAP_FMAC4 soap_markelement(struct soap*, const void*, int); + +#ifdef __cplusplus +} +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_putindependent(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getindependent(struct soap*); +#endif + +#ifdef __cplusplus +extern "C" { +#endif +SOAP_FMAC3 void * SOAP_FMAC4 soap_getelement(struct soap*, const char*, int*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putelement(struct soap*, const void*, const char*, int, int); +SOAP_FMAC3 void * SOAP_FMAC4 soap_dupelement(struct soap*, const void*, int); +SOAP_FMAC3 void SOAP_FMAC4 soap_delelement(const void*, int); + +#ifdef __cplusplus +} +#endif +SOAP_FMAC3 int SOAP_FMAC4 soap_ignore_element(struct soap*); +SOAP_FMAC3 void * SOAP_FMAC4 cross_instantiate(struct soap*, int, const char*, const char*, size_t*); +SOAP_FMAC3 int SOAP_FMAC4 cross_fdelete(struct soap *soap, struct soap_clist*); +SOAP_FMAC3 int SOAP_FMAC4 cross_fbase(int, int); +SOAP_FMAC3 void SOAP_FMAC4 cross_finsert(struct soap*, int, int, void*, size_t, const void*, void**); + +#ifndef SOAP_TYPE_byte_DEFINED +#define SOAP_TYPE_byte_DEFINED + +inline void soap_default_byte(struct soap *soap, char *a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_byte + *a = SOAP_DEFAULT_byte; +#else + *a = (char)0; +#endif +} +SOAP_FMAC3 int SOAP_FMAC4 soap_out_byte(struct soap*, const char*, int, const char *, const char*); +SOAP_FMAC3 char * SOAP_FMAC4 soap_in_byte(struct soap*, const char*, char *, const char*); + +SOAP_FMAC3 char * SOAP_FMAC4 soap_new_byte(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_byte(struct soap*, const char *, const char*, const char*); + +inline int soap_write_byte(struct soap *soap, char const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_byte(struct soap *soap, const char *URL, char const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_byte(soap, p, "byte", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char * SOAP_FMAC4 soap_get_byte(struct soap*, char *, const char*, const char*); + +inline int soap_read_byte(struct soap *soap, char *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_byte(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_byte(struct soap *soap, const char *URL, char *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_byte(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_byte(struct soap *soap, char *p) +{ + if (::soap_read_byte(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_int_DEFINED +#define SOAP_TYPE_int_DEFINED + +inline void soap_default_int(struct soap *soap, int *a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_int + *a = SOAP_DEFAULT_int; +#else + *a = (int)0; +#endif +} +SOAP_FMAC3 int SOAP_FMAC4 soap_out_int(struct soap*, const char*, int, const int *, const char*); +SOAP_FMAC3 int * SOAP_FMAC4 soap_in_int(struct soap*, const char*, int *, const char*); + +SOAP_FMAC3 int * SOAP_FMAC4 soap_new_int(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_int(struct soap*, const int *, const char*, const char*); + +inline int soap_write_int(struct soap *soap, int const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_int(struct soap *soap, const char *URL, int const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_int(soap, p, "int", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 int * SOAP_FMAC4 soap_get_int(struct soap*, int *, const char*, const char*); + +inline int soap_read_int(struct soap *soap, int *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_int(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_int(struct soap *soap, const char *URL, int *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_int(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_int(struct soap *soap, int *p) +{ + if (::soap_read_int(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE_std__string_DEFINED +#define SOAP_TYPE_std__string_DEFINED + +inline void soap_default_std__string(struct soap *soap, std::string *p) +{ + (void)soap; /* appease -Wall -Werror */ + p->erase(); +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_std__string(struct soap*, const std::string *); + +#define soap_std__string2s(soap, a) ((a).c_str()) +SOAP_FMAC3 int SOAP_FMAC4 soap_out_std__string(struct soap*, const char*, int, const std::string*, const char*); + +#define soap_s2std__string(soap, s, a) soap_s2stdchar((soap), (s), (a), 1, 0, -1, NULL) +SOAP_FMAC3 std::string * SOAP_FMAC4 soap_in_std__string(struct soap*, const char*, std::string*, const char*); +SOAP_FMAC1 std::string * SOAP_FMAC2 cross_instantiate_std__string(struct soap*, int, const char*, const char*, size_t*); + +inline std::string * soap_new_std__string(struct soap *soap, int n = -1) +{ + return cross_instantiate_std__string(soap, n, NULL, NULL, NULL); +} + +inline std::string * soap_new_req_std__string( + struct soap *soap) +{ + std::string *_p = ::soap_new_std__string(soap); + if (_p) + { ::soap_default_std__string(soap, _p); + } + return _p; +} + +inline std::string * soap_new_set_std__string( + struct soap *soap) +{ + std::string *_p = ::soap_new_std__string(soap); + if (_p) + { ::soap_default_std__string(soap, _p); + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_std__string(struct soap*, const std::string *, const char*, const char*); + +inline int soap_write_std__string(struct soap *soap, std::string const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_std__string(soap, p, "string", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_std__string(struct soap *soap, const char *URL, std::string const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_std__string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_std__string(struct soap *soap, const char *URL, std::string const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_std__string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_std__string(struct soap *soap, const char *URL, std::string const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_std__string(soap, p, "string", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 std::string * SOAP_FMAC4 soap_get_std__string(struct soap*, std::string *, const char*, const char*); + +inline int soap_read_std__string(struct soap *soap, std::string *p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_std__string(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_std__string(struct soap *soap, const char *URL, std::string *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_std__string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_std__string(struct soap *soap, std::string *p) +{ + if (::soap_read_std__string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__escrowResendSrvResponse_DEFINED +#define SOAP_TYPE__WS1__escrowResendSrvResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__escrowResendSrvResponse(struct soap*, const char*, int, const _WS1__escrowResendSrvResponse *, const char*); +SOAP_FMAC3 _WS1__escrowResendSrvResponse * SOAP_FMAC4 soap_in__WS1__escrowResendSrvResponse(struct soap*, const char*, _WS1__escrowResendSrvResponse *, const char*); +SOAP_FMAC1 _WS1__escrowResendSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__escrowResendSrvResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__escrowResendSrvResponse * soap_new__WS1__escrowResendSrvResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__escrowResendSrvResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__escrowResendSrvResponse * soap_new_req__WS1__escrowResendSrvResponse( + struct soap *soap, + const std::string& escrowResendSrvReturn) +{ + _WS1__escrowResendSrvResponse *_p = ::soap_new__WS1__escrowResendSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__escrowResendSrvResponse::escrowResendSrvReturn = escrowResendSrvReturn; + } + return _p; +} + +inline _WS1__escrowResendSrvResponse * soap_new_set__WS1__escrowResendSrvResponse( + struct soap *soap, + const std::string& escrowResendSrvReturn) +{ + _WS1__escrowResendSrvResponse *_p = ::soap_new__WS1__escrowResendSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__escrowResendSrvResponse::escrowResendSrvReturn = escrowResendSrvReturn; + } + return _p; +} + +inline int soap_write__WS1__escrowResendSrvResponse(struct soap *soap, _WS1__escrowResendSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrvResponse", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__escrowResendSrvResponse(struct soap *soap, const char *URL, _WS1__escrowResendSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrvResponse", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__escrowResendSrvResponse(struct soap *soap, const char *URL, _WS1__escrowResendSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrvResponse", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__escrowResendSrvResponse(struct soap *soap, const char *URL, _WS1__escrowResendSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrvResponse", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__escrowResendSrvResponse * SOAP_FMAC4 soap_get__WS1__escrowResendSrvResponse(struct soap*, _WS1__escrowResendSrvResponse *, const char*, const char*); + +inline int soap_read__WS1__escrowResendSrvResponse(struct soap *soap, _WS1__escrowResendSrvResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__escrowResendSrvResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__escrowResendSrvResponse(struct soap *soap, const char *URL, _WS1__escrowResendSrvResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__escrowResendSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__escrowResendSrvResponse(struct soap *soap, _WS1__escrowResendSrvResponse *p) +{ + if (::soap_read__WS1__escrowResendSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__escrowResendSrv_DEFINED +#define SOAP_TYPE__WS1__escrowResendSrv_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__escrowResendSrv(struct soap*, const char*, int, const _WS1__escrowResendSrv *, const char*); +SOAP_FMAC3 _WS1__escrowResendSrv * SOAP_FMAC4 soap_in__WS1__escrowResendSrv(struct soap*, const char*, _WS1__escrowResendSrv *, const char*); +SOAP_FMAC1 _WS1__escrowResendSrv * SOAP_FMAC2 cross_instantiate__WS1__escrowResendSrv(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__escrowResendSrv * soap_new__WS1__escrowResendSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__escrowResendSrv(soap, n, NULL, NULL, NULL); +} + +inline _WS1__escrowResendSrv * soap_new_req__WS1__escrowResendSrv( + struct soap *soap, + const std::string& in0, + const std::string& in1) +{ + _WS1__escrowResendSrv *_p = ::soap_new__WS1__escrowResendSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__escrowResendSrv::in0 = in0; + _p->_WS1__escrowResendSrv::in1 = in1; + } + return _p; +} + +inline _WS1__escrowResendSrv * soap_new_set__WS1__escrowResendSrv( + struct soap *soap, + const std::string& in0, + const std::string& in1) +{ + _WS1__escrowResendSrv *_p = ::soap_new__WS1__escrowResendSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__escrowResendSrv::in0 = in0; + _p->_WS1__escrowResendSrv::in1 = in1; + } + return _p; +} + +inline int soap_write__WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrv", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrv ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__escrowResendSrv(struct soap *soap, const char *URL, _WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrv", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__escrowResendSrv(struct soap *soap, const char *URL, _WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrv", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__escrowResendSrv(struct soap *soap, const char *URL, _WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:escrowResendSrv", p->soap_type() == SOAP_TYPE__WS1__escrowResendSrv ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__escrowResendSrv * SOAP_FMAC4 soap_get__WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv *, const char*, const char*); + +inline int soap_read__WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__escrowResendSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__escrowResendSrv(struct soap *soap, const char *URL, _WS1__escrowResendSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__escrowResendSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrv *p) +{ + if (::soap_read__WS1__escrowResendSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeSrvResponse_DEFINED +#define SOAP_TYPE__WS1__invokeSrvResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeSrvResponse(struct soap*, const char*, int, const _WS1__invokeSrvResponse *, const char*); +SOAP_FMAC3 _WS1__invokeSrvResponse * SOAP_FMAC4 soap_in__WS1__invokeSrvResponse(struct soap*, const char*, _WS1__invokeSrvResponse *, const char*); +SOAP_FMAC1 _WS1__invokeSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeSrvResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeSrvResponse * soap_new__WS1__invokeSrvResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeSrvResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeSrvResponse * soap_new_req__WS1__invokeSrvResponse( + struct soap *soap, + const std::string& invokeSrvReturn) +{ + _WS1__invokeSrvResponse *_p = ::soap_new__WS1__invokeSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeSrvResponse::invokeSrvReturn = invokeSrvReturn; + } + return _p; +} + +inline _WS1__invokeSrvResponse * soap_new_set__WS1__invokeSrvResponse( + struct soap *soap, + const std::string& invokeSrvReturn) +{ + _WS1__invokeSrvResponse *_p = ::soap_new__WS1__invokeSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeSrvResponse::invokeSrvReturn = invokeSrvReturn; + } + return _p; +} + +inline int soap_write__WS1__invokeSrvResponse(struct soap *soap, _WS1__invokeSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrvResponse", p->soap_type() == SOAP_TYPE__WS1__invokeSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeSrvResponse(struct soap *soap, const char *URL, _WS1__invokeSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrvResponse", p->soap_type() == SOAP_TYPE__WS1__invokeSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeSrvResponse(struct soap *soap, const char *URL, _WS1__invokeSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrvResponse", p->soap_type() == SOAP_TYPE__WS1__invokeSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeSrvResponse(struct soap *soap, const char *URL, _WS1__invokeSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrvResponse", p->soap_type() == SOAP_TYPE__WS1__invokeSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeSrvResponse * SOAP_FMAC4 soap_get__WS1__invokeSrvResponse(struct soap*, _WS1__invokeSrvResponse *, const char*, const char*); + +inline int soap_read__WS1__invokeSrvResponse(struct soap *soap, _WS1__invokeSrvResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeSrvResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeSrvResponse(struct soap *soap, const char *URL, _WS1__invokeSrvResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeSrvResponse(struct soap *soap, _WS1__invokeSrvResponse *p) +{ + if (::soap_read__WS1__invokeSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeSrv_DEFINED +#define SOAP_TYPE__WS1__invokeSrv_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeSrv(struct soap*, const char*, int, const _WS1__invokeSrv *, const char*); +SOAP_FMAC3 _WS1__invokeSrv * SOAP_FMAC4 soap_in__WS1__invokeSrv(struct soap*, const char*, _WS1__invokeSrv *, const char*); +SOAP_FMAC1 _WS1__invokeSrv * SOAP_FMAC2 cross_instantiate__WS1__invokeSrv(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeSrv * soap_new__WS1__invokeSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeSrv(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeSrv * soap_new_req__WS1__invokeSrv( + struct soap *soap, + const std::string& in0) +{ + _WS1__invokeSrv *_p = ::soap_new__WS1__invokeSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeSrv::in0 = in0; + } + return _p; +} + +inline _WS1__invokeSrv * soap_new_set__WS1__invokeSrv( + struct soap *soap, + const std::string& in0) +{ + _WS1__invokeSrv *_p = ::soap_new__WS1__invokeSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeSrv::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrv", p->soap_type() == SOAP_TYPE__WS1__invokeSrv ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeSrv(struct soap *soap, const char *URL, _WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrv", p->soap_type() == SOAP_TYPE__WS1__invokeSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeSrv(struct soap *soap, const char *URL, _WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrv", p->soap_type() == SOAP_TYPE__WS1__invokeSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeSrv(struct soap *soap, const char *URL, _WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeSrv", p->soap_type() == SOAP_TYPE__WS1__invokeSrv ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeSrv * SOAP_FMAC4 soap_get__WS1__invokeSrv(struct soap*, _WS1__invokeSrv *, const char*, const char*); + +inline int soap_read__WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeSrv(struct soap *soap, const char *URL, _WS1__invokeSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeSrv(struct soap *soap, _WS1__invokeSrv *p) +{ + if (::soap_read__WS1__invokeSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__regEAIResponse_DEFINED +#define SOAP_TYPE__WS1__regEAIResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regEAIResponse(struct soap*, const char*, int, const _WS1__regEAIResponse *, const char*); +SOAP_FMAC3 _WS1__regEAIResponse * SOAP_FMAC4 soap_in__WS1__regEAIResponse(struct soap*, const char*, _WS1__regEAIResponse *, const char*); +SOAP_FMAC1 _WS1__regEAIResponse * SOAP_FMAC2 cross_instantiate__WS1__regEAIResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__regEAIResponse * soap_new__WS1__regEAIResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__regEAIResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__regEAIResponse * soap_new_req__WS1__regEAIResponse( + struct soap *soap, + const std::string& regEAIReturn) +{ + _WS1__regEAIResponse *_p = ::soap_new__WS1__regEAIResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regEAIResponse::regEAIReturn = regEAIReturn; + } + return _p; +} + +inline _WS1__regEAIResponse * soap_new_set__WS1__regEAIResponse( + struct soap *soap, + const std::string& regEAIReturn) +{ + _WS1__regEAIResponse *_p = ::soap_new__WS1__regEAIResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regEAIResponse::regEAIReturn = regEAIReturn; + } + return _p; +} + +inline int soap_write__WS1__regEAIResponse(struct soap *soap, _WS1__regEAIResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAIResponse", p->soap_type() == SOAP_TYPE__WS1__regEAIResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__regEAIResponse(struct soap *soap, const char *URL, _WS1__regEAIResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAIResponse", p->soap_type() == SOAP_TYPE__WS1__regEAIResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__regEAIResponse(struct soap *soap, const char *URL, _WS1__regEAIResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAIResponse", p->soap_type() == SOAP_TYPE__WS1__regEAIResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__regEAIResponse(struct soap *soap, const char *URL, _WS1__regEAIResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAIResponse", p->soap_type() == SOAP_TYPE__WS1__regEAIResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__regEAIResponse * SOAP_FMAC4 soap_get__WS1__regEAIResponse(struct soap*, _WS1__regEAIResponse *, const char*, const char*); + +inline int soap_read__WS1__regEAIResponse(struct soap *soap, _WS1__regEAIResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__regEAIResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__regEAIResponse(struct soap *soap, const char *URL, _WS1__regEAIResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__regEAIResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__regEAIResponse(struct soap *soap, _WS1__regEAIResponse *p) +{ + if (::soap_read__WS1__regEAIResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__regEAI_DEFINED +#define SOAP_TYPE__WS1__regEAI_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regEAI(struct soap*, const char*, int, const _WS1__regEAI *, const char*); +SOAP_FMAC3 _WS1__regEAI * SOAP_FMAC4 soap_in__WS1__regEAI(struct soap*, const char*, _WS1__regEAI *, const char*); +SOAP_FMAC1 _WS1__regEAI * SOAP_FMAC2 cross_instantiate__WS1__regEAI(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__regEAI * soap_new__WS1__regEAI(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__regEAI(soap, n, NULL, NULL, NULL); +} + +inline _WS1__regEAI * soap_new_req__WS1__regEAI( + struct soap *soap, + const std::string& in0) +{ + _WS1__regEAI *_p = ::soap_new__WS1__regEAI(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regEAI::in0 = in0; + } + return _p; +} + +inline _WS1__regEAI * soap_new_set__WS1__regEAI( + struct soap *soap, + const std::string& in0) +{ + _WS1__regEAI *_p = ::soap_new__WS1__regEAI(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regEAI::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__regEAI(struct soap *soap, _WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAI", p->soap_type() == SOAP_TYPE__WS1__regEAI ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__regEAI(struct soap *soap, const char *URL, _WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAI", p->soap_type() == SOAP_TYPE__WS1__regEAI ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__regEAI(struct soap *soap, const char *URL, _WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAI", p->soap_type() == SOAP_TYPE__WS1__regEAI ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__regEAI(struct soap *soap, const char *URL, _WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regEAI", p->soap_type() == SOAP_TYPE__WS1__regEAI ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__regEAI * SOAP_FMAC4 soap_get__WS1__regEAI(struct soap*, _WS1__regEAI *, const char*, const char*); + +inline int soap_read__WS1__regEAI(struct soap *soap, _WS1__regEAI *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__regEAI(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__regEAI(struct soap *soap, const char *URL, _WS1__regEAI *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__regEAI(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__regEAI(struct soap *soap, _WS1__regEAI *p) +{ + if (::soap_read__WS1__regEAI(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__regSrvResponse_DEFINED +#define SOAP_TYPE__WS1__regSrvResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regSrvResponse(struct soap*, const char*, int, const _WS1__regSrvResponse *, const char*); +SOAP_FMAC3 _WS1__regSrvResponse * SOAP_FMAC4 soap_in__WS1__regSrvResponse(struct soap*, const char*, _WS1__regSrvResponse *, const char*); +SOAP_FMAC1 _WS1__regSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__regSrvResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__regSrvResponse * soap_new__WS1__regSrvResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__regSrvResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__regSrvResponse * soap_new_req__WS1__regSrvResponse( + struct soap *soap, + const std::string& regSrvReturn) +{ + _WS1__regSrvResponse *_p = ::soap_new__WS1__regSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regSrvResponse::regSrvReturn = regSrvReturn; + } + return _p; +} + +inline _WS1__regSrvResponse * soap_new_set__WS1__regSrvResponse( + struct soap *soap, + const std::string& regSrvReturn) +{ + _WS1__regSrvResponse *_p = ::soap_new__WS1__regSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regSrvResponse::regSrvReturn = regSrvReturn; + } + return _p; +} + +inline int soap_write__WS1__regSrvResponse(struct soap *soap, _WS1__regSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrvResponse", p->soap_type() == SOAP_TYPE__WS1__regSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__regSrvResponse(struct soap *soap, const char *URL, _WS1__regSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrvResponse", p->soap_type() == SOAP_TYPE__WS1__regSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__regSrvResponse(struct soap *soap, const char *URL, _WS1__regSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrvResponse", p->soap_type() == SOAP_TYPE__WS1__regSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__regSrvResponse(struct soap *soap, const char *URL, _WS1__regSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrvResponse", p->soap_type() == SOAP_TYPE__WS1__regSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__regSrvResponse * SOAP_FMAC4 soap_get__WS1__regSrvResponse(struct soap*, _WS1__regSrvResponse *, const char*, const char*); + +inline int soap_read__WS1__regSrvResponse(struct soap *soap, _WS1__regSrvResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__regSrvResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__regSrvResponse(struct soap *soap, const char *URL, _WS1__regSrvResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__regSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__regSrvResponse(struct soap *soap, _WS1__regSrvResponse *p) +{ + if (::soap_read__WS1__regSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__regSrv_DEFINED +#define SOAP_TYPE__WS1__regSrv_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regSrv(struct soap*, const char*, int, const _WS1__regSrv *, const char*); +SOAP_FMAC3 _WS1__regSrv * SOAP_FMAC4 soap_in__WS1__regSrv(struct soap*, const char*, _WS1__regSrv *, const char*); +SOAP_FMAC1 _WS1__regSrv * SOAP_FMAC2 cross_instantiate__WS1__regSrv(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__regSrv * soap_new__WS1__regSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__regSrv(soap, n, NULL, NULL, NULL); +} + +inline _WS1__regSrv * soap_new_req__WS1__regSrv( + struct soap *soap, + const std::string& in0) +{ + _WS1__regSrv *_p = ::soap_new__WS1__regSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regSrv::in0 = in0; + } + return _p; +} + +inline _WS1__regSrv * soap_new_set__WS1__regSrv( + struct soap *soap, + const std::string& in0) +{ + _WS1__regSrv *_p = ::soap_new__WS1__regSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regSrv::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__regSrv(struct soap *soap, _WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrv", p->soap_type() == SOAP_TYPE__WS1__regSrv ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__regSrv(struct soap *soap, const char *URL, _WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrv", p->soap_type() == SOAP_TYPE__WS1__regSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__regSrv(struct soap *soap, const char *URL, _WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrv", p->soap_type() == SOAP_TYPE__WS1__regSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__regSrv(struct soap *soap, const char *URL, _WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regSrv", p->soap_type() == SOAP_TYPE__WS1__regSrv ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__regSrv * SOAP_FMAC4 soap_get__WS1__regSrv(struct soap*, _WS1__regSrv *, const char*, const char*); + +inline int soap_read__WS1__regSrv(struct soap *soap, _WS1__regSrv *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__regSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__regSrv(struct soap *soap, const char *URL, _WS1__regSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__regSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__regSrv(struct soap *soap, _WS1__regSrv *p) +{ + if (::soap_read__WS1__regSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getStandardDataNameListResponse_DEFINED +#define SOAP_TYPE__WS1__getStandardDataNameListResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardDataNameListResponse(struct soap*, const char*, int, const _WS1__getStandardDataNameListResponse *, const char*); +SOAP_FMAC3 _WS1__getStandardDataNameListResponse * SOAP_FMAC4 soap_in__WS1__getStandardDataNameListResponse(struct soap*, const char*, _WS1__getStandardDataNameListResponse *, const char*); +SOAP_FMAC1 _WS1__getStandardDataNameListResponse * SOAP_FMAC2 cross_instantiate__WS1__getStandardDataNameListResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getStandardDataNameListResponse * soap_new__WS1__getStandardDataNameListResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getStandardDataNameListResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getStandardDataNameListResponse * soap_new_req__WS1__getStandardDataNameListResponse( + struct soap *soap, + const std::string& getStandardDataNameListReturn) +{ + _WS1__getStandardDataNameListResponse *_p = ::soap_new__WS1__getStandardDataNameListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getStandardDataNameListResponse::getStandardDataNameListReturn = getStandardDataNameListReturn; + } + return _p; +} + +inline _WS1__getStandardDataNameListResponse * soap_new_set__WS1__getStandardDataNameListResponse( + struct soap *soap, + const std::string& getStandardDataNameListReturn) +{ + _WS1__getStandardDataNameListResponse *_p = ::soap_new__WS1__getStandardDataNameListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getStandardDataNameListResponse::getStandardDataNameListReturn = getStandardDataNameListReturn; + } + return _p; +} + +inline int soap_write__WS1__getStandardDataNameListResponse(struct soap *soap, _WS1__getStandardDataNameListResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameListResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getStandardDataNameListResponse(struct soap *soap, const char *URL, _WS1__getStandardDataNameListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getStandardDataNameListResponse(struct soap *soap, const char *URL, _WS1__getStandardDataNameListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getStandardDataNameListResponse(struct soap *soap, const char *URL, _WS1__getStandardDataNameListResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameListResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getStandardDataNameListResponse * SOAP_FMAC4 soap_get__WS1__getStandardDataNameListResponse(struct soap*, _WS1__getStandardDataNameListResponse *, const char*, const char*); + +inline int soap_read__WS1__getStandardDataNameListResponse(struct soap *soap, _WS1__getStandardDataNameListResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getStandardDataNameListResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getStandardDataNameListResponse(struct soap *soap, const char *URL, _WS1__getStandardDataNameListResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getStandardDataNameListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getStandardDataNameListResponse(struct soap *soap, _WS1__getStandardDataNameListResponse *p) +{ + if (::soap_read__WS1__getStandardDataNameListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getStandardDataNameList_DEFINED +#define SOAP_TYPE__WS1__getStandardDataNameList_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardDataNameList(struct soap*, const char*, int, const _WS1__getStandardDataNameList *, const char*); +SOAP_FMAC3 _WS1__getStandardDataNameList * SOAP_FMAC4 soap_in__WS1__getStandardDataNameList(struct soap*, const char*, _WS1__getStandardDataNameList *, const char*); +SOAP_FMAC1 _WS1__getStandardDataNameList * SOAP_FMAC2 cross_instantiate__WS1__getStandardDataNameList(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getStandardDataNameList * soap_new__WS1__getStandardDataNameList(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getStandardDataNameList(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getStandardDataNameList * soap_new_req__WS1__getStandardDataNameList( + struct soap *soap) +{ + _WS1__getStandardDataNameList *_p = ::soap_new__WS1__getStandardDataNameList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _WS1__getStandardDataNameList * soap_new_set__WS1__getStandardDataNameList( + struct soap *soap) +{ + _WS1__getStandardDataNameList *_p = ::soap_new__WS1__getStandardDataNameList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline int soap_write__WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameList", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameList ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getStandardDataNameList(struct soap *soap, const char *URL, _WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameList", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getStandardDataNameList(struct soap *soap, const char *URL, _WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameList", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getStandardDataNameList(struct soap *soap, const char *URL, _WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardDataNameList", p->soap_type() == SOAP_TYPE__WS1__getStandardDataNameList ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getStandardDataNameList * SOAP_FMAC4 soap_get__WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList *, const char*, const char*); + +inline int soap_read__WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getStandardDataNameList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getStandardDataNameList(struct soap *soap, const char *URL, _WS1__getStandardDataNameList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getStandardDataNameList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameList *p) +{ + if (::soap_read__WS1__getStandardDataNameList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getStandardServiceListResponse_DEFINED +#define SOAP_TYPE__WS1__getStandardServiceListResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardServiceListResponse(struct soap*, const char*, int, const _WS1__getStandardServiceListResponse *, const char*); +SOAP_FMAC3 _WS1__getStandardServiceListResponse * SOAP_FMAC4 soap_in__WS1__getStandardServiceListResponse(struct soap*, const char*, _WS1__getStandardServiceListResponse *, const char*); +SOAP_FMAC1 _WS1__getStandardServiceListResponse * SOAP_FMAC2 cross_instantiate__WS1__getStandardServiceListResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getStandardServiceListResponse * soap_new__WS1__getStandardServiceListResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getStandardServiceListResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getStandardServiceListResponse * soap_new_req__WS1__getStandardServiceListResponse( + struct soap *soap, + const std::string& getStandardServiceListReturn) +{ + _WS1__getStandardServiceListResponse *_p = ::soap_new__WS1__getStandardServiceListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getStandardServiceListResponse::getStandardServiceListReturn = getStandardServiceListReturn; + } + return _p; +} + +inline _WS1__getStandardServiceListResponse * soap_new_set__WS1__getStandardServiceListResponse( + struct soap *soap, + const std::string& getStandardServiceListReturn) +{ + _WS1__getStandardServiceListResponse *_p = ::soap_new__WS1__getStandardServiceListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getStandardServiceListResponse::getStandardServiceListReturn = getStandardServiceListReturn; + } + return _p; +} + +inline int soap_write__WS1__getStandardServiceListResponse(struct soap *soap, _WS1__getStandardServiceListResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceListResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getStandardServiceListResponse(struct soap *soap, const char *URL, _WS1__getStandardServiceListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getStandardServiceListResponse(struct soap *soap, const char *URL, _WS1__getStandardServiceListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getStandardServiceListResponse(struct soap *soap, const char *URL, _WS1__getStandardServiceListResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceListResponse", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceListResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getStandardServiceListResponse * SOAP_FMAC4 soap_get__WS1__getStandardServiceListResponse(struct soap*, _WS1__getStandardServiceListResponse *, const char*, const char*); + +inline int soap_read__WS1__getStandardServiceListResponse(struct soap *soap, _WS1__getStandardServiceListResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getStandardServiceListResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getStandardServiceListResponse(struct soap *soap, const char *URL, _WS1__getStandardServiceListResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getStandardServiceListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getStandardServiceListResponse(struct soap *soap, _WS1__getStandardServiceListResponse *p) +{ + if (::soap_read__WS1__getStandardServiceListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getStandardServiceList_DEFINED +#define SOAP_TYPE__WS1__getStandardServiceList_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getStandardServiceList(struct soap*, const char*, int, const _WS1__getStandardServiceList *, const char*); +SOAP_FMAC3 _WS1__getStandardServiceList * SOAP_FMAC4 soap_in__WS1__getStandardServiceList(struct soap*, const char*, _WS1__getStandardServiceList *, const char*); +SOAP_FMAC1 _WS1__getStandardServiceList * SOAP_FMAC2 cross_instantiate__WS1__getStandardServiceList(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getStandardServiceList * soap_new__WS1__getStandardServiceList(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getStandardServiceList(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getStandardServiceList * soap_new_req__WS1__getStandardServiceList( + struct soap *soap) +{ + _WS1__getStandardServiceList *_p = ::soap_new__WS1__getStandardServiceList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _WS1__getStandardServiceList * soap_new_set__WS1__getStandardServiceList( + struct soap *soap) +{ + _WS1__getStandardServiceList *_p = ::soap_new__WS1__getStandardServiceList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline int soap_write__WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceList", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceList ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getStandardServiceList(struct soap *soap, const char *URL, _WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceList", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getStandardServiceList(struct soap *soap, const char *URL, _WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceList", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getStandardServiceList(struct soap *soap, const char *URL, _WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getStandardServiceList", p->soap_type() == SOAP_TYPE__WS1__getStandardServiceList ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getStandardServiceList * SOAP_FMAC4 soap_get__WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList *, const char*, const char*); + +inline int soap_read__WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getStandardServiceList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getStandardServiceList(struct soap *soap, const char *URL, _WS1__getStandardServiceList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getStandardServiceList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceList *p) +{ + if (::soap_read__WS1__getStandardServiceList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__fpInvokeResponse_DEFINED +#define SOAP_TYPE__WS1__fpInvokeResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__fpInvokeResponse(struct soap*, const char*, int, const _WS1__fpInvokeResponse *, const char*); +SOAP_FMAC3 _WS1__fpInvokeResponse * SOAP_FMAC4 soap_in__WS1__fpInvokeResponse(struct soap*, const char*, _WS1__fpInvokeResponse *, const char*); +SOAP_FMAC1 _WS1__fpInvokeResponse * SOAP_FMAC2 cross_instantiate__WS1__fpInvokeResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__fpInvokeResponse * soap_new__WS1__fpInvokeResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__fpInvokeResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__fpInvokeResponse * soap_new_req__WS1__fpInvokeResponse( + struct soap *soap, + const std::string& fpInvokeReturn) +{ + _WS1__fpInvokeResponse *_p = ::soap_new__WS1__fpInvokeResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__fpInvokeResponse::fpInvokeReturn = fpInvokeReturn; + } + return _p; +} + +inline _WS1__fpInvokeResponse * soap_new_set__WS1__fpInvokeResponse( + struct soap *soap, + const std::string& fpInvokeReturn) +{ + _WS1__fpInvokeResponse *_p = ::soap_new__WS1__fpInvokeResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__fpInvokeResponse::fpInvokeReturn = fpInvokeReturn; + } + return _p; +} + +inline int soap_write__WS1__fpInvokeResponse(struct soap *soap, _WS1__fpInvokeResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvokeResponse", p->soap_type() == SOAP_TYPE__WS1__fpInvokeResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__fpInvokeResponse(struct soap *soap, const char *URL, _WS1__fpInvokeResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvokeResponse", p->soap_type() == SOAP_TYPE__WS1__fpInvokeResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__fpInvokeResponse(struct soap *soap, const char *URL, _WS1__fpInvokeResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvokeResponse", p->soap_type() == SOAP_TYPE__WS1__fpInvokeResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__fpInvokeResponse(struct soap *soap, const char *URL, _WS1__fpInvokeResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvokeResponse", p->soap_type() == SOAP_TYPE__WS1__fpInvokeResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__fpInvokeResponse * SOAP_FMAC4 soap_get__WS1__fpInvokeResponse(struct soap*, _WS1__fpInvokeResponse *, const char*, const char*); + +inline int soap_read__WS1__fpInvokeResponse(struct soap *soap, _WS1__fpInvokeResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__fpInvokeResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__fpInvokeResponse(struct soap *soap, const char *URL, _WS1__fpInvokeResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__fpInvokeResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__fpInvokeResponse(struct soap *soap, _WS1__fpInvokeResponse *p) +{ + if (::soap_read__WS1__fpInvokeResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__fpInvoke_DEFINED +#define SOAP_TYPE__WS1__fpInvoke_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__fpInvoke(struct soap*, const char*, int, const _WS1__fpInvoke *, const char*); +SOAP_FMAC3 _WS1__fpInvoke * SOAP_FMAC4 soap_in__WS1__fpInvoke(struct soap*, const char*, _WS1__fpInvoke *, const char*); +SOAP_FMAC1 _WS1__fpInvoke * SOAP_FMAC2 cross_instantiate__WS1__fpInvoke(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__fpInvoke * soap_new__WS1__fpInvoke(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__fpInvoke(soap, n, NULL, NULL, NULL); +} + +inline _WS1__fpInvoke * soap_new_req__WS1__fpInvoke( + struct soap *soap, + const std::string& in0) +{ + _WS1__fpInvoke *_p = ::soap_new__WS1__fpInvoke(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__fpInvoke::in0 = in0; + } + return _p; +} + +inline _WS1__fpInvoke * soap_new_set__WS1__fpInvoke( + struct soap *soap, + const std::string& in0) +{ + _WS1__fpInvoke *_p = ::soap_new__WS1__fpInvoke(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__fpInvoke::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvoke", p->soap_type() == SOAP_TYPE__WS1__fpInvoke ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__fpInvoke(struct soap *soap, const char *URL, _WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvoke", p->soap_type() == SOAP_TYPE__WS1__fpInvoke ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__fpInvoke(struct soap *soap, const char *URL, _WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvoke", p->soap_type() == SOAP_TYPE__WS1__fpInvoke ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__fpInvoke(struct soap *soap, const char *URL, _WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:fpInvoke", p->soap_type() == SOAP_TYPE__WS1__fpInvoke ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__fpInvoke * SOAP_FMAC4 soap_get__WS1__fpInvoke(struct soap*, _WS1__fpInvoke *, const char*, const char*); + +inline int soap_read__WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__fpInvoke(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__fpInvoke(struct soap *soap, const char *URL, _WS1__fpInvoke *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__fpInvoke(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__fpInvoke(struct soap *soap, _WS1__fpInvoke *p) +{ + if (::soap_read__WS1__fpInvoke(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getSrvResponse_DEFINED +#define SOAP_TYPE__WS1__getSrvResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getSrvResponse(struct soap*, const char*, int, const _WS1__getSrvResponse *, const char*); +SOAP_FMAC3 _WS1__getSrvResponse * SOAP_FMAC4 soap_in__WS1__getSrvResponse(struct soap*, const char*, _WS1__getSrvResponse *, const char*); +SOAP_FMAC1 _WS1__getSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__getSrvResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getSrvResponse * soap_new__WS1__getSrvResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getSrvResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getSrvResponse * soap_new_req__WS1__getSrvResponse( + struct soap *soap, + const std::string& getSrvReturn) +{ + _WS1__getSrvResponse *_p = ::soap_new__WS1__getSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getSrvResponse::getSrvReturn = getSrvReturn; + } + return _p; +} + +inline _WS1__getSrvResponse * soap_new_set__WS1__getSrvResponse( + struct soap *soap, + const std::string& getSrvReturn) +{ + _WS1__getSrvResponse *_p = ::soap_new__WS1__getSrvResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getSrvResponse::getSrvReturn = getSrvReturn; + } + return _p; +} + +inline int soap_write__WS1__getSrvResponse(struct soap *soap, _WS1__getSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrvResponse", p->soap_type() == SOAP_TYPE__WS1__getSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getSrvResponse(struct soap *soap, const char *URL, _WS1__getSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrvResponse", p->soap_type() == SOAP_TYPE__WS1__getSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getSrvResponse(struct soap *soap, const char *URL, _WS1__getSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrvResponse", p->soap_type() == SOAP_TYPE__WS1__getSrvResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getSrvResponse(struct soap *soap, const char *URL, _WS1__getSrvResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrvResponse", p->soap_type() == SOAP_TYPE__WS1__getSrvResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getSrvResponse * SOAP_FMAC4 soap_get__WS1__getSrvResponse(struct soap*, _WS1__getSrvResponse *, const char*, const char*); + +inline int soap_read__WS1__getSrvResponse(struct soap *soap, _WS1__getSrvResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getSrvResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getSrvResponse(struct soap *soap, const char *URL, _WS1__getSrvResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getSrvResponse(struct soap *soap, _WS1__getSrvResponse *p) +{ + if (::soap_read__WS1__getSrvResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getSrv_DEFINED +#define SOAP_TYPE__WS1__getSrv_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getSrv(struct soap*, const char*, int, const _WS1__getSrv *, const char*); +SOAP_FMAC3 _WS1__getSrv * SOAP_FMAC4 soap_in__WS1__getSrv(struct soap*, const char*, _WS1__getSrv *, const char*); +SOAP_FMAC1 _WS1__getSrv * SOAP_FMAC2 cross_instantiate__WS1__getSrv(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getSrv * soap_new__WS1__getSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getSrv(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getSrv * soap_new_req__WS1__getSrv( + struct soap *soap, + const std::string& in0) +{ + _WS1__getSrv *_p = ::soap_new__WS1__getSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getSrv::in0 = in0; + } + return _p; +} + +inline _WS1__getSrv * soap_new_set__WS1__getSrv( + struct soap *soap, + const std::string& in0) +{ + _WS1__getSrv *_p = ::soap_new__WS1__getSrv(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getSrv::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__getSrv(struct soap *soap, _WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrv", p->soap_type() == SOAP_TYPE__WS1__getSrv ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getSrv(struct soap *soap, const char *URL, _WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrv", p->soap_type() == SOAP_TYPE__WS1__getSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getSrv(struct soap *soap, const char *URL, _WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrv", p->soap_type() == SOAP_TYPE__WS1__getSrv ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getSrv(struct soap *soap, const char *URL, _WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getSrv", p->soap_type() == SOAP_TYPE__WS1__getSrv ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getSrv * SOAP_FMAC4 soap_get__WS1__getSrv(struct soap*, _WS1__getSrv *, const char*, const char*); + +inline int soap_read__WS1__getSrv(struct soap *soap, _WS1__getSrv *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getSrv(struct soap *soap, const char *URL, _WS1__getSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getSrv(struct soap *soap, _WS1__getSrv *p) +{ + if (::soap_read__WS1__getSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getProdResponse_DEFINED +#define SOAP_TYPE__WS1__getProdResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProdResponse(struct soap*, const char*, int, const _WS1__getProdResponse *, const char*); +SOAP_FMAC3 _WS1__getProdResponse * SOAP_FMAC4 soap_in__WS1__getProdResponse(struct soap*, const char*, _WS1__getProdResponse *, const char*); +SOAP_FMAC1 _WS1__getProdResponse * SOAP_FMAC2 cross_instantiate__WS1__getProdResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getProdResponse * soap_new__WS1__getProdResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getProdResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getProdResponse * soap_new_req__WS1__getProdResponse( + struct soap *soap, + const std::string& getProdReturn) +{ + _WS1__getProdResponse *_p = ::soap_new__WS1__getProdResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getProdResponse::getProdReturn = getProdReturn; + } + return _p; +} + +inline _WS1__getProdResponse * soap_new_set__WS1__getProdResponse( + struct soap *soap, + const std::string& getProdReturn) +{ + _WS1__getProdResponse *_p = ::soap_new__WS1__getProdResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getProdResponse::getProdReturn = getProdReturn; + } + return _p; +} + +inline int soap_write__WS1__getProdResponse(struct soap *soap, _WS1__getProdResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdResponse", p->soap_type() == SOAP_TYPE__WS1__getProdResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getProdResponse(struct soap *soap, const char *URL, _WS1__getProdResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdResponse", p->soap_type() == SOAP_TYPE__WS1__getProdResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getProdResponse(struct soap *soap, const char *URL, _WS1__getProdResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdResponse", p->soap_type() == SOAP_TYPE__WS1__getProdResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getProdResponse(struct soap *soap, const char *URL, _WS1__getProdResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdResponse", p->soap_type() == SOAP_TYPE__WS1__getProdResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getProdResponse * SOAP_FMAC4 soap_get__WS1__getProdResponse(struct soap*, _WS1__getProdResponse *, const char*, const char*); + +inline int soap_read__WS1__getProdResponse(struct soap *soap, _WS1__getProdResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getProdResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getProdResponse(struct soap *soap, const char *URL, _WS1__getProdResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getProdResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getProdResponse(struct soap *soap, _WS1__getProdResponse *p) +{ + if (::soap_read__WS1__getProdResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getProd_DEFINED +#define SOAP_TYPE__WS1__getProd_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProd(struct soap*, const char*, int, const _WS1__getProd *, const char*); +SOAP_FMAC3 _WS1__getProd * SOAP_FMAC4 soap_in__WS1__getProd(struct soap*, const char*, _WS1__getProd *, const char*); +SOAP_FMAC1 _WS1__getProd * SOAP_FMAC2 cross_instantiate__WS1__getProd(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getProd * soap_new__WS1__getProd(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getProd(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getProd * soap_new_req__WS1__getProd( + struct soap *soap, + const std::string& in0) +{ + _WS1__getProd *_p = ::soap_new__WS1__getProd(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getProd::in0 = in0; + } + return _p; +} + +inline _WS1__getProd * soap_new_set__WS1__getProd( + struct soap *soap, + const std::string& in0) +{ + _WS1__getProd *_p = ::soap_new__WS1__getProd(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getProd::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__getProd(struct soap *soap, _WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProd", p->soap_type() == SOAP_TYPE__WS1__getProd ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getProd(struct soap *soap, const char *URL, _WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProd", p->soap_type() == SOAP_TYPE__WS1__getProd ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getProd(struct soap *soap, const char *URL, _WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProd", p->soap_type() == SOAP_TYPE__WS1__getProd ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getProd(struct soap *soap, const char *URL, _WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProd", p->soap_type() == SOAP_TYPE__WS1__getProd ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getProd * SOAP_FMAC4 soap_get__WS1__getProd(struct soap*, _WS1__getProd *, const char*, const char*); + +inline int soap_read__WS1__getProd(struct soap *soap, _WS1__getProd *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getProd(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getProd(struct soap *soap, const char *URL, _WS1__getProd *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getProd(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getProd(struct soap *soap, _WS1__getProd *p) +{ + if (::soap_read__WS1__getProd(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeMdmResponse_DEFINED +#define SOAP_TYPE__WS1__invokeMdmResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeMdmResponse(struct soap*, const char*, int, const _WS1__invokeMdmResponse *, const char*); +SOAP_FMAC3 _WS1__invokeMdmResponse * SOAP_FMAC4 soap_in__WS1__invokeMdmResponse(struct soap*, const char*, _WS1__invokeMdmResponse *, const char*); +SOAP_FMAC1 _WS1__invokeMdmResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeMdmResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeMdmResponse * soap_new__WS1__invokeMdmResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeMdmResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeMdmResponse * soap_new_req__WS1__invokeMdmResponse( + struct soap *soap, + const std::string& invokeMdmReturn) +{ + _WS1__invokeMdmResponse *_p = ::soap_new__WS1__invokeMdmResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeMdmResponse::invokeMdmReturn = invokeMdmReturn; + } + return _p; +} + +inline _WS1__invokeMdmResponse * soap_new_set__WS1__invokeMdmResponse( + struct soap *soap, + const std::string& invokeMdmReturn) +{ + _WS1__invokeMdmResponse *_p = ::soap_new__WS1__invokeMdmResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeMdmResponse::invokeMdmReturn = invokeMdmReturn; + } + return _p; +} + +inline int soap_write__WS1__invokeMdmResponse(struct soap *soap, _WS1__invokeMdmResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdmResponse", p->soap_type() == SOAP_TYPE__WS1__invokeMdmResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeMdmResponse(struct soap *soap, const char *URL, _WS1__invokeMdmResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdmResponse", p->soap_type() == SOAP_TYPE__WS1__invokeMdmResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeMdmResponse(struct soap *soap, const char *URL, _WS1__invokeMdmResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdmResponse", p->soap_type() == SOAP_TYPE__WS1__invokeMdmResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeMdmResponse(struct soap *soap, const char *URL, _WS1__invokeMdmResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdmResponse", p->soap_type() == SOAP_TYPE__WS1__invokeMdmResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeMdmResponse * SOAP_FMAC4 soap_get__WS1__invokeMdmResponse(struct soap*, _WS1__invokeMdmResponse *, const char*, const char*); + +inline int soap_read__WS1__invokeMdmResponse(struct soap *soap, _WS1__invokeMdmResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeMdmResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeMdmResponse(struct soap *soap, const char *URL, _WS1__invokeMdmResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeMdmResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeMdmResponse(struct soap *soap, _WS1__invokeMdmResponse *p) +{ + if (::soap_read__WS1__invokeMdmResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeMdm_DEFINED +#define SOAP_TYPE__WS1__invokeMdm_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeMdm(struct soap*, const char*, int, const _WS1__invokeMdm *, const char*); +SOAP_FMAC3 _WS1__invokeMdm * SOAP_FMAC4 soap_in__WS1__invokeMdm(struct soap*, const char*, _WS1__invokeMdm *, const char*); +SOAP_FMAC1 _WS1__invokeMdm * SOAP_FMAC2 cross_instantiate__WS1__invokeMdm(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeMdm * soap_new__WS1__invokeMdm(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeMdm(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeMdm * soap_new_req__WS1__invokeMdm( + struct soap *soap, + const std::string& in0) +{ + _WS1__invokeMdm *_p = ::soap_new__WS1__invokeMdm(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeMdm::in0 = in0; + } + return _p; +} + +inline _WS1__invokeMdm * soap_new_set__WS1__invokeMdm( + struct soap *soap, + const std::string& in0) +{ + _WS1__invokeMdm *_p = ::soap_new__WS1__invokeMdm(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeMdm::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdm", p->soap_type() == SOAP_TYPE__WS1__invokeMdm ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeMdm(struct soap *soap, const char *URL, _WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdm", p->soap_type() == SOAP_TYPE__WS1__invokeMdm ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeMdm(struct soap *soap, const char *URL, _WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdm", p->soap_type() == SOAP_TYPE__WS1__invokeMdm ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeMdm(struct soap *soap, const char *URL, _WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeMdm", p->soap_type() == SOAP_TYPE__WS1__invokeMdm ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeMdm * SOAP_FMAC4 soap_get__WS1__invokeMdm(struct soap*, _WS1__invokeMdm *, const char*, const char*); + +inline int soap_read__WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeMdm(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeMdm(struct soap *soap, const char *URL, _WS1__invokeMdm *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeMdm(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeMdm(struct soap *soap, _WS1__invokeMdm *p) +{ + if (::soap_read__WS1__invokeMdm(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeUnionResponse_DEFINED +#define SOAP_TYPE__WS1__invokeUnionResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeUnionResponse(struct soap*, const char*, int, const _WS1__invokeUnionResponse *, const char*); +SOAP_FMAC3 _WS1__invokeUnionResponse * SOAP_FMAC4 soap_in__WS1__invokeUnionResponse(struct soap*, const char*, _WS1__invokeUnionResponse *, const char*); +SOAP_FMAC1 _WS1__invokeUnionResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeUnionResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeUnionResponse * soap_new__WS1__invokeUnionResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeUnionResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeUnionResponse * soap_new_req__WS1__invokeUnionResponse( + struct soap *soap, + const std::string& invokeUnionReturn) +{ + _WS1__invokeUnionResponse *_p = ::soap_new__WS1__invokeUnionResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeUnionResponse::invokeUnionReturn = invokeUnionReturn; + } + return _p; +} + +inline _WS1__invokeUnionResponse * soap_new_set__WS1__invokeUnionResponse( + struct soap *soap, + const std::string& invokeUnionReturn) +{ + _WS1__invokeUnionResponse *_p = ::soap_new__WS1__invokeUnionResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeUnionResponse::invokeUnionReturn = invokeUnionReturn; + } + return _p; +} + +inline int soap_write__WS1__invokeUnionResponse(struct soap *soap, _WS1__invokeUnionResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnionResponse", p->soap_type() == SOAP_TYPE__WS1__invokeUnionResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeUnionResponse(struct soap *soap, const char *URL, _WS1__invokeUnionResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnionResponse", p->soap_type() == SOAP_TYPE__WS1__invokeUnionResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeUnionResponse(struct soap *soap, const char *URL, _WS1__invokeUnionResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnionResponse", p->soap_type() == SOAP_TYPE__WS1__invokeUnionResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeUnionResponse(struct soap *soap, const char *URL, _WS1__invokeUnionResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnionResponse", p->soap_type() == SOAP_TYPE__WS1__invokeUnionResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeUnionResponse * SOAP_FMAC4 soap_get__WS1__invokeUnionResponse(struct soap*, _WS1__invokeUnionResponse *, const char*, const char*); + +inline int soap_read__WS1__invokeUnionResponse(struct soap *soap, _WS1__invokeUnionResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeUnionResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeUnionResponse(struct soap *soap, const char *URL, _WS1__invokeUnionResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeUnionResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeUnionResponse(struct soap *soap, _WS1__invokeUnionResponse *p) +{ + if (::soap_read__WS1__invokeUnionResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeUnion_DEFINED +#define SOAP_TYPE__WS1__invokeUnion_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeUnion(struct soap*, const char*, int, const _WS1__invokeUnion *, const char*); +SOAP_FMAC3 _WS1__invokeUnion * SOAP_FMAC4 soap_in__WS1__invokeUnion(struct soap*, const char*, _WS1__invokeUnion *, const char*); +SOAP_FMAC1 _WS1__invokeUnion * SOAP_FMAC2 cross_instantiate__WS1__invokeUnion(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeUnion * soap_new__WS1__invokeUnion(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeUnion(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeUnion * soap_new_req__WS1__invokeUnion( + struct soap *soap, + const std::string& in0, + const std::string& in1) +{ + _WS1__invokeUnion *_p = ::soap_new__WS1__invokeUnion(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeUnion::in0 = in0; + _p->_WS1__invokeUnion::in1 = in1; + } + return _p; +} + +inline _WS1__invokeUnion * soap_new_set__WS1__invokeUnion( + struct soap *soap, + const std::string& in0, + const std::string& in1) +{ + _WS1__invokeUnion *_p = ::soap_new__WS1__invokeUnion(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeUnion::in0 = in0; + _p->_WS1__invokeUnion::in1 = in1; + } + return _p; +} + +inline int soap_write__WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnion", p->soap_type() == SOAP_TYPE__WS1__invokeUnion ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeUnion(struct soap *soap, const char *URL, _WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnion", p->soap_type() == SOAP_TYPE__WS1__invokeUnion ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeUnion(struct soap *soap, const char *URL, _WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnion", p->soap_type() == SOAP_TYPE__WS1__invokeUnion ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeUnion(struct soap *soap, const char *URL, _WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeUnion", p->soap_type() == SOAP_TYPE__WS1__invokeUnion ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeUnion * SOAP_FMAC4 soap_get__WS1__invokeUnion(struct soap*, _WS1__invokeUnion *, const char*, const char*); + +inline int soap_read__WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeUnion(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeUnion(struct soap *soap, const char *URL, _WS1__invokeUnion *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeUnion(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeUnion(struct soap *soap, _WS1__invokeUnion *p) +{ + if (::soap_read__WS1__invokeUnion(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__regProdAPResponse_DEFINED +#define SOAP_TYPE__WS1__regProdAPResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regProdAPResponse(struct soap*, const char*, int, const _WS1__regProdAPResponse *, const char*); +SOAP_FMAC3 _WS1__regProdAPResponse * SOAP_FMAC4 soap_in__WS1__regProdAPResponse(struct soap*, const char*, _WS1__regProdAPResponse *, const char*); +SOAP_FMAC1 _WS1__regProdAPResponse * SOAP_FMAC2 cross_instantiate__WS1__regProdAPResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__regProdAPResponse * soap_new__WS1__regProdAPResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__regProdAPResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__regProdAPResponse * soap_new_req__WS1__regProdAPResponse( + struct soap *soap, + const std::string& regProdAPReturn) +{ + _WS1__regProdAPResponse *_p = ::soap_new__WS1__regProdAPResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regProdAPResponse::regProdAPReturn = regProdAPReturn; + } + return _p; +} + +inline _WS1__regProdAPResponse * soap_new_set__WS1__regProdAPResponse( + struct soap *soap, + const std::string& regProdAPReturn) +{ + _WS1__regProdAPResponse *_p = ::soap_new__WS1__regProdAPResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regProdAPResponse::regProdAPReturn = regProdAPReturn; + } + return _p; +} + +inline int soap_write__WS1__regProdAPResponse(struct soap *soap, _WS1__regProdAPResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAPResponse", p->soap_type() == SOAP_TYPE__WS1__regProdAPResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__regProdAPResponse(struct soap *soap, const char *URL, _WS1__regProdAPResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAPResponse", p->soap_type() == SOAP_TYPE__WS1__regProdAPResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__regProdAPResponse(struct soap *soap, const char *URL, _WS1__regProdAPResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAPResponse", p->soap_type() == SOAP_TYPE__WS1__regProdAPResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__regProdAPResponse(struct soap *soap, const char *URL, _WS1__regProdAPResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAPResponse", p->soap_type() == SOAP_TYPE__WS1__regProdAPResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__regProdAPResponse * SOAP_FMAC4 soap_get__WS1__regProdAPResponse(struct soap*, _WS1__regProdAPResponse *, const char*, const char*); + +inline int soap_read__WS1__regProdAPResponse(struct soap *soap, _WS1__regProdAPResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__regProdAPResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__regProdAPResponse(struct soap *soap, const char *URL, _WS1__regProdAPResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__regProdAPResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__regProdAPResponse(struct soap *soap, _WS1__regProdAPResponse *p) +{ + if (::soap_read__WS1__regProdAPResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__regProdAP_DEFINED +#define SOAP_TYPE__WS1__regProdAP_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__regProdAP(struct soap*, const char*, int, const _WS1__regProdAP *, const char*); +SOAP_FMAC3 _WS1__regProdAP * SOAP_FMAC4 soap_in__WS1__regProdAP(struct soap*, const char*, _WS1__regProdAP *, const char*); +SOAP_FMAC1 _WS1__regProdAP * SOAP_FMAC2 cross_instantiate__WS1__regProdAP(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__regProdAP * soap_new__WS1__regProdAP(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__regProdAP(soap, n, NULL, NULL, NULL); +} + +inline _WS1__regProdAP * soap_new_req__WS1__regProdAP( + struct soap *soap, + const std::string& in0) +{ + _WS1__regProdAP *_p = ::soap_new__WS1__regProdAP(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regProdAP::in0 = in0; + } + return _p; +} + +inline _WS1__regProdAP * soap_new_set__WS1__regProdAP( + struct soap *soap, + const std::string& in0) +{ + _WS1__regProdAP *_p = ::soap_new__WS1__regProdAP(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__regProdAP::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__regProdAP(struct soap *soap, _WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAP", p->soap_type() == SOAP_TYPE__WS1__regProdAP ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__regProdAP(struct soap *soap, const char *URL, _WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAP", p->soap_type() == SOAP_TYPE__WS1__regProdAP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__regProdAP(struct soap *soap, const char *URL, _WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAP", p->soap_type() == SOAP_TYPE__WS1__regProdAP ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__regProdAP(struct soap *soap, const char *URL, _WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:regProdAP", p->soap_type() == SOAP_TYPE__WS1__regProdAP ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__regProdAP * SOAP_FMAC4 soap_get__WS1__regProdAP(struct soap*, _WS1__regProdAP *, const char*, const char*); + +inline int soap_read__WS1__regProdAP(struct soap *soap, _WS1__regProdAP *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__regProdAP(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__regProdAP(struct soap *soap, const char *URL, _WS1__regProdAP *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__regProdAP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__regProdAP(struct soap *soap, _WS1__regProdAP *p) +{ + if (::soap_read__WS1__regProdAP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getProdListResponse_DEFINED +#define SOAP_TYPE__WS1__getProdListResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProdListResponse(struct soap*, const char*, int, const _WS1__getProdListResponse *, const char*); +SOAP_FMAC3 _WS1__getProdListResponse * SOAP_FMAC4 soap_in__WS1__getProdListResponse(struct soap*, const char*, _WS1__getProdListResponse *, const char*); +SOAP_FMAC1 _WS1__getProdListResponse * SOAP_FMAC2 cross_instantiate__WS1__getProdListResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getProdListResponse * soap_new__WS1__getProdListResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getProdListResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getProdListResponse * soap_new_req__WS1__getProdListResponse( + struct soap *soap, + const std::string& getProdListReturn) +{ + _WS1__getProdListResponse *_p = ::soap_new__WS1__getProdListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getProdListResponse::getProdListReturn = getProdListReturn; + } + return _p; +} + +inline _WS1__getProdListResponse * soap_new_set__WS1__getProdListResponse( + struct soap *soap, + const std::string& getProdListReturn) +{ + _WS1__getProdListResponse *_p = ::soap_new__WS1__getProdListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getProdListResponse::getProdListReturn = getProdListReturn; + } + return _p; +} + +inline int soap_write__WS1__getProdListResponse(struct soap *soap, _WS1__getProdListResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdListResponse", p->soap_type() == SOAP_TYPE__WS1__getProdListResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getProdListResponse(struct soap *soap, const char *URL, _WS1__getProdListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdListResponse", p->soap_type() == SOAP_TYPE__WS1__getProdListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getProdListResponse(struct soap *soap, const char *URL, _WS1__getProdListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdListResponse", p->soap_type() == SOAP_TYPE__WS1__getProdListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getProdListResponse(struct soap *soap, const char *URL, _WS1__getProdListResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdListResponse", p->soap_type() == SOAP_TYPE__WS1__getProdListResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getProdListResponse * SOAP_FMAC4 soap_get__WS1__getProdListResponse(struct soap*, _WS1__getProdListResponse *, const char*, const char*); + +inline int soap_read__WS1__getProdListResponse(struct soap *soap, _WS1__getProdListResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getProdListResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getProdListResponse(struct soap *soap, const char *URL, _WS1__getProdListResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getProdListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getProdListResponse(struct soap *soap, _WS1__getProdListResponse *p) +{ + if (::soap_read__WS1__getProdListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getProdList_DEFINED +#define SOAP_TYPE__WS1__getProdList_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getProdList(struct soap*, const char*, int, const _WS1__getProdList *, const char*); +SOAP_FMAC3 _WS1__getProdList * SOAP_FMAC4 soap_in__WS1__getProdList(struct soap*, const char*, _WS1__getProdList *, const char*); +SOAP_FMAC1 _WS1__getProdList * SOAP_FMAC2 cross_instantiate__WS1__getProdList(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getProdList * soap_new__WS1__getProdList(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getProdList(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getProdList * soap_new_req__WS1__getProdList( + struct soap *soap) +{ + _WS1__getProdList *_p = ::soap_new__WS1__getProdList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _WS1__getProdList * soap_new_set__WS1__getProdList( + struct soap *soap) +{ + _WS1__getProdList *_p = ::soap_new__WS1__getProdList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline int soap_write__WS1__getProdList(struct soap *soap, _WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdList", p->soap_type() == SOAP_TYPE__WS1__getProdList ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getProdList(struct soap *soap, const char *URL, _WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdList", p->soap_type() == SOAP_TYPE__WS1__getProdList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getProdList(struct soap *soap, const char *URL, _WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdList", p->soap_type() == SOAP_TYPE__WS1__getProdList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getProdList(struct soap *soap, const char *URL, _WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getProdList", p->soap_type() == SOAP_TYPE__WS1__getProdList ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getProdList * SOAP_FMAC4 soap_get__WS1__getProdList(struct soap*, _WS1__getProdList *, const char*, const char*); + +inline int soap_read__WS1__getProdList(struct soap *soap, _WS1__getProdList *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getProdList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getProdList(struct soap *soap, const char *URL, _WS1__getProdList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getProdList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getProdList(struct soap *soap, _WS1__getProdList *p) +{ + if (::soap_read__WS1__getProdList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getParamListResponse_DEFINED +#define SOAP_TYPE__WS1__getParamListResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getParamListResponse(struct soap*, const char*, int, const _WS1__getParamListResponse *, const char*); +SOAP_FMAC3 _WS1__getParamListResponse * SOAP_FMAC4 soap_in__WS1__getParamListResponse(struct soap*, const char*, _WS1__getParamListResponse *, const char*); +SOAP_FMAC1 _WS1__getParamListResponse * SOAP_FMAC2 cross_instantiate__WS1__getParamListResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getParamListResponse * soap_new__WS1__getParamListResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getParamListResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getParamListResponse * soap_new_req__WS1__getParamListResponse( + struct soap *soap, + const std::string& getParamListReturn) +{ + _WS1__getParamListResponse *_p = ::soap_new__WS1__getParamListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getParamListResponse::getParamListReturn = getParamListReturn; + } + return _p; +} + +inline _WS1__getParamListResponse * soap_new_set__WS1__getParamListResponse( + struct soap *soap, + const std::string& getParamListReturn) +{ + _WS1__getParamListResponse *_p = ::soap_new__WS1__getParamListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getParamListResponse::getParamListReturn = getParamListReturn; + } + return _p; +} + +inline int soap_write__WS1__getParamListResponse(struct soap *soap, _WS1__getParamListResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamListResponse", p->soap_type() == SOAP_TYPE__WS1__getParamListResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getParamListResponse(struct soap *soap, const char *URL, _WS1__getParamListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamListResponse", p->soap_type() == SOAP_TYPE__WS1__getParamListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getParamListResponse(struct soap *soap, const char *URL, _WS1__getParamListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamListResponse", p->soap_type() == SOAP_TYPE__WS1__getParamListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getParamListResponse(struct soap *soap, const char *URL, _WS1__getParamListResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamListResponse", p->soap_type() == SOAP_TYPE__WS1__getParamListResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getParamListResponse * SOAP_FMAC4 soap_get__WS1__getParamListResponse(struct soap*, _WS1__getParamListResponse *, const char*, const char*); + +inline int soap_read__WS1__getParamListResponse(struct soap *soap, _WS1__getParamListResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getParamListResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getParamListResponse(struct soap *soap, const char *URL, _WS1__getParamListResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getParamListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getParamListResponse(struct soap *soap, _WS1__getParamListResponse *p) +{ + if (::soap_read__WS1__getParamListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getParamList_DEFINED +#define SOAP_TYPE__WS1__getParamList_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getParamList(struct soap*, const char*, int, const _WS1__getParamList *, const char*); +SOAP_FMAC3 _WS1__getParamList * SOAP_FMAC4 soap_in__WS1__getParamList(struct soap*, const char*, _WS1__getParamList *, const char*); +SOAP_FMAC1 _WS1__getParamList * SOAP_FMAC2 cross_instantiate__WS1__getParamList(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getParamList * soap_new__WS1__getParamList(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getParamList(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getParamList * soap_new_req__WS1__getParamList( + struct soap *soap) +{ + _WS1__getParamList *_p = ::soap_new__WS1__getParamList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline _WS1__getParamList * soap_new_set__WS1__getParamList( + struct soap *soap) +{ + _WS1__getParamList *_p = ::soap_new__WS1__getParamList(soap); + if (_p) + { _p->soap_default(soap); + } + return _p; +} + +inline int soap_write__WS1__getParamList(struct soap *soap, _WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamList", p->soap_type() == SOAP_TYPE__WS1__getParamList ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getParamList(struct soap *soap, const char *URL, _WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamList", p->soap_type() == SOAP_TYPE__WS1__getParamList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getParamList(struct soap *soap, const char *URL, _WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamList", p->soap_type() == SOAP_TYPE__WS1__getParamList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getParamList(struct soap *soap, const char *URL, _WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getParamList", p->soap_type() == SOAP_TYPE__WS1__getParamList ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getParamList * SOAP_FMAC4 soap_get__WS1__getParamList(struct soap*, _WS1__getParamList *, const char*, const char*); + +inline int soap_read__WS1__getParamList(struct soap *soap, _WS1__getParamList *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getParamList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getParamList(struct soap *soap, const char *URL, _WS1__getParamList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getParamList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getParamList(struct soap *soap, _WS1__getParamList *p) +{ + if (::soap_read__WS1__getParamList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getEtlJobListResponse_DEFINED +#define SOAP_TYPE__WS1__getEtlJobListResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getEtlJobListResponse(struct soap*, const char*, int, const _WS1__getEtlJobListResponse *, const char*); +SOAP_FMAC3 _WS1__getEtlJobListResponse * SOAP_FMAC4 soap_in__WS1__getEtlJobListResponse(struct soap*, const char*, _WS1__getEtlJobListResponse *, const char*); +SOAP_FMAC1 _WS1__getEtlJobListResponse * SOAP_FMAC2 cross_instantiate__WS1__getEtlJobListResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getEtlJobListResponse * soap_new__WS1__getEtlJobListResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getEtlJobListResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getEtlJobListResponse * soap_new_req__WS1__getEtlJobListResponse( + struct soap *soap, + const std::string& getEtlJobListReturn) +{ + _WS1__getEtlJobListResponse *_p = ::soap_new__WS1__getEtlJobListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getEtlJobListResponse::getEtlJobListReturn = getEtlJobListReturn; + } + return _p; +} + +inline _WS1__getEtlJobListResponse * soap_new_set__WS1__getEtlJobListResponse( + struct soap *soap, + const std::string& getEtlJobListReturn) +{ + _WS1__getEtlJobListResponse *_p = ::soap_new__WS1__getEtlJobListResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getEtlJobListResponse::getEtlJobListReturn = getEtlJobListReturn; + } + return _p; +} + +inline int soap_write__WS1__getEtlJobListResponse(struct soap *soap, _WS1__getEtlJobListResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobListResponse", p->soap_type() == SOAP_TYPE__WS1__getEtlJobListResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getEtlJobListResponse(struct soap *soap, const char *URL, _WS1__getEtlJobListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobListResponse", p->soap_type() == SOAP_TYPE__WS1__getEtlJobListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getEtlJobListResponse(struct soap *soap, const char *URL, _WS1__getEtlJobListResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobListResponse", p->soap_type() == SOAP_TYPE__WS1__getEtlJobListResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getEtlJobListResponse(struct soap *soap, const char *URL, _WS1__getEtlJobListResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobListResponse", p->soap_type() == SOAP_TYPE__WS1__getEtlJobListResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getEtlJobListResponse * SOAP_FMAC4 soap_get__WS1__getEtlJobListResponse(struct soap*, _WS1__getEtlJobListResponse *, const char*, const char*); + +inline int soap_read__WS1__getEtlJobListResponse(struct soap *soap, _WS1__getEtlJobListResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getEtlJobListResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getEtlJobListResponse(struct soap *soap, const char *URL, _WS1__getEtlJobListResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getEtlJobListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getEtlJobListResponse(struct soap *soap, _WS1__getEtlJobListResponse *p) +{ + if (::soap_read__WS1__getEtlJobListResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__getEtlJobList_DEFINED +#define SOAP_TYPE__WS1__getEtlJobList_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__getEtlJobList(struct soap*, const char*, int, const _WS1__getEtlJobList *, const char*); +SOAP_FMAC3 _WS1__getEtlJobList * SOAP_FMAC4 soap_in__WS1__getEtlJobList(struct soap*, const char*, _WS1__getEtlJobList *, const char*); +SOAP_FMAC1 _WS1__getEtlJobList * SOAP_FMAC2 cross_instantiate__WS1__getEtlJobList(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__getEtlJobList * soap_new__WS1__getEtlJobList(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__getEtlJobList(soap, n, NULL, NULL, NULL); +} + +inline _WS1__getEtlJobList * soap_new_req__WS1__getEtlJobList( + struct soap *soap, + const std::string& in0) +{ + _WS1__getEtlJobList *_p = ::soap_new__WS1__getEtlJobList(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getEtlJobList::in0 = in0; + } + return _p; +} + +inline _WS1__getEtlJobList * soap_new_set__WS1__getEtlJobList( + struct soap *soap, + const std::string& in0) +{ + _WS1__getEtlJobList *_p = ::soap_new__WS1__getEtlJobList(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__getEtlJobList::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobList", p->soap_type() == SOAP_TYPE__WS1__getEtlJobList ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__getEtlJobList(struct soap *soap, const char *URL, _WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobList", p->soap_type() == SOAP_TYPE__WS1__getEtlJobList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__getEtlJobList(struct soap *soap, const char *URL, _WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobList", p->soap_type() == SOAP_TYPE__WS1__getEtlJobList ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__getEtlJobList(struct soap *soap, const char *URL, _WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:getEtlJobList", p->soap_type() == SOAP_TYPE__WS1__getEtlJobList ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__getEtlJobList * SOAP_FMAC4 soap_get__WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList *, const char*, const char*); + +inline int soap_read__WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__getEtlJobList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__getEtlJobList(struct soap *soap, const char *URL, _WS1__getEtlJobList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__getEtlJobList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobList *p) +{ + if (::soap_read__WS1__getEtlJobList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeEtlResponse_DEFINED +#define SOAP_TYPE__WS1__invokeEtlResponse_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeEtlResponse(struct soap*, const char*, int, const _WS1__invokeEtlResponse *, const char*); +SOAP_FMAC3 _WS1__invokeEtlResponse * SOAP_FMAC4 soap_in__WS1__invokeEtlResponse(struct soap*, const char*, _WS1__invokeEtlResponse *, const char*); +SOAP_FMAC1 _WS1__invokeEtlResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeEtlResponse(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeEtlResponse * soap_new__WS1__invokeEtlResponse(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeEtlResponse(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeEtlResponse * soap_new_req__WS1__invokeEtlResponse( + struct soap *soap, + const std::string& invokeEtlReturn) +{ + _WS1__invokeEtlResponse *_p = ::soap_new__WS1__invokeEtlResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeEtlResponse::invokeEtlReturn = invokeEtlReturn; + } + return _p; +} + +inline _WS1__invokeEtlResponse * soap_new_set__WS1__invokeEtlResponse( + struct soap *soap, + const std::string& invokeEtlReturn) +{ + _WS1__invokeEtlResponse *_p = ::soap_new__WS1__invokeEtlResponse(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeEtlResponse::invokeEtlReturn = invokeEtlReturn; + } + return _p; +} + +inline int soap_write__WS1__invokeEtlResponse(struct soap *soap, _WS1__invokeEtlResponse const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtlResponse", p->soap_type() == SOAP_TYPE__WS1__invokeEtlResponse ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeEtlResponse(struct soap *soap, const char *URL, _WS1__invokeEtlResponse const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtlResponse", p->soap_type() == SOAP_TYPE__WS1__invokeEtlResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeEtlResponse(struct soap *soap, const char *URL, _WS1__invokeEtlResponse const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtlResponse", p->soap_type() == SOAP_TYPE__WS1__invokeEtlResponse ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeEtlResponse(struct soap *soap, const char *URL, _WS1__invokeEtlResponse const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtlResponse", p->soap_type() == SOAP_TYPE__WS1__invokeEtlResponse ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeEtlResponse * SOAP_FMAC4 soap_get__WS1__invokeEtlResponse(struct soap*, _WS1__invokeEtlResponse *, const char*, const char*); + +inline int soap_read__WS1__invokeEtlResponse(struct soap *soap, _WS1__invokeEtlResponse *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeEtlResponse(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeEtlResponse(struct soap *soap, const char *URL, _WS1__invokeEtlResponse *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeEtlResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeEtlResponse(struct soap *soap, _WS1__invokeEtlResponse *p) +{ + if (::soap_read__WS1__invokeEtlResponse(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__WS1__invokeEtl_DEFINED +#define SOAP_TYPE__WS1__invokeEtl_DEFINED +SOAP_FMAC3 int SOAP_FMAC4 soap_out__WS1__invokeEtl(struct soap*, const char*, int, const _WS1__invokeEtl *, const char*); +SOAP_FMAC3 _WS1__invokeEtl * SOAP_FMAC4 soap_in__WS1__invokeEtl(struct soap*, const char*, _WS1__invokeEtl *, const char*); +SOAP_FMAC1 _WS1__invokeEtl * SOAP_FMAC2 cross_instantiate__WS1__invokeEtl(struct soap*, int, const char*, const char*, size_t*); + +inline _WS1__invokeEtl * soap_new__WS1__invokeEtl(struct soap *soap, int n = -1) +{ + return cross_instantiate__WS1__invokeEtl(soap, n, NULL, NULL, NULL); +} + +inline _WS1__invokeEtl * soap_new_req__WS1__invokeEtl( + struct soap *soap, + const std::string& in0) +{ + _WS1__invokeEtl *_p = ::soap_new__WS1__invokeEtl(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeEtl::in0 = in0; + } + return _p; +} + +inline _WS1__invokeEtl * soap_new_set__WS1__invokeEtl( + struct soap *soap, + const std::string& in0) +{ + _WS1__invokeEtl *_p = ::soap_new__WS1__invokeEtl(soap); + if (_p) + { _p->soap_default(soap); + _p->_WS1__invokeEtl::in0 = in0; + } + return _p; +} + +inline int soap_write__WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtl", p->soap_type() == SOAP_TYPE__WS1__invokeEtl ? "" : NULL) || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT__WS1__invokeEtl(struct soap *soap, const char *URL, _WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtl", p->soap_type() == SOAP_TYPE__WS1__invokeEtl ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__WS1__invokeEtl(struct soap *soap, const char *URL, _WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtl", p->soap_type() == SOAP_TYPE__WS1__invokeEtl ? "" : NULL) || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__WS1__invokeEtl(struct soap *soap, const char *URL, _WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (p->soap_serialize(soap), 0) || p->soap_put(soap, "WS1:invokeEtl", p->soap_type() == SOAP_TYPE__WS1__invokeEtl ? "" : NULL) || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 _WS1__invokeEtl * SOAP_FMAC4 soap_get__WS1__invokeEtl(struct soap*, _WS1__invokeEtl *, const char*, const char*); + +inline int soap_read__WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl *p) +{ + if (p) + { p->soap_default(soap); + if (soap_begin_recv(soap) || ::soap_get__WS1__invokeEtl(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__WS1__invokeEtl(struct soap *soap, const char *URL, _WS1__invokeEtl *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__WS1__invokeEtl(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__WS1__invokeEtl(struct soap *soap, _WS1__invokeEtl *p) +{ + if (::soap_read__WS1__invokeEtl(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Fault_DEFINED +#define SOAP_TYPE_SOAP_ENV__Fault_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Fault(struct soap*, const char*, int, const struct SOAP_ENV__Fault *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_in_SOAP_ENV__Fault(struct soap*, const char*, struct SOAP_ENV__Fault *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Fault * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Fault * soap_new_SOAP_ENV__Fault(struct soap *soap, int n = -1) +{ + return cross_instantiate_SOAP_ENV__Fault(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Fault * soap_new_req_SOAP_ENV__Fault( + struct soap *soap) +{ + struct SOAP_ENV__Fault *_p = ::soap_new_SOAP_ENV__Fault(soap); + if (_p) + { ::soap_default_SOAP_ENV__Fault(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Fault * soap_new_set_SOAP_ENV__Fault( + struct soap *soap, + char *faultcode, + char *faultstring, + char *faultactor, + struct SOAP_ENV__Detail *detail, + struct SOAP_ENV__Code *SOAP_ENV__Code, + struct SOAP_ENV__Reason *SOAP_ENV__Reason, + char *SOAP_ENV__Node, + char *SOAP_ENV__Role, + struct SOAP_ENV__Detail *SOAP_ENV__Detail) +{ + struct SOAP_ENV__Fault *_p = ::soap_new_SOAP_ENV__Fault(soap); + if (_p) + { ::soap_default_SOAP_ENV__Fault(soap, _p); + _p->faultcode = faultcode; + _p->faultstring = faultstring; + _p->faultactor = faultactor; + _p->detail = detail; + _p->SOAP_ENV__Code = SOAP_ENV__Code; + _p->SOAP_ENV__Reason = SOAP_ENV__Reason; + _p->SOAP_ENV__Node = SOAP_ENV__Node; + _p->SOAP_ENV__Role = SOAP_ENV__Role; + _p->SOAP_ENV__Detail = SOAP_ENV__Detail; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Fault(struct soap*, const struct SOAP_ENV__Fault *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Fault(soap, p), 0) || ::soap_put_SOAP_ENV__Fault(soap, p, "SOAP-ENV:Fault", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Fault * SOAP_FMAC4 soap_get_SOAP_ENV__Fault(struct soap*, struct SOAP_ENV__Fault *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Fault(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Fault(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Fault(struct soap *soap, const char *URL, struct SOAP_ENV__Fault *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Fault(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p) +{ + if (::soap_read_SOAP_ENV__Fault(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Reason_DEFINED +#define SOAP_TYPE_SOAP_ENV__Reason_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Reason(struct soap*, const char*, int, const struct SOAP_ENV__Reason *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_in_SOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Reason * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Reason * soap_new_SOAP_ENV__Reason(struct soap *soap, int n = -1) +{ + return cross_instantiate_SOAP_ENV__Reason(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Reason * soap_new_req_SOAP_ENV__Reason( + struct soap *soap) +{ + struct SOAP_ENV__Reason *_p = ::soap_new_SOAP_ENV__Reason(soap); + if (_p) + { ::soap_default_SOAP_ENV__Reason(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Reason * soap_new_set_SOAP_ENV__Reason( + struct soap *soap, + char *SOAP_ENV__Text) +{ + struct SOAP_ENV__Reason *_p = ::soap_new_SOAP_ENV__Reason(soap); + if (_p) + { ::soap_default_SOAP_ENV__Reason(soap, _p); + _p->SOAP_ENV__Text = SOAP_ENV__Text; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Reason(struct soap*, const struct SOAP_ENV__Reason *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Reason(soap, p), 0) || ::soap_put_SOAP_ENV__Reason(soap, p, "SOAP-ENV:Reason", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Reason * SOAP_FMAC4 soap_get_SOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Reason(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Reason(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Reason(struct soap *soap, const char *URL, struct SOAP_ENV__Reason *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Reason(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *p) +{ + if (::soap_read_SOAP_ENV__Reason(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Detail_DEFINED +#define SOAP_TYPE_SOAP_ENV__Detail_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Detail(struct soap*, const char*, int, const struct SOAP_ENV__Detail *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_in_SOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Detail * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Detail * soap_new_SOAP_ENV__Detail(struct soap *soap, int n = -1) +{ + return cross_instantiate_SOAP_ENV__Detail(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Detail * soap_new_req_SOAP_ENV__Detail( + struct soap *soap, + int __type, + void *fault) +{ + struct SOAP_ENV__Detail *_p = ::soap_new_SOAP_ENV__Detail(soap); + if (_p) + { ::soap_default_SOAP_ENV__Detail(soap, _p); + _p->__type = __type; + _p->fault = fault; + } + return _p; +} + +inline struct SOAP_ENV__Detail * soap_new_set_SOAP_ENV__Detail( + struct soap *soap, + char *__any, + int __type, + void *fault) +{ + struct SOAP_ENV__Detail *_p = ::soap_new_SOAP_ENV__Detail(soap); + if (_p) + { ::soap_default_SOAP_ENV__Detail(soap, _p); + _p->__any = __any; + _p->__type = __type; + _p->fault = fault; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Detail(struct soap*, const struct SOAP_ENV__Detail *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Detail(soap, p), 0) || ::soap_put_SOAP_ENV__Detail(soap, p, "SOAP-ENV:Detail", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Detail * SOAP_FMAC4 soap_get_SOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Detail(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Detail(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Detail(struct soap *soap, const char *URL, struct SOAP_ENV__Detail *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Detail(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *p) +{ + if (::soap_read_SOAP_ENV__Detail(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Code_DEFINED +#define SOAP_TYPE_SOAP_ENV__Code_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Code(struct soap*, const char*, int, const struct SOAP_ENV__Code *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_in_SOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Code * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n = -1) +{ + return cross_instantiate_SOAP_ENV__Code(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Code * soap_new_req_SOAP_ENV__Code( + struct soap *soap) +{ + struct SOAP_ENV__Code *_p = ::soap_new_SOAP_ENV__Code(soap); + if (_p) + { ::soap_default_SOAP_ENV__Code(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Code * soap_new_set_SOAP_ENV__Code( + struct soap *soap, + char *SOAP_ENV__Value, + struct SOAP_ENV__Code *SOAP_ENV__Subcode) +{ + struct SOAP_ENV__Code *_p = ::soap_new_SOAP_ENV__Code(soap); + if (_p) + { ::soap_default_SOAP_ENV__Code(soap, _p); + _p->SOAP_ENV__Value = SOAP_ENV__Value; + _p->SOAP_ENV__Subcode = SOAP_ENV__Subcode; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Code(struct soap*, const struct SOAP_ENV__Code *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Code(soap, p), 0) || ::soap_put_SOAP_ENV__Code(soap, p, "SOAP-ENV:Code", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Code * SOAP_FMAC4 soap_get_SOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Code(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Code(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Code(struct soap *soap, const char *URL, struct SOAP_ENV__Code *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Code(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *p) +{ + if (::soap_read_SOAP_ENV__Code(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_SOAP_ENV__Header_DEFINED +#define SOAP_TYPE_SOAP_ENV__Header_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap*, const char*, int, const struct SOAP_ENV__Header *, const char*); +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_in_SOAP_ENV__Header(struct soap*, const char*, struct SOAP_ENV__Header *, const char*); +SOAP_FMAC1 struct SOAP_ENV__Header * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*); + +inline struct SOAP_ENV__Header * soap_new_SOAP_ENV__Header(struct soap *soap, int n = -1) +{ + return cross_instantiate_SOAP_ENV__Header(soap, n, NULL, NULL, NULL); +} + +inline struct SOAP_ENV__Header * soap_new_req_SOAP_ENV__Header( + struct soap *soap) +{ + struct SOAP_ENV__Header *_p = ::soap_new_SOAP_ENV__Header(soap); + if (_p) + { ::soap_default_SOAP_ENV__Header(soap, _p); + } + return _p; +} + +inline struct SOAP_ENV__Header * soap_new_set_SOAP_ENV__Header( + struct soap *soap) +{ + struct SOAP_ENV__Header *_p = ::soap_new_SOAP_ENV__Header(soap); + if (_p) + { ::soap_default_SOAP_ENV__Header(soap, _p); + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put_SOAP_ENV__Header(struct soap*, const struct SOAP_ENV__Header *, const char*, const char*); + +inline int soap_write_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize_SOAP_ENV__Header(soap, p), 0) || ::soap_put_SOAP_ENV__Header(soap, p, "SOAP-ENV:Header", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct SOAP_ENV__Header * SOAP_FMAC4 soap_get_SOAP_ENV__Header(struct soap*, struct SOAP_ENV__Header *, const char*, const char*); + +inline int soap_read_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) +{ + if (p) + { ::soap_default_SOAP_ENV__Header(soap, p); + if (soap_begin_recv(soap) || ::soap_get_SOAP_ENV__Header(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_SOAP_ENV__Header(struct soap *soap, const char *URL, struct SOAP_ENV__Header *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_SOAP_ENV__Header(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *p) +{ + if (::soap_read_SOAP_ENV__Header(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +#ifndef SOAP_TYPE___WS1__escrowResendSrv_DEFINED +#define SOAP_TYPE___WS1__escrowResendSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__escrowResendSrv(struct soap*, struct __WS1__escrowResendSrv *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__escrowResendSrv(struct soap*, const struct __WS1__escrowResendSrv *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__escrowResendSrv(struct soap*, const char*, int, const struct __WS1__escrowResendSrv *, const char*); +SOAP_FMAC3 struct __WS1__escrowResendSrv * SOAP_FMAC4 soap_in___WS1__escrowResendSrv(struct soap*, const char*, struct __WS1__escrowResendSrv *, const char*); +SOAP_FMAC1 struct __WS1__escrowResendSrv * SOAP_FMAC2 cross_instantiate___WS1__escrowResendSrv(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__escrowResendSrv * soap_new___WS1__escrowResendSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__escrowResendSrv(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__escrowResendSrv * soap_new_req___WS1__escrowResendSrv( + struct soap *soap) +{ + struct __WS1__escrowResendSrv *_p = ::soap_new___WS1__escrowResendSrv(soap); + if (_p) + { ::soap_default___WS1__escrowResendSrv(soap, _p); + } + return _p; +} + +inline struct __WS1__escrowResendSrv * soap_new_set___WS1__escrowResendSrv( + struct soap *soap, + _WS1__escrowResendSrv *WS1__escrowResendSrv) +{ + struct __WS1__escrowResendSrv *_p = ::soap_new___WS1__escrowResendSrv(soap); + if (_p) + { ::soap_default___WS1__escrowResendSrv(soap, _p); + _p->WS1__escrowResendSrv = WS1__escrowResendSrv; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__escrowResendSrv(struct soap*, const struct __WS1__escrowResendSrv *, const char*, const char*); + +inline int soap_write___WS1__escrowResendSrv(struct soap *soap, struct __WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__escrowResendSrv(soap, p), 0) || ::soap_put___WS1__escrowResendSrv(soap, p, "-WS1:escrowResendSrv", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__escrowResendSrv(struct soap *soap, const char *URL, struct __WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__escrowResendSrv(soap, p), 0) || ::soap_put___WS1__escrowResendSrv(soap, p, "-WS1:escrowResendSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__escrowResendSrv(struct soap *soap, const char *URL, struct __WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__escrowResendSrv(soap, p), 0) || ::soap_put___WS1__escrowResendSrv(soap, p, "-WS1:escrowResendSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__escrowResendSrv(struct soap *soap, const char *URL, struct __WS1__escrowResendSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__escrowResendSrv(soap, p), 0) || ::soap_put___WS1__escrowResendSrv(soap, p, "-WS1:escrowResendSrv", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__escrowResendSrv * SOAP_FMAC4 soap_get___WS1__escrowResendSrv(struct soap*, struct __WS1__escrowResendSrv *, const char*, const char*); + +inline int soap_read___WS1__escrowResendSrv(struct soap *soap, struct __WS1__escrowResendSrv *p) +{ + if (p) + { ::soap_default___WS1__escrowResendSrv(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__escrowResendSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__escrowResendSrv(struct soap *soap, const char *URL, struct __WS1__escrowResendSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__escrowResendSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__escrowResendSrv(struct soap *soap, struct __WS1__escrowResendSrv *p) +{ + if (::soap_read___WS1__escrowResendSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__invokeSrv_DEFINED +#define SOAP_TYPE___WS1__invokeSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeSrv(struct soap*, struct __WS1__invokeSrv *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeSrv(struct soap*, const struct __WS1__invokeSrv *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeSrv(struct soap*, const char*, int, const struct __WS1__invokeSrv *, const char*); +SOAP_FMAC3 struct __WS1__invokeSrv * SOAP_FMAC4 soap_in___WS1__invokeSrv(struct soap*, const char*, struct __WS1__invokeSrv *, const char*); +SOAP_FMAC1 struct __WS1__invokeSrv * SOAP_FMAC2 cross_instantiate___WS1__invokeSrv(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__invokeSrv * soap_new___WS1__invokeSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__invokeSrv(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__invokeSrv * soap_new_req___WS1__invokeSrv( + struct soap *soap) +{ + struct __WS1__invokeSrv *_p = ::soap_new___WS1__invokeSrv(soap); + if (_p) + { ::soap_default___WS1__invokeSrv(soap, _p); + } + return _p; +} + +inline struct __WS1__invokeSrv * soap_new_set___WS1__invokeSrv( + struct soap *soap, + _WS1__invokeSrv *WS1__invokeSrv) +{ + struct __WS1__invokeSrv *_p = ::soap_new___WS1__invokeSrv(soap); + if (_p) + { ::soap_default___WS1__invokeSrv(soap, _p); + _p->WS1__invokeSrv = WS1__invokeSrv; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeSrv(struct soap*, const struct __WS1__invokeSrv *, const char*, const char*); + +inline int soap_write___WS1__invokeSrv(struct soap *soap, struct __WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__invokeSrv(soap, p), 0) || ::soap_put___WS1__invokeSrv(soap, p, "-WS1:invokeSrv", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__invokeSrv(struct soap *soap, const char *URL, struct __WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeSrv(soap, p), 0) || ::soap_put___WS1__invokeSrv(soap, p, "-WS1:invokeSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__invokeSrv(struct soap *soap, const char *URL, struct __WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeSrv(soap, p), 0) || ::soap_put___WS1__invokeSrv(soap, p, "-WS1:invokeSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__invokeSrv(struct soap *soap, const char *URL, struct __WS1__invokeSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeSrv(soap, p), 0) || ::soap_put___WS1__invokeSrv(soap, p, "-WS1:invokeSrv", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__invokeSrv * SOAP_FMAC4 soap_get___WS1__invokeSrv(struct soap*, struct __WS1__invokeSrv *, const char*, const char*); + +inline int soap_read___WS1__invokeSrv(struct soap *soap, struct __WS1__invokeSrv *p) +{ + if (p) + { ::soap_default___WS1__invokeSrv(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__invokeSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__invokeSrv(struct soap *soap, const char *URL, struct __WS1__invokeSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__invokeSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__invokeSrv(struct soap *soap, struct __WS1__invokeSrv *p) +{ + if (::soap_read___WS1__invokeSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__regEAI_DEFINED +#define SOAP_TYPE___WS1__regEAI_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__regEAI(struct soap*, struct __WS1__regEAI *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__regEAI(struct soap*, const struct __WS1__regEAI *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__regEAI(struct soap*, const char*, int, const struct __WS1__regEAI *, const char*); +SOAP_FMAC3 struct __WS1__regEAI * SOAP_FMAC4 soap_in___WS1__regEAI(struct soap*, const char*, struct __WS1__regEAI *, const char*); +SOAP_FMAC1 struct __WS1__regEAI * SOAP_FMAC2 cross_instantiate___WS1__regEAI(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__regEAI * soap_new___WS1__regEAI(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__regEAI(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__regEAI * soap_new_req___WS1__regEAI( + struct soap *soap) +{ + struct __WS1__regEAI *_p = ::soap_new___WS1__regEAI(soap); + if (_p) + { ::soap_default___WS1__regEAI(soap, _p); + } + return _p; +} + +inline struct __WS1__regEAI * soap_new_set___WS1__regEAI( + struct soap *soap, + _WS1__regEAI *WS1__regEAI) +{ + struct __WS1__regEAI *_p = ::soap_new___WS1__regEAI(soap); + if (_p) + { ::soap_default___WS1__regEAI(soap, _p); + _p->WS1__regEAI = WS1__regEAI; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__regEAI(struct soap*, const struct __WS1__regEAI *, const char*, const char*); + +inline int soap_write___WS1__regEAI(struct soap *soap, struct __WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__regEAI(soap, p), 0) || ::soap_put___WS1__regEAI(soap, p, "-WS1:regEAI", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__regEAI(struct soap *soap, const char *URL, struct __WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regEAI(soap, p), 0) || ::soap_put___WS1__regEAI(soap, p, "-WS1:regEAI", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__regEAI(struct soap *soap, const char *URL, struct __WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regEAI(soap, p), 0) || ::soap_put___WS1__regEAI(soap, p, "-WS1:regEAI", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__regEAI(struct soap *soap, const char *URL, struct __WS1__regEAI const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regEAI(soap, p), 0) || ::soap_put___WS1__regEAI(soap, p, "-WS1:regEAI", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__regEAI * SOAP_FMAC4 soap_get___WS1__regEAI(struct soap*, struct __WS1__regEAI *, const char*, const char*); + +inline int soap_read___WS1__regEAI(struct soap *soap, struct __WS1__regEAI *p) +{ + if (p) + { ::soap_default___WS1__regEAI(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__regEAI(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__regEAI(struct soap *soap, const char *URL, struct __WS1__regEAI *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__regEAI(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__regEAI(struct soap *soap, struct __WS1__regEAI *p) +{ + if (::soap_read___WS1__regEAI(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__regSrv_DEFINED +#define SOAP_TYPE___WS1__regSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__regSrv(struct soap*, struct __WS1__regSrv *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__regSrv(struct soap*, const struct __WS1__regSrv *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__regSrv(struct soap*, const char*, int, const struct __WS1__regSrv *, const char*); +SOAP_FMAC3 struct __WS1__regSrv * SOAP_FMAC4 soap_in___WS1__regSrv(struct soap*, const char*, struct __WS1__regSrv *, const char*); +SOAP_FMAC1 struct __WS1__regSrv * SOAP_FMAC2 cross_instantiate___WS1__regSrv(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__regSrv * soap_new___WS1__regSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__regSrv(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__regSrv * soap_new_req___WS1__regSrv( + struct soap *soap) +{ + struct __WS1__regSrv *_p = ::soap_new___WS1__regSrv(soap); + if (_p) + { ::soap_default___WS1__regSrv(soap, _p); + } + return _p; +} + +inline struct __WS1__regSrv * soap_new_set___WS1__regSrv( + struct soap *soap, + _WS1__regSrv *WS1__regSrv) +{ + struct __WS1__regSrv *_p = ::soap_new___WS1__regSrv(soap); + if (_p) + { ::soap_default___WS1__regSrv(soap, _p); + _p->WS1__regSrv = WS1__regSrv; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__regSrv(struct soap*, const struct __WS1__regSrv *, const char*, const char*); + +inline int soap_write___WS1__regSrv(struct soap *soap, struct __WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__regSrv(soap, p), 0) || ::soap_put___WS1__regSrv(soap, p, "-WS1:regSrv", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__regSrv(struct soap *soap, const char *URL, struct __WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regSrv(soap, p), 0) || ::soap_put___WS1__regSrv(soap, p, "-WS1:regSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__regSrv(struct soap *soap, const char *URL, struct __WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regSrv(soap, p), 0) || ::soap_put___WS1__regSrv(soap, p, "-WS1:regSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__regSrv(struct soap *soap, const char *URL, struct __WS1__regSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regSrv(soap, p), 0) || ::soap_put___WS1__regSrv(soap, p, "-WS1:regSrv", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__regSrv * SOAP_FMAC4 soap_get___WS1__regSrv(struct soap*, struct __WS1__regSrv *, const char*, const char*); + +inline int soap_read___WS1__regSrv(struct soap *soap, struct __WS1__regSrv *p) +{ + if (p) + { ::soap_default___WS1__regSrv(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__regSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__regSrv(struct soap *soap, const char *URL, struct __WS1__regSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__regSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__regSrv(struct soap *soap, struct __WS1__regSrv *p) +{ + if (::soap_read___WS1__regSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getStandardDataNameList_DEFINED +#define SOAP_TYPE___WS1__getStandardDataNameList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getStandardDataNameList(struct soap*, struct __WS1__getStandardDataNameList *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getStandardDataNameList(struct soap*, const struct __WS1__getStandardDataNameList *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getStandardDataNameList(struct soap*, const char*, int, const struct __WS1__getStandardDataNameList *, const char*); +SOAP_FMAC3 struct __WS1__getStandardDataNameList * SOAP_FMAC4 soap_in___WS1__getStandardDataNameList(struct soap*, const char*, struct __WS1__getStandardDataNameList *, const char*); +SOAP_FMAC1 struct __WS1__getStandardDataNameList * SOAP_FMAC2 cross_instantiate___WS1__getStandardDataNameList(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getStandardDataNameList * soap_new___WS1__getStandardDataNameList(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getStandardDataNameList(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getStandardDataNameList * soap_new_req___WS1__getStandardDataNameList( + struct soap *soap) +{ + struct __WS1__getStandardDataNameList *_p = ::soap_new___WS1__getStandardDataNameList(soap); + if (_p) + { ::soap_default___WS1__getStandardDataNameList(soap, _p); + } + return _p; +} + +inline struct __WS1__getStandardDataNameList * soap_new_set___WS1__getStandardDataNameList( + struct soap *soap, + _WS1__getStandardDataNameList *WS1__getStandardDataNameList) +{ + struct __WS1__getStandardDataNameList *_p = ::soap_new___WS1__getStandardDataNameList(soap); + if (_p) + { ::soap_default___WS1__getStandardDataNameList(soap, _p); + _p->WS1__getStandardDataNameList = WS1__getStandardDataNameList; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getStandardDataNameList(struct soap*, const struct __WS1__getStandardDataNameList *, const char*, const char*); + +inline int soap_write___WS1__getStandardDataNameList(struct soap *soap, struct __WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getStandardDataNameList(soap, p), 0) || ::soap_put___WS1__getStandardDataNameList(soap, p, "-WS1:getStandardDataNameList", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getStandardDataNameList(struct soap *soap, const char *URL, struct __WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getStandardDataNameList(soap, p), 0) || ::soap_put___WS1__getStandardDataNameList(soap, p, "-WS1:getStandardDataNameList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getStandardDataNameList(struct soap *soap, const char *URL, struct __WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getStandardDataNameList(soap, p), 0) || ::soap_put___WS1__getStandardDataNameList(soap, p, "-WS1:getStandardDataNameList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getStandardDataNameList(struct soap *soap, const char *URL, struct __WS1__getStandardDataNameList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getStandardDataNameList(soap, p), 0) || ::soap_put___WS1__getStandardDataNameList(soap, p, "-WS1:getStandardDataNameList", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getStandardDataNameList * SOAP_FMAC4 soap_get___WS1__getStandardDataNameList(struct soap*, struct __WS1__getStandardDataNameList *, const char*, const char*); + +inline int soap_read___WS1__getStandardDataNameList(struct soap *soap, struct __WS1__getStandardDataNameList *p) +{ + if (p) + { ::soap_default___WS1__getStandardDataNameList(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getStandardDataNameList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getStandardDataNameList(struct soap *soap, const char *URL, struct __WS1__getStandardDataNameList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getStandardDataNameList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getStandardDataNameList(struct soap *soap, struct __WS1__getStandardDataNameList *p) +{ + if (::soap_read___WS1__getStandardDataNameList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getStandardServiceList_DEFINED +#define SOAP_TYPE___WS1__getStandardServiceList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getStandardServiceList(struct soap*, struct __WS1__getStandardServiceList *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getStandardServiceList(struct soap*, const struct __WS1__getStandardServiceList *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getStandardServiceList(struct soap*, const char*, int, const struct __WS1__getStandardServiceList *, const char*); +SOAP_FMAC3 struct __WS1__getStandardServiceList * SOAP_FMAC4 soap_in___WS1__getStandardServiceList(struct soap*, const char*, struct __WS1__getStandardServiceList *, const char*); +SOAP_FMAC1 struct __WS1__getStandardServiceList * SOAP_FMAC2 cross_instantiate___WS1__getStandardServiceList(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getStandardServiceList * soap_new___WS1__getStandardServiceList(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getStandardServiceList(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getStandardServiceList * soap_new_req___WS1__getStandardServiceList( + struct soap *soap) +{ + struct __WS1__getStandardServiceList *_p = ::soap_new___WS1__getStandardServiceList(soap); + if (_p) + { ::soap_default___WS1__getStandardServiceList(soap, _p); + } + return _p; +} + +inline struct __WS1__getStandardServiceList * soap_new_set___WS1__getStandardServiceList( + struct soap *soap, + _WS1__getStandardServiceList *WS1__getStandardServiceList) +{ + struct __WS1__getStandardServiceList *_p = ::soap_new___WS1__getStandardServiceList(soap); + if (_p) + { ::soap_default___WS1__getStandardServiceList(soap, _p); + _p->WS1__getStandardServiceList = WS1__getStandardServiceList; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getStandardServiceList(struct soap*, const struct __WS1__getStandardServiceList *, const char*, const char*); + +inline int soap_write___WS1__getStandardServiceList(struct soap *soap, struct __WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getStandardServiceList(soap, p), 0) || ::soap_put___WS1__getStandardServiceList(soap, p, "-WS1:getStandardServiceList", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getStandardServiceList(struct soap *soap, const char *URL, struct __WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getStandardServiceList(soap, p), 0) || ::soap_put___WS1__getStandardServiceList(soap, p, "-WS1:getStandardServiceList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getStandardServiceList(struct soap *soap, const char *URL, struct __WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getStandardServiceList(soap, p), 0) || ::soap_put___WS1__getStandardServiceList(soap, p, "-WS1:getStandardServiceList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getStandardServiceList(struct soap *soap, const char *URL, struct __WS1__getStandardServiceList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getStandardServiceList(soap, p), 0) || ::soap_put___WS1__getStandardServiceList(soap, p, "-WS1:getStandardServiceList", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getStandardServiceList * SOAP_FMAC4 soap_get___WS1__getStandardServiceList(struct soap*, struct __WS1__getStandardServiceList *, const char*, const char*); + +inline int soap_read___WS1__getStandardServiceList(struct soap *soap, struct __WS1__getStandardServiceList *p) +{ + if (p) + { ::soap_default___WS1__getStandardServiceList(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getStandardServiceList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getStandardServiceList(struct soap *soap, const char *URL, struct __WS1__getStandardServiceList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getStandardServiceList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getStandardServiceList(struct soap *soap, struct __WS1__getStandardServiceList *p) +{ + if (::soap_read___WS1__getStandardServiceList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__fpInvoke_DEFINED +#define SOAP_TYPE___WS1__fpInvoke_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__fpInvoke(struct soap*, struct __WS1__fpInvoke *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__fpInvoke(struct soap*, const struct __WS1__fpInvoke *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__fpInvoke(struct soap*, const char*, int, const struct __WS1__fpInvoke *, const char*); +SOAP_FMAC3 struct __WS1__fpInvoke * SOAP_FMAC4 soap_in___WS1__fpInvoke(struct soap*, const char*, struct __WS1__fpInvoke *, const char*); +SOAP_FMAC1 struct __WS1__fpInvoke * SOAP_FMAC2 cross_instantiate___WS1__fpInvoke(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__fpInvoke * soap_new___WS1__fpInvoke(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__fpInvoke(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__fpInvoke * soap_new_req___WS1__fpInvoke( + struct soap *soap) +{ + struct __WS1__fpInvoke *_p = ::soap_new___WS1__fpInvoke(soap); + if (_p) + { ::soap_default___WS1__fpInvoke(soap, _p); + } + return _p; +} + +inline struct __WS1__fpInvoke * soap_new_set___WS1__fpInvoke( + struct soap *soap, + _WS1__fpInvoke *WS1__fpInvoke) +{ + struct __WS1__fpInvoke *_p = ::soap_new___WS1__fpInvoke(soap); + if (_p) + { ::soap_default___WS1__fpInvoke(soap, _p); + _p->WS1__fpInvoke = WS1__fpInvoke; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__fpInvoke(struct soap*, const struct __WS1__fpInvoke *, const char*, const char*); + +inline int soap_write___WS1__fpInvoke(struct soap *soap, struct __WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__fpInvoke(soap, p), 0) || ::soap_put___WS1__fpInvoke(soap, p, "-WS1:fpInvoke", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__fpInvoke(struct soap *soap, const char *URL, struct __WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__fpInvoke(soap, p), 0) || ::soap_put___WS1__fpInvoke(soap, p, "-WS1:fpInvoke", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__fpInvoke(struct soap *soap, const char *URL, struct __WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__fpInvoke(soap, p), 0) || ::soap_put___WS1__fpInvoke(soap, p, "-WS1:fpInvoke", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__fpInvoke(struct soap *soap, const char *URL, struct __WS1__fpInvoke const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__fpInvoke(soap, p), 0) || ::soap_put___WS1__fpInvoke(soap, p, "-WS1:fpInvoke", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__fpInvoke * SOAP_FMAC4 soap_get___WS1__fpInvoke(struct soap*, struct __WS1__fpInvoke *, const char*, const char*); + +inline int soap_read___WS1__fpInvoke(struct soap *soap, struct __WS1__fpInvoke *p) +{ + if (p) + { ::soap_default___WS1__fpInvoke(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__fpInvoke(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__fpInvoke(struct soap *soap, const char *URL, struct __WS1__fpInvoke *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__fpInvoke(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__fpInvoke(struct soap *soap, struct __WS1__fpInvoke *p) +{ + if (::soap_read___WS1__fpInvoke(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getSrv_DEFINED +#define SOAP_TYPE___WS1__getSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getSrv(struct soap*, struct __WS1__getSrv *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getSrv(struct soap*, const struct __WS1__getSrv *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getSrv(struct soap*, const char*, int, const struct __WS1__getSrv *, const char*); +SOAP_FMAC3 struct __WS1__getSrv * SOAP_FMAC4 soap_in___WS1__getSrv(struct soap*, const char*, struct __WS1__getSrv *, const char*); +SOAP_FMAC1 struct __WS1__getSrv * SOAP_FMAC2 cross_instantiate___WS1__getSrv(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getSrv * soap_new___WS1__getSrv(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getSrv(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getSrv * soap_new_req___WS1__getSrv( + struct soap *soap) +{ + struct __WS1__getSrv *_p = ::soap_new___WS1__getSrv(soap); + if (_p) + { ::soap_default___WS1__getSrv(soap, _p); + } + return _p; +} + +inline struct __WS1__getSrv * soap_new_set___WS1__getSrv( + struct soap *soap, + _WS1__getSrv *WS1__getSrv) +{ + struct __WS1__getSrv *_p = ::soap_new___WS1__getSrv(soap); + if (_p) + { ::soap_default___WS1__getSrv(soap, _p); + _p->WS1__getSrv = WS1__getSrv; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getSrv(struct soap*, const struct __WS1__getSrv *, const char*, const char*); + +inline int soap_write___WS1__getSrv(struct soap *soap, struct __WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getSrv(soap, p), 0) || ::soap_put___WS1__getSrv(soap, p, "-WS1:getSrv", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getSrv(struct soap *soap, const char *URL, struct __WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getSrv(soap, p), 0) || ::soap_put___WS1__getSrv(soap, p, "-WS1:getSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getSrv(struct soap *soap, const char *URL, struct __WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getSrv(soap, p), 0) || ::soap_put___WS1__getSrv(soap, p, "-WS1:getSrv", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getSrv(struct soap *soap, const char *URL, struct __WS1__getSrv const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getSrv(soap, p), 0) || ::soap_put___WS1__getSrv(soap, p, "-WS1:getSrv", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getSrv * SOAP_FMAC4 soap_get___WS1__getSrv(struct soap*, struct __WS1__getSrv *, const char*, const char*); + +inline int soap_read___WS1__getSrv(struct soap *soap, struct __WS1__getSrv *p) +{ + if (p) + { ::soap_default___WS1__getSrv(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getSrv(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getSrv(struct soap *soap, const char *URL, struct __WS1__getSrv *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getSrv(struct soap *soap, struct __WS1__getSrv *p) +{ + if (::soap_read___WS1__getSrv(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getProd_DEFINED +#define SOAP_TYPE___WS1__getProd_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getProd(struct soap*, struct __WS1__getProd *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getProd(struct soap*, const struct __WS1__getProd *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getProd(struct soap*, const char*, int, const struct __WS1__getProd *, const char*); +SOAP_FMAC3 struct __WS1__getProd * SOAP_FMAC4 soap_in___WS1__getProd(struct soap*, const char*, struct __WS1__getProd *, const char*); +SOAP_FMAC1 struct __WS1__getProd * SOAP_FMAC2 cross_instantiate___WS1__getProd(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getProd * soap_new___WS1__getProd(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getProd(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getProd * soap_new_req___WS1__getProd( + struct soap *soap) +{ + struct __WS1__getProd *_p = ::soap_new___WS1__getProd(soap); + if (_p) + { ::soap_default___WS1__getProd(soap, _p); + } + return _p; +} + +inline struct __WS1__getProd * soap_new_set___WS1__getProd( + struct soap *soap, + _WS1__getProd *WS1__getProd) +{ + struct __WS1__getProd *_p = ::soap_new___WS1__getProd(soap); + if (_p) + { ::soap_default___WS1__getProd(soap, _p); + _p->WS1__getProd = WS1__getProd; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getProd(struct soap*, const struct __WS1__getProd *, const char*, const char*); + +inline int soap_write___WS1__getProd(struct soap *soap, struct __WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getProd(soap, p), 0) || ::soap_put___WS1__getProd(soap, p, "-WS1:getProd", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getProd(struct soap *soap, const char *URL, struct __WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getProd(soap, p), 0) || ::soap_put___WS1__getProd(soap, p, "-WS1:getProd", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getProd(struct soap *soap, const char *URL, struct __WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getProd(soap, p), 0) || ::soap_put___WS1__getProd(soap, p, "-WS1:getProd", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getProd(struct soap *soap, const char *URL, struct __WS1__getProd const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getProd(soap, p), 0) || ::soap_put___WS1__getProd(soap, p, "-WS1:getProd", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getProd * SOAP_FMAC4 soap_get___WS1__getProd(struct soap*, struct __WS1__getProd *, const char*, const char*); + +inline int soap_read___WS1__getProd(struct soap *soap, struct __WS1__getProd *p) +{ + if (p) + { ::soap_default___WS1__getProd(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getProd(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getProd(struct soap *soap, const char *URL, struct __WS1__getProd *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getProd(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getProd(struct soap *soap, struct __WS1__getProd *p) +{ + if (::soap_read___WS1__getProd(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__invokeMdm_DEFINED +#define SOAP_TYPE___WS1__invokeMdm_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeMdm(struct soap*, struct __WS1__invokeMdm *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeMdm(struct soap*, const struct __WS1__invokeMdm *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeMdm(struct soap*, const char*, int, const struct __WS1__invokeMdm *, const char*); +SOAP_FMAC3 struct __WS1__invokeMdm * SOAP_FMAC4 soap_in___WS1__invokeMdm(struct soap*, const char*, struct __WS1__invokeMdm *, const char*); +SOAP_FMAC1 struct __WS1__invokeMdm * SOAP_FMAC2 cross_instantiate___WS1__invokeMdm(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__invokeMdm * soap_new___WS1__invokeMdm(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__invokeMdm(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__invokeMdm * soap_new_req___WS1__invokeMdm( + struct soap *soap) +{ + struct __WS1__invokeMdm *_p = ::soap_new___WS1__invokeMdm(soap); + if (_p) + { ::soap_default___WS1__invokeMdm(soap, _p); + } + return _p; +} + +inline struct __WS1__invokeMdm * soap_new_set___WS1__invokeMdm( + struct soap *soap, + _WS1__invokeMdm *WS1__invokeMdm) +{ + struct __WS1__invokeMdm *_p = ::soap_new___WS1__invokeMdm(soap); + if (_p) + { ::soap_default___WS1__invokeMdm(soap, _p); + _p->WS1__invokeMdm = WS1__invokeMdm; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeMdm(struct soap*, const struct __WS1__invokeMdm *, const char*, const char*); + +inline int soap_write___WS1__invokeMdm(struct soap *soap, struct __WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__invokeMdm(soap, p), 0) || ::soap_put___WS1__invokeMdm(soap, p, "-WS1:invokeMdm", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__invokeMdm(struct soap *soap, const char *URL, struct __WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeMdm(soap, p), 0) || ::soap_put___WS1__invokeMdm(soap, p, "-WS1:invokeMdm", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__invokeMdm(struct soap *soap, const char *URL, struct __WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeMdm(soap, p), 0) || ::soap_put___WS1__invokeMdm(soap, p, "-WS1:invokeMdm", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__invokeMdm(struct soap *soap, const char *URL, struct __WS1__invokeMdm const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeMdm(soap, p), 0) || ::soap_put___WS1__invokeMdm(soap, p, "-WS1:invokeMdm", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__invokeMdm * SOAP_FMAC4 soap_get___WS1__invokeMdm(struct soap*, struct __WS1__invokeMdm *, const char*, const char*); + +inline int soap_read___WS1__invokeMdm(struct soap *soap, struct __WS1__invokeMdm *p) +{ + if (p) + { ::soap_default___WS1__invokeMdm(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__invokeMdm(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__invokeMdm(struct soap *soap, const char *URL, struct __WS1__invokeMdm *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__invokeMdm(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__invokeMdm(struct soap *soap, struct __WS1__invokeMdm *p) +{ + if (::soap_read___WS1__invokeMdm(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__invokeUnion_DEFINED +#define SOAP_TYPE___WS1__invokeUnion_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeUnion(struct soap*, struct __WS1__invokeUnion *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeUnion(struct soap*, const struct __WS1__invokeUnion *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeUnion(struct soap*, const char*, int, const struct __WS1__invokeUnion *, const char*); +SOAP_FMAC3 struct __WS1__invokeUnion * SOAP_FMAC4 soap_in___WS1__invokeUnion(struct soap*, const char*, struct __WS1__invokeUnion *, const char*); +SOAP_FMAC1 struct __WS1__invokeUnion * SOAP_FMAC2 cross_instantiate___WS1__invokeUnion(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__invokeUnion * soap_new___WS1__invokeUnion(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__invokeUnion(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__invokeUnion * soap_new_req___WS1__invokeUnion( + struct soap *soap) +{ + struct __WS1__invokeUnion *_p = ::soap_new___WS1__invokeUnion(soap); + if (_p) + { ::soap_default___WS1__invokeUnion(soap, _p); + } + return _p; +} + +inline struct __WS1__invokeUnion * soap_new_set___WS1__invokeUnion( + struct soap *soap, + _WS1__invokeUnion *WS1__invokeUnion) +{ + struct __WS1__invokeUnion *_p = ::soap_new___WS1__invokeUnion(soap); + if (_p) + { ::soap_default___WS1__invokeUnion(soap, _p); + _p->WS1__invokeUnion = WS1__invokeUnion; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeUnion(struct soap*, const struct __WS1__invokeUnion *, const char*, const char*); + +inline int soap_write___WS1__invokeUnion(struct soap *soap, struct __WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__invokeUnion(soap, p), 0) || ::soap_put___WS1__invokeUnion(soap, p, "-WS1:invokeUnion", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__invokeUnion(struct soap *soap, const char *URL, struct __WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeUnion(soap, p), 0) || ::soap_put___WS1__invokeUnion(soap, p, "-WS1:invokeUnion", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__invokeUnion(struct soap *soap, const char *URL, struct __WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeUnion(soap, p), 0) || ::soap_put___WS1__invokeUnion(soap, p, "-WS1:invokeUnion", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__invokeUnion(struct soap *soap, const char *URL, struct __WS1__invokeUnion const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeUnion(soap, p), 0) || ::soap_put___WS1__invokeUnion(soap, p, "-WS1:invokeUnion", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__invokeUnion * SOAP_FMAC4 soap_get___WS1__invokeUnion(struct soap*, struct __WS1__invokeUnion *, const char*, const char*); + +inline int soap_read___WS1__invokeUnion(struct soap *soap, struct __WS1__invokeUnion *p) +{ + if (p) + { ::soap_default___WS1__invokeUnion(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__invokeUnion(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__invokeUnion(struct soap *soap, const char *URL, struct __WS1__invokeUnion *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__invokeUnion(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__invokeUnion(struct soap *soap, struct __WS1__invokeUnion *p) +{ + if (::soap_read___WS1__invokeUnion(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__regProdAP_DEFINED +#define SOAP_TYPE___WS1__regProdAP_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__regProdAP(struct soap*, struct __WS1__regProdAP *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__regProdAP(struct soap*, const struct __WS1__regProdAP *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__regProdAP(struct soap*, const char*, int, const struct __WS1__regProdAP *, const char*); +SOAP_FMAC3 struct __WS1__regProdAP * SOAP_FMAC4 soap_in___WS1__regProdAP(struct soap*, const char*, struct __WS1__regProdAP *, const char*); +SOAP_FMAC1 struct __WS1__regProdAP * SOAP_FMAC2 cross_instantiate___WS1__regProdAP(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__regProdAP * soap_new___WS1__regProdAP(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__regProdAP(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__regProdAP * soap_new_req___WS1__regProdAP( + struct soap *soap) +{ + struct __WS1__regProdAP *_p = ::soap_new___WS1__regProdAP(soap); + if (_p) + { ::soap_default___WS1__regProdAP(soap, _p); + } + return _p; +} + +inline struct __WS1__regProdAP * soap_new_set___WS1__regProdAP( + struct soap *soap, + _WS1__regProdAP *WS1__regProdAP) +{ + struct __WS1__regProdAP *_p = ::soap_new___WS1__regProdAP(soap); + if (_p) + { ::soap_default___WS1__regProdAP(soap, _p); + _p->WS1__regProdAP = WS1__regProdAP; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__regProdAP(struct soap*, const struct __WS1__regProdAP *, const char*, const char*); + +inline int soap_write___WS1__regProdAP(struct soap *soap, struct __WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__regProdAP(soap, p), 0) || ::soap_put___WS1__regProdAP(soap, p, "-WS1:regProdAP", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__regProdAP(struct soap *soap, const char *URL, struct __WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regProdAP(soap, p), 0) || ::soap_put___WS1__regProdAP(soap, p, "-WS1:regProdAP", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__regProdAP(struct soap *soap, const char *URL, struct __WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regProdAP(soap, p), 0) || ::soap_put___WS1__regProdAP(soap, p, "-WS1:regProdAP", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__regProdAP(struct soap *soap, const char *URL, struct __WS1__regProdAP const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__regProdAP(soap, p), 0) || ::soap_put___WS1__regProdAP(soap, p, "-WS1:regProdAP", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__regProdAP * SOAP_FMAC4 soap_get___WS1__regProdAP(struct soap*, struct __WS1__regProdAP *, const char*, const char*); + +inline int soap_read___WS1__regProdAP(struct soap *soap, struct __WS1__regProdAP *p) +{ + if (p) + { ::soap_default___WS1__regProdAP(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__regProdAP(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__regProdAP(struct soap *soap, const char *URL, struct __WS1__regProdAP *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__regProdAP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__regProdAP(struct soap *soap, struct __WS1__regProdAP *p) +{ + if (::soap_read___WS1__regProdAP(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getProdList_DEFINED +#define SOAP_TYPE___WS1__getProdList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getProdList(struct soap*, struct __WS1__getProdList *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getProdList(struct soap*, const struct __WS1__getProdList *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getProdList(struct soap*, const char*, int, const struct __WS1__getProdList *, const char*); +SOAP_FMAC3 struct __WS1__getProdList * SOAP_FMAC4 soap_in___WS1__getProdList(struct soap*, const char*, struct __WS1__getProdList *, const char*); +SOAP_FMAC1 struct __WS1__getProdList * SOAP_FMAC2 cross_instantiate___WS1__getProdList(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getProdList * soap_new___WS1__getProdList(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getProdList(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getProdList * soap_new_req___WS1__getProdList( + struct soap *soap) +{ + struct __WS1__getProdList *_p = ::soap_new___WS1__getProdList(soap); + if (_p) + { ::soap_default___WS1__getProdList(soap, _p); + } + return _p; +} + +inline struct __WS1__getProdList * soap_new_set___WS1__getProdList( + struct soap *soap, + _WS1__getProdList *WS1__getProdList) +{ + struct __WS1__getProdList *_p = ::soap_new___WS1__getProdList(soap); + if (_p) + { ::soap_default___WS1__getProdList(soap, _p); + _p->WS1__getProdList = WS1__getProdList; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getProdList(struct soap*, const struct __WS1__getProdList *, const char*, const char*); + +inline int soap_write___WS1__getProdList(struct soap *soap, struct __WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getProdList(soap, p), 0) || ::soap_put___WS1__getProdList(soap, p, "-WS1:getProdList", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getProdList(struct soap *soap, const char *URL, struct __WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getProdList(soap, p), 0) || ::soap_put___WS1__getProdList(soap, p, "-WS1:getProdList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getProdList(struct soap *soap, const char *URL, struct __WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getProdList(soap, p), 0) || ::soap_put___WS1__getProdList(soap, p, "-WS1:getProdList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getProdList(struct soap *soap, const char *URL, struct __WS1__getProdList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getProdList(soap, p), 0) || ::soap_put___WS1__getProdList(soap, p, "-WS1:getProdList", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getProdList * SOAP_FMAC4 soap_get___WS1__getProdList(struct soap*, struct __WS1__getProdList *, const char*, const char*); + +inline int soap_read___WS1__getProdList(struct soap *soap, struct __WS1__getProdList *p) +{ + if (p) + { ::soap_default___WS1__getProdList(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getProdList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getProdList(struct soap *soap, const char *URL, struct __WS1__getProdList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getProdList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getProdList(struct soap *soap, struct __WS1__getProdList *p) +{ + if (::soap_read___WS1__getProdList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getParamList_DEFINED +#define SOAP_TYPE___WS1__getParamList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getParamList(struct soap*, struct __WS1__getParamList *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getParamList(struct soap*, const struct __WS1__getParamList *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getParamList(struct soap*, const char*, int, const struct __WS1__getParamList *, const char*); +SOAP_FMAC3 struct __WS1__getParamList * SOAP_FMAC4 soap_in___WS1__getParamList(struct soap*, const char*, struct __WS1__getParamList *, const char*); +SOAP_FMAC1 struct __WS1__getParamList * SOAP_FMAC2 cross_instantiate___WS1__getParamList(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getParamList * soap_new___WS1__getParamList(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getParamList(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getParamList * soap_new_req___WS1__getParamList( + struct soap *soap) +{ + struct __WS1__getParamList *_p = ::soap_new___WS1__getParamList(soap); + if (_p) + { ::soap_default___WS1__getParamList(soap, _p); + } + return _p; +} + +inline struct __WS1__getParamList * soap_new_set___WS1__getParamList( + struct soap *soap, + _WS1__getParamList *WS1__getParamList) +{ + struct __WS1__getParamList *_p = ::soap_new___WS1__getParamList(soap); + if (_p) + { ::soap_default___WS1__getParamList(soap, _p); + _p->WS1__getParamList = WS1__getParamList; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getParamList(struct soap*, const struct __WS1__getParamList *, const char*, const char*); + +inline int soap_write___WS1__getParamList(struct soap *soap, struct __WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getParamList(soap, p), 0) || ::soap_put___WS1__getParamList(soap, p, "-WS1:getParamList", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getParamList(struct soap *soap, const char *URL, struct __WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getParamList(soap, p), 0) || ::soap_put___WS1__getParamList(soap, p, "-WS1:getParamList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getParamList(struct soap *soap, const char *URL, struct __WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getParamList(soap, p), 0) || ::soap_put___WS1__getParamList(soap, p, "-WS1:getParamList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getParamList(struct soap *soap, const char *URL, struct __WS1__getParamList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getParamList(soap, p), 0) || ::soap_put___WS1__getParamList(soap, p, "-WS1:getParamList", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getParamList * SOAP_FMAC4 soap_get___WS1__getParamList(struct soap*, struct __WS1__getParamList *, const char*, const char*); + +inline int soap_read___WS1__getParamList(struct soap *soap, struct __WS1__getParamList *p) +{ + if (p) + { ::soap_default___WS1__getParamList(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getParamList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getParamList(struct soap *soap, const char *URL, struct __WS1__getParamList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getParamList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getParamList(struct soap *soap, struct __WS1__getParamList *p) +{ + if (::soap_read___WS1__getParamList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__getEtlJobList_DEFINED +#define SOAP_TYPE___WS1__getEtlJobList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__getEtlJobList(struct soap*, struct __WS1__getEtlJobList *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__getEtlJobList(struct soap*, const struct __WS1__getEtlJobList *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__getEtlJobList(struct soap*, const char*, int, const struct __WS1__getEtlJobList *, const char*); +SOAP_FMAC3 struct __WS1__getEtlJobList * SOAP_FMAC4 soap_in___WS1__getEtlJobList(struct soap*, const char*, struct __WS1__getEtlJobList *, const char*); +SOAP_FMAC1 struct __WS1__getEtlJobList * SOAP_FMAC2 cross_instantiate___WS1__getEtlJobList(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__getEtlJobList * soap_new___WS1__getEtlJobList(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__getEtlJobList(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__getEtlJobList * soap_new_req___WS1__getEtlJobList( + struct soap *soap) +{ + struct __WS1__getEtlJobList *_p = ::soap_new___WS1__getEtlJobList(soap); + if (_p) + { ::soap_default___WS1__getEtlJobList(soap, _p); + } + return _p; +} + +inline struct __WS1__getEtlJobList * soap_new_set___WS1__getEtlJobList( + struct soap *soap, + _WS1__getEtlJobList *WS1__getEtlJobList) +{ + struct __WS1__getEtlJobList *_p = ::soap_new___WS1__getEtlJobList(soap); + if (_p) + { ::soap_default___WS1__getEtlJobList(soap, _p); + _p->WS1__getEtlJobList = WS1__getEtlJobList; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__getEtlJobList(struct soap*, const struct __WS1__getEtlJobList *, const char*, const char*); + +inline int soap_write___WS1__getEtlJobList(struct soap *soap, struct __WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__getEtlJobList(soap, p), 0) || ::soap_put___WS1__getEtlJobList(soap, p, "-WS1:getEtlJobList", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__getEtlJobList(struct soap *soap, const char *URL, struct __WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getEtlJobList(soap, p), 0) || ::soap_put___WS1__getEtlJobList(soap, p, "-WS1:getEtlJobList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__getEtlJobList(struct soap *soap, const char *URL, struct __WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getEtlJobList(soap, p), 0) || ::soap_put___WS1__getEtlJobList(soap, p, "-WS1:getEtlJobList", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__getEtlJobList(struct soap *soap, const char *URL, struct __WS1__getEtlJobList const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__getEtlJobList(soap, p), 0) || ::soap_put___WS1__getEtlJobList(soap, p, "-WS1:getEtlJobList", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__getEtlJobList * SOAP_FMAC4 soap_get___WS1__getEtlJobList(struct soap*, struct __WS1__getEtlJobList *, const char*, const char*); + +inline int soap_read___WS1__getEtlJobList(struct soap *soap, struct __WS1__getEtlJobList *p) +{ + if (p) + { ::soap_default___WS1__getEtlJobList(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__getEtlJobList(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__getEtlJobList(struct soap *soap, const char *URL, struct __WS1__getEtlJobList *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__getEtlJobList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__getEtlJobList(struct soap *soap, struct __WS1__getEtlJobList *p) +{ + if (::soap_read___WS1__getEtlJobList(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE___WS1__invokeEtl_DEFINED +#define SOAP_TYPE___WS1__invokeEtl_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_default___WS1__invokeEtl(struct soap*, struct __WS1__invokeEtl *); +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize___WS1__invokeEtl(struct soap*, const struct __WS1__invokeEtl *); +SOAP_FMAC3 int SOAP_FMAC4 soap_out___WS1__invokeEtl(struct soap*, const char*, int, const struct __WS1__invokeEtl *, const char*); +SOAP_FMAC3 struct __WS1__invokeEtl * SOAP_FMAC4 soap_in___WS1__invokeEtl(struct soap*, const char*, struct __WS1__invokeEtl *, const char*); +SOAP_FMAC1 struct __WS1__invokeEtl * SOAP_FMAC2 cross_instantiate___WS1__invokeEtl(struct soap*, int, const char*, const char*, size_t*); + +inline struct __WS1__invokeEtl * soap_new___WS1__invokeEtl(struct soap *soap, int n = -1) +{ + return cross_instantiate___WS1__invokeEtl(soap, n, NULL, NULL, NULL); +} + +inline struct __WS1__invokeEtl * soap_new_req___WS1__invokeEtl( + struct soap *soap) +{ + struct __WS1__invokeEtl *_p = ::soap_new___WS1__invokeEtl(soap); + if (_p) + { ::soap_default___WS1__invokeEtl(soap, _p); + } + return _p; +} + +inline struct __WS1__invokeEtl * soap_new_set___WS1__invokeEtl( + struct soap *soap, + _WS1__invokeEtl *WS1__invokeEtl) +{ + struct __WS1__invokeEtl *_p = ::soap_new___WS1__invokeEtl(soap); + if (_p) + { ::soap_default___WS1__invokeEtl(soap, _p); + _p->WS1__invokeEtl = WS1__invokeEtl; + } + return _p; +} +SOAP_FMAC3 int SOAP_FMAC4 soap_put___WS1__invokeEtl(struct soap*, const struct __WS1__invokeEtl *, const char*, const char*); + +inline int soap_write___WS1__invokeEtl(struct soap *soap, struct __WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_begin_send(soap) || (::soap_serialize___WS1__invokeEtl(soap, p), 0) || ::soap_put___WS1__invokeEtl(soap, p, "-WS1:invokeEtl", "") || soap_end_send(soap)) + return soap->error; + return SOAP_OK; +} + +inline int soap_PUT___WS1__invokeEtl(struct soap *soap, const char *URL, struct __WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeEtl(soap, p), 0) || ::soap_put___WS1__invokeEtl(soap, p, "-WS1:invokeEtl", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH___WS1__invokeEtl(struct soap *soap, const char *URL, struct __WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeEtl(soap, p), 0) || ::soap_put___WS1__invokeEtl(soap, p, "-WS1:invokeEtl", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send___WS1__invokeEtl(struct soap *soap, const char *URL, struct __WS1__invokeEtl const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || (::soap_serialize___WS1__invokeEtl(soap, p), 0) || ::soap_put___WS1__invokeEtl(soap, p, "-WS1:invokeEtl", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 struct __WS1__invokeEtl * SOAP_FMAC4 soap_get___WS1__invokeEtl(struct soap*, struct __WS1__invokeEtl *, const char*, const char*); + +inline int soap_read___WS1__invokeEtl(struct soap *soap, struct __WS1__invokeEtl *p) +{ + if (p) + { ::soap_default___WS1__invokeEtl(soap, p); + if (soap_begin_recv(soap) || ::soap_get___WS1__invokeEtl(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET___WS1__invokeEtl(struct soap *soap, const char *URL, struct __WS1__invokeEtl *p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read___WS1__invokeEtl(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv___WS1__invokeEtl(struct soap *soap, struct __WS1__invokeEtl *p) +{ + if (::soap_read___WS1__invokeEtl(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Reason_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Reason(struct soap*, const char *, int, struct SOAP_ENV__Reason *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Reason(struct soap*, const char*, struct SOAP_ENV__Reason **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Reason ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Reason(struct soap*, struct SOAP_ENV__Reason **, const char*, const char*); +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Detail_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Detail(struct soap*, const char *, int, struct SOAP_ENV__Detail *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Detail(struct soap*, const char*, struct SOAP_ENV__Detail **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Detail ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Detail(struct soap*, struct SOAP_ENV__Detail **, const char*, const char*); +#endif + +#endif + +#ifndef WITH_NOGLOBAL + +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED +#define SOAP_TYPE_PointerToSOAP_ENV__Code_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerToSOAP_ENV__Code(struct soap*, const char *, int, struct SOAP_ENV__Code *const*, const char *); +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_in_PointerToSOAP_ENV__Code(struct soap*, const char*, struct SOAP_ENV__Code **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code *const*, const char*, const char*); +SOAP_FMAC3 struct SOAP_ENV__Code ** SOAP_FMAC4 soap_get_PointerToSOAP_ENV__Code(struct soap*, struct SOAP_ENV__Code **, const char*, const char*); +#endif + +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__escrowResendSrv_DEFINED +#define SOAP_TYPE_PointerTo_WS1__escrowResendSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__escrowResendSrv(struct soap*, const char *, int, _WS1__escrowResendSrv *const*, const char *); +SOAP_FMAC3 _WS1__escrowResendSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__escrowResendSrv(struct soap*, const char*, _WS1__escrowResendSrv **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv *const*, const char*, const char*); +SOAP_FMAC3 _WS1__escrowResendSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__escrowResendSrv(struct soap*, _WS1__escrowResendSrv **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__invokeSrv_DEFINED +#define SOAP_TYPE_PointerTo_WS1__invokeSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeSrv(struct soap*, _WS1__invokeSrv *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeSrv(struct soap*, const char *, int, _WS1__invokeSrv *const*, const char *); +SOAP_FMAC3 _WS1__invokeSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeSrv(struct soap*, const char*, _WS1__invokeSrv **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeSrv(struct soap*, _WS1__invokeSrv *const*, const char*, const char*); +SOAP_FMAC3 _WS1__invokeSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeSrv(struct soap*, _WS1__invokeSrv **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__regEAI_DEFINED +#define SOAP_TYPE_PointerTo_WS1__regEAI_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__regEAI(struct soap*, _WS1__regEAI *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__regEAI(struct soap*, const char *, int, _WS1__regEAI *const*, const char *); +SOAP_FMAC3 _WS1__regEAI ** SOAP_FMAC4 soap_in_PointerTo_WS1__regEAI(struct soap*, const char*, _WS1__regEAI **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__regEAI(struct soap*, _WS1__regEAI *const*, const char*, const char*); +SOAP_FMAC3 _WS1__regEAI ** SOAP_FMAC4 soap_get_PointerTo_WS1__regEAI(struct soap*, _WS1__regEAI **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__regSrv_DEFINED +#define SOAP_TYPE_PointerTo_WS1__regSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__regSrv(struct soap*, _WS1__regSrv *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__regSrv(struct soap*, const char *, int, _WS1__regSrv *const*, const char *); +SOAP_FMAC3 _WS1__regSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__regSrv(struct soap*, const char*, _WS1__regSrv **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__regSrv(struct soap*, _WS1__regSrv *const*, const char*, const char*); +SOAP_FMAC3 _WS1__regSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__regSrv(struct soap*, _WS1__regSrv **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getStandardDataNameList_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getStandardDataNameList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getStandardDataNameList(struct soap*, const char *, int, _WS1__getStandardDataNameList *const*, const char *); +SOAP_FMAC3 _WS1__getStandardDataNameList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getStandardDataNameList(struct soap*, const char*, _WS1__getStandardDataNameList **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getStandardDataNameList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getStandardDataNameList(struct soap*, _WS1__getStandardDataNameList **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getStandardServiceList_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getStandardServiceList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getStandardServiceList(struct soap*, const char *, int, _WS1__getStandardServiceList *const*, const char *); +SOAP_FMAC3 _WS1__getStandardServiceList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getStandardServiceList(struct soap*, const char*, _WS1__getStandardServiceList **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getStandardServiceList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getStandardServiceList(struct soap*, _WS1__getStandardServiceList **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__fpInvoke_DEFINED +#define SOAP_TYPE_PointerTo_WS1__fpInvoke_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__fpInvoke(struct soap*, _WS1__fpInvoke *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__fpInvoke(struct soap*, const char *, int, _WS1__fpInvoke *const*, const char *); +SOAP_FMAC3 _WS1__fpInvoke ** SOAP_FMAC4 soap_in_PointerTo_WS1__fpInvoke(struct soap*, const char*, _WS1__fpInvoke **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__fpInvoke(struct soap*, _WS1__fpInvoke *const*, const char*, const char*); +SOAP_FMAC3 _WS1__fpInvoke ** SOAP_FMAC4 soap_get_PointerTo_WS1__fpInvoke(struct soap*, _WS1__fpInvoke **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getSrv_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getSrv_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getSrv(struct soap*, _WS1__getSrv *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getSrv(struct soap*, const char *, int, _WS1__getSrv *const*, const char *); +SOAP_FMAC3 _WS1__getSrv ** SOAP_FMAC4 soap_in_PointerTo_WS1__getSrv(struct soap*, const char*, _WS1__getSrv **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getSrv(struct soap*, _WS1__getSrv *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getSrv ** SOAP_FMAC4 soap_get_PointerTo_WS1__getSrv(struct soap*, _WS1__getSrv **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getProd_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getProd_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getProd(struct soap*, _WS1__getProd *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getProd(struct soap*, const char *, int, _WS1__getProd *const*, const char *); +SOAP_FMAC3 _WS1__getProd ** SOAP_FMAC4 soap_in_PointerTo_WS1__getProd(struct soap*, const char*, _WS1__getProd **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getProd(struct soap*, _WS1__getProd *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getProd ** SOAP_FMAC4 soap_get_PointerTo_WS1__getProd(struct soap*, _WS1__getProd **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__invokeMdm_DEFINED +#define SOAP_TYPE_PointerTo_WS1__invokeMdm_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeMdm(struct soap*, _WS1__invokeMdm *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeMdm(struct soap*, const char *, int, _WS1__invokeMdm *const*, const char *); +SOAP_FMAC3 _WS1__invokeMdm ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeMdm(struct soap*, const char*, _WS1__invokeMdm **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeMdm(struct soap*, _WS1__invokeMdm *const*, const char*, const char*); +SOAP_FMAC3 _WS1__invokeMdm ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeMdm(struct soap*, _WS1__invokeMdm **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__invokeUnion_DEFINED +#define SOAP_TYPE_PointerTo_WS1__invokeUnion_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeUnion(struct soap*, _WS1__invokeUnion *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeUnion(struct soap*, const char *, int, _WS1__invokeUnion *const*, const char *); +SOAP_FMAC3 _WS1__invokeUnion ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeUnion(struct soap*, const char*, _WS1__invokeUnion **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeUnion(struct soap*, _WS1__invokeUnion *const*, const char*, const char*); +SOAP_FMAC3 _WS1__invokeUnion ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeUnion(struct soap*, _WS1__invokeUnion **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__regProdAP_DEFINED +#define SOAP_TYPE_PointerTo_WS1__regProdAP_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__regProdAP(struct soap*, _WS1__regProdAP *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__regProdAP(struct soap*, const char *, int, _WS1__regProdAP *const*, const char *); +SOAP_FMAC3 _WS1__regProdAP ** SOAP_FMAC4 soap_in_PointerTo_WS1__regProdAP(struct soap*, const char*, _WS1__regProdAP **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__regProdAP(struct soap*, _WS1__regProdAP *const*, const char*, const char*); +SOAP_FMAC3 _WS1__regProdAP ** SOAP_FMAC4 soap_get_PointerTo_WS1__regProdAP(struct soap*, _WS1__regProdAP **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getProdList_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getProdList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getProdList(struct soap*, _WS1__getProdList *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getProdList(struct soap*, const char *, int, _WS1__getProdList *const*, const char *); +SOAP_FMAC3 _WS1__getProdList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getProdList(struct soap*, const char*, _WS1__getProdList **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getProdList(struct soap*, _WS1__getProdList *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getProdList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getProdList(struct soap*, _WS1__getProdList **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getParamList_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getParamList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getParamList(struct soap*, _WS1__getParamList *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getParamList(struct soap*, const char *, int, _WS1__getParamList *const*, const char *); +SOAP_FMAC3 _WS1__getParamList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getParamList(struct soap*, const char*, _WS1__getParamList **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getParamList(struct soap*, _WS1__getParamList *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getParamList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getParamList(struct soap*, _WS1__getParamList **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__getEtlJobList_DEFINED +#define SOAP_TYPE_PointerTo_WS1__getEtlJobList_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__getEtlJobList(struct soap*, const char *, int, _WS1__getEtlJobList *const*, const char *); +SOAP_FMAC3 _WS1__getEtlJobList ** SOAP_FMAC4 soap_in_PointerTo_WS1__getEtlJobList(struct soap*, const char*, _WS1__getEtlJobList **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList *const*, const char*, const char*); +SOAP_FMAC3 _WS1__getEtlJobList ** SOAP_FMAC4 soap_get_PointerTo_WS1__getEtlJobList(struct soap*, _WS1__getEtlJobList **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE_PointerTo_WS1__invokeEtl_DEFINED +#define SOAP_TYPE_PointerTo_WS1__invokeEtl_DEFINED +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_PointerTo_WS1__invokeEtl(struct soap*, _WS1__invokeEtl *const*); +SOAP_FMAC3 int SOAP_FMAC4 soap_out_PointerTo_WS1__invokeEtl(struct soap*, const char *, int, _WS1__invokeEtl *const*, const char *); +SOAP_FMAC3 _WS1__invokeEtl ** SOAP_FMAC4 soap_in_PointerTo_WS1__invokeEtl(struct soap*, const char*, _WS1__invokeEtl **, const char*); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_PointerTo_WS1__invokeEtl(struct soap*, _WS1__invokeEtl *const*, const char*, const char*); +SOAP_FMAC3 _WS1__invokeEtl ** SOAP_FMAC4 soap_get_PointerTo_WS1__invokeEtl(struct soap*, _WS1__invokeEtl **, const char*, const char*); +#endif + +#ifndef SOAP_TYPE__QName_DEFINED +#define SOAP_TYPE__QName_DEFINED + +inline void soap_default__QName(struct soap *soap, char **a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT__QName + *a = SOAP_DEFAULT__QName; +#else + *a = (char *)0; +#endif +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize__QName(struct soap*, char *const*); + +#define soap__QName2s(soap, a) soap_QName2s(soap, (a)) +SOAP_FMAC3 int SOAP_FMAC4 soap_out__QName(struct soap*, const char*, int, char*const*, const char*); + +#define soap_s2_QName(soap, s, a) soap_s2QName((soap), (s), (char**)(a), 0, -1, NULL) +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in__QName(struct soap*, const char*, char **, const char*); + +#define cross_instantiate__QName cross_instantiate_string + + +#define soap_new__QName soap_new_string + +SOAP_FMAC3 int SOAP_FMAC4 soap_put__QName(struct soap*, char *const*, const char*, const char*); + +inline int soap_write__QName(struct soap *soap, char *const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send__QName(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put__QName(soap, p, "QName", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get__QName(struct soap*, char **, const char*, const char*); + +inline int soap_read__QName(struct soap *soap, char **p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get__QName(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET__QName(struct soap *soap, const char *URL, char **p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read__QName(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv__QName(struct soap *soap, char **p) +{ + if (::soap_read__QName(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#ifndef SOAP_TYPE__XML_DEFINED +#define SOAP_TYPE__XML_DEFINED +#endif + +#ifndef SOAP_TYPE_string_DEFINED +#define SOAP_TYPE_string_DEFINED + +inline void soap_default_string(struct soap *soap, char **a) +{ + (void)soap; /* appease -Wall -Werror */ +#ifdef SOAP_DEFAULT_string + *a = SOAP_DEFAULT_string; +#else + *a = (char *)0; +#endif +} +SOAP_FMAC3 void SOAP_FMAC4 soap_serialize_string(struct soap*, char *const*); + +#define soap_string2s(soap, a) (a) +SOAP_FMAC3 int SOAP_FMAC4 soap_out_string(struct soap*, const char*, int, char*const*, const char*); + +#define soap_s2string(soap, s, a) soap_s2char((soap), (s), (char**)(a), 1, 0, -1, NULL) +SOAP_FMAC3 char * * SOAP_FMAC4 soap_in_string(struct soap*, const char*, char **, const char*); + +SOAP_FMAC3 char * * SOAP_FMAC4 soap_new_string(struct soap *soap, int n = -1); +SOAP_FMAC3 int SOAP_FMAC4 soap_put_string(struct soap*, char *const*, const char*, const char*); + +inline int soap_write_string(struct soap *soap, char *const*p) +{ + soap_free_temp(soap); + if (p) + { if (soap_begin_send(soap) || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_PUT_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PUT(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_PATCH_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_PATCH(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap) || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} + +inline int soap_POST_send_string(struct soap *soap, const char *URL, char *const*p) +{ + soap_free_temp(soap); + if (soap_POST(soap, URL, NULL, "text/xml; charset=utf-8") || ::soap_put_string(soap, p, "string", "") || soap_end_send(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +SOAP_FMAC3 char ** SOAP_FMAC4 soap_get_string(struct soap*, char **, const char*, const char*); + +inline int soap_read_string(struct soap *soap, char **p) +{ + if (p) + { if (soap_begin_recv(soap) || ::soap_get_string(soap, p, NULL, NULL) == NULL || soap_end_recv(soap)) + return soap->error; + } + return SOAP_OK; +} + +inline int soap_GET_string(struct soap *soap, const char *URL, char **p) +{ + if (soap_GET(soap, URL, NULL) || ::soap_read_string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} + +inline int soap_POST_recv_string(struct soap *soap, char **p) +{ + if (::soap_read_string(soap, p)) + return soap_closesock(soap); + return soap_closesock(soap); +} +#endif + +#endif + +/* End of crossH.h */ diff --git a/connor_erp_mes/crossStub.h b/connor_erp_mes/crossStub.h new file mode 100644 index 0000000..8844ba8 --- /dev/null +++ b/connor_erp_mes/crossStub.h @@ -0,0 +1,2106 @@ +/* crossStub.h + Generated by gSOAP 2.8.91 for cross.h + +gSOAP XML Web services tools +Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved. +The soapcpp2 tool and its generated software are released under the GPL. +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#include +#define SOAP_NAMESPACE_OF_WS1 "http://entry.serviceengine.cross.digiwin.com" + +#ifndef crossStub_H +#define crossStub_H +#include "stdsoap2.h" +#if GSOAP_VERSION != 20891 +# error "GSOAP VERSION 20891 MISMATCH IN GENERATED CODE VERSUS LIBRARY CODE: PLEASE REINSTALL PACKAGE" +#endif + + +/******************************************************************************\ + * * + * Types with Custom Serializers * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Classes, Structs and Unions * + * * +\******************************************************************************/ + +class _WS1__invokeEtl; /* cross.h:151 */ +class _WS1__invokeEtlResponse; /* cross.h:153 */ +class _WS1__getEtlJobList; /* cross.h:155 */ +class _WS1__getEtlJobListResponse; /* cross.h:157 */ +class _WS1__getParamList; /* cross.h:159 */ +class _WS1__getParamListResponse; /* cross.h:161 */ +class _WS1__getProdList; /* cross.h:163 */ +class _WS1__getProdListResponse; /* cross.h:165 */ +class _WS1__regProdAP; /* cross.h:167 */ +class _WS1__regProdAPResponse; /* cross.h:169 */ +class _WS1__invokeUnion; /* cross.h:171 */ +class _WS1__invokeUnionResponse; /* cross.h:173 */ +class _WS1__invokeMdm; /* cross.h:175 */ +class _WS1__invokeMdmResponse; /* cross.h:177 */ +class _WS1__getProd; /* cross.h:179 */ +class _WS1__getProdResponse; /* cross.h:181 */ +class _WS1__getSrv; /* cross.h:183 */ +class _WS1__getSrvResponse; /* cross.h:185 */ +class _WS1__fpInvoke; /* cross.h:187 */ +class _WS1__fpInvokeResponse; /* cross.h:189 */ +class _WS1__getStandardServiceList; /* cross.h:191 */ +class _WS1__getStandardServiceListResponse; /* cross.h:193 */ +class _WS1__getStandardDataNameList; /* cross.h:195 */ +class _WS1__getStandardDataNameListResponse; /* cross.h:197 */ +class _WS1__regSrv; /* cross.h:199 */ +class _WS1__regSrvResponse; /* cross.h:201 */ +class _WS1__regEAI; /* cross.h:203 */ +class _WS1__regEAIResponse; /* cross.h:205 */ +class _WS1__invokeSrv; /* cross.h:207 */ +class _WS1__invokeSrvResponse; /* cross.h:209 */ +class _WS1__escrowResendSrv; /* cross.h:211 */ +class _WS1__escrowResendSrvResponse; /* cross.h:213 */ +struct __WS1__invokeEtl; /* cross.h:1098 */ +struct __WS1__getEtlJobList; /* cross.h:1165 */ +struct __WS1__getParamList; /* cross.h:1232 */ +struct __WS1__getProdList; /* cross.h:1299 */ +struct __WS1__regProdAP; /* cross.h:1366 */ +struct __WS1__invokeUnion; /* cross.h:1433 */ +struct __WS1__invokeMdm; /* cross.h:1500 */ +struct __WS1__getProd; /* cross.h:1567 */ +struct __WS1__getSrv; /* cross.h:1634 */ +struct __WS1__fpInvoke; /* cross.h:1701 */ +struct __WS1__getStandardServiceList; /* cross.h:1768 */ +struct __WS1__getStandardDataNameList; /* cross.h:1835 */ +struct __WS1__regSrv; /* cross.h:1902 */ +struct __WS1__regEAI; /* cross.h:1969 */ +struct __WS1__invokeSrv; /* cross.h:2036 */ +struct __WS1__escrowResendSrv; /* cross.h:2103 */ + +/* cross.h:151 */ +#ifndef SOAP_TYPE__WS1__invokeEtl +#define SOAP_TYPE__WS1__invokeEtl (8) +/* complex XML schema type 'WS1:invokeEtl': */ +class SOAP_CMAC _WS1__invokeEtl { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeEtl + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeEtl; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeEtl, default initialized and not managed by a soap context + virtual _WS1__invokeEtl *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeEtl); } + public: + /// Constructor with default initializations + _WS1__invokeEtl() : in0(), soap() { } + virtual ~_WS1__invokeEtl() { } + /// Friend allocator used by soap_new__WS1__invokeEtl(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeEtl * SOAP_FMAC2 cross_instantiate__WS1__invokeEtl(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:153 */ +#ifndef SOAP_TYPE__WS1__invokeEtlResponse +#define SOAP_TYPE__WS1__invokeEtlResponse (9) +/* complex XML schema type 'WS1:invokeEtlResponse': */ +class SOAP_CMAC _WS1__invokeEtlResponse { + public: + /// Required element 'WS1:invokeEtlReturn' of XML schema type 'xsd:string' + std::string invokeEtlReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeEtlResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeEtlResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeEtlResponse, default initialized and not managed by a soap context + virtual _WS1__invokeEtlResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeEtlResponse); } + public: + /// Constructor with default initializations + _WS1__invokeEtlResponse() : invokeEtlReturn(), soap() { } + virtual ~_WS1__invokeEtlResponse() { } + /// Friend allocator used by soap_new__WS1__invokeEtlResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeEtlResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeEtlResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:155 */ +#ifndef SOAP_TYPE__WS1__getEtlJobList +#define SOAP_TYPE__WS1__getEtlJobList (10) +/* complex XML schema type 'WS1:getEtlJobList': */ +class SOAP_CMAC _WS1__getEtlJobList { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getEtlJobList + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getEtlJobList; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getEtlJobList, default initialized and not managed by a soap context + virtual _WS1__getEtlJobList *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getEtlJobList); } + public: + /// Constructor with default initializations + _WS1__getEtlJobList() : in0(), soap() { } + virtual ~_WS1__getEtlJobList() { } + /// Friend allocator used by soap_new__WS1__getEtlJobList(struct soap*, int) + friend SOAP_FMAC1 _WS1__getEtlJobList * SOAP_FMAC2 cross_instantiate__WS1__getEtlJobList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:157 */ +#ifndef SOAP_TYPE__WS1__getEtlJobListResponse +#define SOAP_TYPE__WS1__getEtlJobListResponse (11) +/* complex XML schema type 'WS1:getEtlJobListResponse': */ +class SOAP_CMAC _WS1__getEtlJobListResponse { + public: + /// Required element 'WS1:getEtlJobListReturn' of XML schema type 'xsd:string' + std::string getEtlJobListReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getEtlJobListResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getEtlJobListResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getEtlJobListResponse, default initialized and not managed by a soap context + virtual _WS1__getEtlJobListResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getEtlJobListResponse); } + public: + /// Constructor with default initializations + _WS1__getEtlJobListResponse() : getEtlJobListReturn(), soap() { } + virtual ~_WS1__getEtlJobListResponse() { } + /// Friend allocator used by soap_new__WS1__getEtlJobListResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getEtlJobListResponse * SOAP_FMAC2 cross_instantiate__WS1__getEtlJobListResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:159 */ +#ifndef SOAP_TYPE__WS1__getParamList +#define SOAP_TYPE__WS1__getParamList (12) +/* complex XML schema type 'WS1:getParamList': */ +class SOAP_CMAC _WS1__getParamList { + public: + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getParamList + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getParamList; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getParamList, default initialized and not managed by a soap context + virtual _WS1__getParamList *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getParamList); } + public: + /// Constructor with default initializations + _WS1__getParamList() : soap() { } + virtual ~_WS1__getParamList() { } + /// Friend allocator used by soap_new__WS1__getParamList(struct soap*, int) + friend SOAP_FMAC1 _WS1__getParamList * SOAP_FMAC2 cross_instantiate__WS1__getParamList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:161 */ +#ifndef SOAP_TYPE__WS1__getParamListResponse +#define SOAP_TYPE__WS1__getParamListResponse (13) +/* complex XML schema type 'WS1:getParamListResponse': */ +class SOAP_CMAC _WS1__getParamListResponse { + public: + /// Required element 'WS1:getParamListReturn' of XML schema type 'xsd:string' + std::string getParamListReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getParamListResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getParamListResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getParamListResponse, default initialized and not managed by a soap context + virtual _WS1__getParamListResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getParamListResponse); } + public: + /// Constructor with default initializations + _WS1__getParamListResponse() : getParamListReturn(), soap() { } + virtual ~_WS1__getParamListResponse() { } + /// Friend allocator used by soap_new__WS1__getParamListResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getParamListResponse * SOAP_FMAC2 cross_instantiate__WS1__getParamListResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:163 */ +#ifndef SOAP_TYPE__WS1__getProdList +#define SOAP_TYPE__WS1__getProdList (14) +/* complex XML schema type 'WS1:getProdList': */ +class SOAP_CMAC _WS1__getProdList { + public: + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getProdList + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getProdList; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getProdList, default initialized and not managed by a soap context + virtual _WS1__getProdList *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getProdList); } + public: + /// Constructor with default initializations + _WS1__getProdList() : soap() { } + virtual ~_WS1__getProdList() { } + /// Friend allocator used by soap_new__WS1__getProdList(struct soap*, int) + friend SOAP_FMAC1 _WS1__getProdList * SOAP_FMAC2 cross_instantiate__WS1__getProdList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:165 */ +#ifndef SOAP_TYPE__WS1__getProdListResponse +#define SOAP_TYPE__WS1__getProdListResponse (15) +/* complex XML schema type 'WS1:getProdListResponse': */ +class SOAP_CMAC _WS1__getProdListResponse { + public: + /// Required element 'WS1:getProdListReturn' of XML schema type 'xsd:string' + std::string getProdListReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getProdListResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getProdListResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getProdListResponse, default initialized and not managed by a soap context + virtual _WS1__getProdListResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getProdListResponse); } + public: + /// Constructor with default initializations + _WS1__getProdListResponse() : getProdListReturn(), soap() { } + virtual ~_WS1__getProdListResponse() { } + /// Friend allocator used by soap_new__WS1__getProdListResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getProdListResponse * SOAP_FMAC2 cross_instantiate__WS1__getProdListResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:167 */ +#ifndef SOAP_TYPE__WS1__regProdAP +#define SOAP_TYPE__WS1__regProdAP (16) +/* complex XML schema type 'WS1:regProdAP': */ +class SOAP_CMAC _WS1__regProdAP { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__regProdAP + virtual long soap_type(void) const { return SOAP_TYPE__WS1__regProdAP; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__regProdAP, default initialized and not managed by a soap context + virtual _WS1__regProdAP *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__regProdAP); } + public: + /// Constructor with default initializations + _WS1__regProdAP() : in0(), soap() { } + virtual ~_WS1__regProdAP() { } + /// Friend allocator used by soap_new__WS1__regProdAP(struct soap*, int) + friend SOAP_FMAC1 _WS1__regProdAP * SOAP_FMAC2 cross_instantiate__WS1__regProdAP(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:169 */ +#ifndef SOAP_TYPE__WS1__regProdAPResponse +#define SOAP_TYPE__WS1__regProdAPResponse (17) +/* complex XML schema type 'WS1:regProdAPResponse': */ +class SOAP_CMAC _WS1__regProdAPResponse { + public: + /// Required element 'WS1:regProdAPReturn' of XML schema type 'xsd:string' + std::string regProdAPReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__regProdAPResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__regProdAPResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__regProdAPResponse, default initialized and not managed by a soap context + virtual _WS1__regProdAPResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__regProdAPResponse); } + public: + /// Constructor with default initializations + _WS1__regProdAPResponse() : regProdAPReturn(), soap() { } + virtual ~_WS1__regProdAPResponse() { } + /// Friend allocator used by soap_new__WS1__regProdAPResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__regProdAPResponse * SOAP_FMAC2 cross_instantiate__WS1__regProdAPResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:171 */ +#ifndef SOAP_TYPE__WS1__invokeUnion +#define SOAP_TYPE__WS1__invokeUnion (18) +/* complex XML schema type 'WS1:invokeUnion': */ +class SOAP_CMAC _WS1__invokeUnion { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Required element 'WS1:in1' of XML schema type 'xsd:string' + std::string in1; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeUnion + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeUnion; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeUnion, default initialized and not managed by a soap context + virtual _WS1__invokeUnion *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeUnion); } + public: + /// Constructor with default initializations + _WS1__invokeUnion() : in0(), in1(), soap() { } + virtual ~_WS1__invokeUnion() { } + /// Friend allocator used by soap_new__WS1__invokeUnion(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeUnion * SOAP_FMAC2 cross_instantiate__WS1__invokeUnion(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:173 */ +#ifndef SOAP_TYPE__WS1__invokeUnionResponse +#define SOAP_TYPE__WS1__invokeUnionResponse (19) +/* complex XML schema type 'WS1:invokeUnionResponse': */ +class SOAP_CMAC _WS1__invokeUnionResponse { + public: + /// Required element 'WS1:invokeUnionReturn' of XML schema type 'xsd:string' + std::string invokeUnionReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeUnionResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeUnionResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeUnionResponse, default initialized and not managed by a soap context + virtual _WS1__invokeUnionResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeUnionResponse); } + public: + /// Constructor with default initializations + _WS1__invokeUnionResponse() : invokeUnionReturn(), soap() { } + virtual ~_WS1__invokeUnionResponse() { } + /// Friend allocator used by soap_new__WS1__invokeUnionResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeUnionResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeUnionResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:175 */ +#ifndef SOAP_TYPE__WS1__invokeMdm +#define SOAP_TYPE__WS1__invokeMdm (20) +/* complex XML schema type 'WS1:invokeMdm': */ +class SOAP_CMAC _WS1__invokeMdm { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeMdm + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeMdm; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeMdm, default initialized and not managed by a soap context + virtual _WS1__invokeMdm *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeMdm); } + public: + /// Constructor with default initializations + _WS1__invokeMdm() : in0(), soap() { } + virtual ~_WS1__invokeMdm() { } + /// Friend allocator used by soap_new__WS1__invokeMdm(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeMdm * SOAP_FMAC2 cross_instantiate__WS1__invokeMdm(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:177 */ +#ifndef SOAP_TYPE__WS1__invokeMdmResponse +#define SOAP_TYPE__WS1__invokeMdmResponse (21) +/* complex XML schema type 'WS1:invokeMdmResponse': */ +class SOAP_CMAC _WS1__invokeMdmResponse { + public: + /// Required element 'WS1:invokeMdmReturn' of XML schema type 'xsd:string' + std::string invokeMdmReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeMdmResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeMdmResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeMdmResponse, default initialized and not managed by a soap context + virtual _WS1__invokeMdmResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeMdmResponse); } + public: + /// Constructor with default initializations + _WS1__invokeMdmResponse() : invokeMdmReturn(), soap() { } + virtual ~_WS1__invokeMdmResponse() { } + /// Friend allocator used by soap_new__WS1__invokeMdmResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeMdmResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeMdmResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:179 */ +#ifndef SOAP_TYPE__WS1__getProd +#define SOAP_TYPE__WS1__getProd (22) +/* complex XML schema type 'WS1:getProd': */ +class SOAP_CMAC _WS1__getProd { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getProd + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getProd; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getProd, default initialized and not managed by a soap context + virtual _WS1__getProd *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getProd); } + public: + /// Constructor with default initializations + _WS1__getProd() : in0(), soap() { } + virtual ~_WS1__getProd() { } + /// Friend allocator used by soap_new__WS1__getProd(struct soap*, int) + friend SOAP_FMAC1 _WS1__getProd * SOAP_FMAC2 cross_instantiate__WS1__getProd(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:181 */ +#ifndef SOAP_TYPE__WS1__getProdResponse +#define SOAP_TYPE__WS1__getProdResponse (23) +/* complex XML schema type 'WS1:getProdResponse': */ +class SOAP_CMAC _WS1__getProdResponse { + public: + /// Required element 'WS1:getProdReturn' of XML schema type 'xsd:string' + std::string getProdReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getProdResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getProdResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getProdResponse, default initialized and not managed by a soap context + virtual _WS1__getProdResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getProdResponse); } + public: + /// Constructor with default initializations + _WS1__getProdResponse() : getProdReturn(), soap() { } + virtual ~_WS1__getProdResponse() { } + /// Friend allocator used by soap_new__WS1__getProdResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getProdResponse * SOAP_FMAC2 cross_instantiate__WS1__getProdResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:183 */ +#ifndef SOAP_TYPE__WS1__getSrv +#define SOAP_TYPE__WS1__getSrv (24) +/* complex XML schema type 'WS1:getSrv': */ +class SOAP_CMAC _WS1__getSrv { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getSrv + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getSrv; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getSrv, default initialized and not managed by a soap context + virtual _WS1__getSrv *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getSrv); } + public: + /// Constructor with default initializations + _WS1__getSrv() : in0(), soap() { } + virtual ~_WS1__getSrv() { } + /// Friend allocator used by soap_new__WS1__getSrv(struct soap*, int) + friend SOAP_FMAC1 _WS1__getSrv * SOAP_FMAC2 cross_instantiate__WS1__getSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:185 */ +#ifndef SOAP_TYPE__WS1__getSrvResponse +#define SOAP_TYPE__WS1__getSrvResponse (25) +/* complex XML schema type 'WS1:getSrvResponse': */ +class SOAP_CMAC _WS1__getSrvResponse { + public: + /// Required element 'WS1:getSrvReturn' of XML schema type 'xsd:string' + std::string getSrvReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getSrvResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getSrvResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getSrvResponse, default initialized and not managed by a soap context + virtual _WS1__getSrvResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getSrvResponse); } + public: + /// Constructor with default initializations + _WS1__getSrvResponse() : getSrvReturn(), soap() { } + virtual ~_WS1__getSrvResponse() { } + /// Friend allocator used by soap_new__WS1__getSrvResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__getSrvResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:187 */ +#ifndef SOAP_TYPE__WS1__fpInvoke +#define SOAP_TYPE__WS1__fpInvoke (26) +/* complex XML schema type 'WS1:fpInvoke': */ +class SOAP_CMAC _WS1__fpInvoke { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__fpInvoke + virtual long soap_type(void) const { return SOAP_TYPE__WS1__fpInvoke; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__fpInvoke, default initialized and not managed by a soap context + virtual _WS1__fpInvoke *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__fpInvoke); } + public: + /// Constructor with default initializations + _WS1__fpInvoke() : in0(), soap() { } + virtual ~_WS1__fpInvoke() { } + /// Friend allocator used by soap_new__WS1__fpInvoke(struct soap*, int) + friend SOAP_FMAC1 _WS1__fpInvoke * SOAP_FMAC2 cross_instantiate__WS1__fpInvoke(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:189 */ +#ifndef SOAP_TYPE__WS1__fpInvokeResponse +#define SOAP_TYPE__WS1__fpInvokeResponse (27) +/* complex XML schema type 'WS1:fpInvokeResponse': */ +class SOAP_CMAC _WS1__fpInvokeResponse { + public: + /// Required element 'WS1:fpInvokeReturn' of XML schema type 'xsd:string' + std::string fpInvokeReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__fpInvokeResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__fpInvokeResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__fpInvokeResponse, default initialized and not managed by a soap context + virtual _WS1__fpInvokeResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__fpInvokeResponse); } + public: + /// Constructor with default initializations + _WS1__fpInvokeResponse() : fpInvokeReturn(), soap() { } + virtual ~_WS1__fpInvokeResponse() { } + /// Friend allocator used by soap_new__WS1__fpInvokeResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__fpInvokeResponse * SOAP_FMAC2 cross_instantiate__WS1__fpInvokeResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:191 */ +#ifndef SOAP_TYPE__WS1__getStandardServiceList +#define SOAP_TYPE__WS1__getStandardServiceList (28) +/* complex XML schema type 'WS1:getStandardServiceList': */ +class SOAP_CMAC _WS1__getStandardServiceList { + public: + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getStandardServiceList + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getStandardServiceList; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getStandardServiceList, default initialized and not managed by a soap context + virtual _WS1__getStandardServiceList *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getStandardServiceList); } + public: + /// Constructor with default initializations + _WS1__getStandardServiceList() : soap() { } + virtual ~_WS1__getStandardServiceList() { } + /// Friend allocator used by soap_new__WS1__getStandardServiceList(struct soap*, int) + friend SOAP_FMAC1 _WS1__getStandardServiceList * SOAP_FMAC2 cross_instantiate__WS1__getStandardServiceList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:193 */ +#ifndef SOAP_TYPE__WS1__getStandardServiceListResponse +#define SOAP_TYPE__WS1__getStandardServiceListResponse (29) +/* complex XML schema type 'WS1:getStandardServiceListResponse': */ +class SOAP_CMAC _WS1__getStandardServiceListResponse { + public: + /// Required element 'WS1:getStandardServiceListReturn' of XML schema type 'xsd:string' + std::string getStandardServiceListReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getStandardServiceListResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getStandardServiceListResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getStandardServiceListResponse, default initialized and not managed by a soap context + virtual _WS1__getStandardServiceListResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getStandardServiceListResponse); } + public: + /// Constructor with default initializations + _WS1__getStandardServiceListResponse() : getStandardServiceListReturn(), soap() { } + virtual ~_WS1__getStandardServiceListResponse() { } + /// Friend allocator used by soap_new__WS1__getStandardServiceListResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getStandardServiceListResponse * SOAP_FMAC2 cross_instantiate__WS1__getStandardServiceListResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:195 */ +#ifndef SOAP_TYPE__WS1__getStandardDataNameList +#define SOAP_TYPE__WS1__getStandardDataNameList (30) +/* complex XML schema type 'WS1:getStandardDataNameList': */ +class SOAP_CMAC _WS1__getStandardDataNameList { + public: + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getStandardDataNameList + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getStandardDataNameList; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getStandardDataNameList, default initialized and not managed by a soap context + virtual _WS1__getStandardDataNameList *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getStandardDataNameList); } + public: + /// Constructor with default initializations + _WS1__getStandardDataNameList() : soap() { } + virtual ~_WS1__getStandardDataNameList() { } + /// Friend allocator used by soap_new__WS1__getStandardDataNameList(struct soap*, int) + friend SOAP_FMAC1 _WS1__getStandardDataNameList * SOAP_FMAC2 cross_instantiate__WS1__getStandardDataNameList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:197 */ +#ifndef SOAP_TYPE__WS1__getStandardDataNameListResponse +#define SOAP_TYPE__WS1__getStandardDataNameListResponse (31) +/* complex XML schema type 'WS1:getStandardDataNameListResponse': */ +class SOAP_CMAC _WS1__getStandardDataNameListResponse { + public: + /// Required element 'WS1:getStandardDataNameListReturn' of XML schema type 'xsd:string' + std::string getStandardDataNameListReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__getStandardDataNameListResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__getStandardDataNameListResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__getStandardDataNameListResponse, default initialized and not managed by a soap context + virtual _WS1__getStandardDataNameListResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__getStandardDataNameListResponse); } + public: + /// Constructor with default initializations + _WS1__getStandardDataNameListResponse() : getStandardDataNameListReturn(), soap() { } + virtual ~_WS1__getStandardDataNameListResponse() { } + /// Friend allocator used by soap_new__WS1__getStandardDataNameListResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__getStandardDataNameListResponse * SOAP_FMAC2 cross_instantiate__WS1__getStandardDataNameListResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:199 */ +#ifndef SOAP_TYPE__WS1__regSrv +#define SOAP_TYPE__WS1__regSrv (32) +/* complex XML schema type 'WS1:regSrv': */ +class SOAP_CMAC _WS1__regSrv { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__regSrv + virtual long soap_type(void) const { return SOAP_TYPE__WS1__regSrv; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__regSrv, default initialized and not managed by a soap context + virtual _WS1__regSrv *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__regSrv); } + public: + /// Constructor with default initializations + _WS1__regSrv() : in0(), soap() { } + virtual ~_WS1__regSrv() { } + /// Friend allocator used by soap_new__WS1__regSrv(struct soap*, int) + friend SOAP_FMAC1 _WS1__regSrv * SOAP_FMAC2 cross_instantiate__WS1__regSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:201 */ +#ifndef SOAP_TYPE__WS1__regSrvResponse +#define SOAP_TYPE__WS1__regSrvResponse (33) +/* complex XML schema type 'WS1:regSrvResponse': */ +class SOAP_CMAC _WS1__regSrvResponse { + public: + /// Required element 'WS1:regSrvReturn' of XML schema type 'xsd:string' + std::string regSrvReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__regSrvResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__regSrvResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__regSrvResponse, default initialized and not managed by a soap context + virtual _WS1__regSrvResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__regSrvResponse); } + public: + /// Constructor with default initializations + _WS1__regSrvResponse() : regSrvReturn(), soap() { } + virtual ~_WS1__regSrvResponse() { } + /// Friend allocator used by soap_new__WS1__regSrvResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__regSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__regSrvResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:203 */ +#ifndef SOAP_TYPE__WS1__regEAI +#define SOAP_TYPE__WS1__regEAI (34) +/* complex XML schema type 'WS1:regEAI': */ +class SOAP_CMAC _WS1__regEAI { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__regEAI + virtual long soap_type(void) const { return SOAP_TYPE__WS1__regEAI; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__regEAI, default initialized and not managed by a soap context + virtual _WS1__regEAI *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__regEAI); } + public: + /// Constructor with default initializations + _WS1__regEAI() : in0(), soap() { } + virtual ~_WS1__regEAI() { } + /// Friend allocator used by soap_new__WS1__regEAI(struct soap*, int) + friend SOAP_FMAC1 _WS1__regEAI * SOAP_FMAC2 cross_instantiate__WS1__regEAI(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:205 */ +#ifndef SOAP_TYPE__WS1__regEAIResponse +#define SOAP_TYPE__WS1__regEAIResponse (35) +/* complex XML schema type 'WS1:regEAIResponse': */ +class SOAP_CMAC _WS1__regEAIResponse { + public: + /// Required element 'WS1:regEAIReturn' of XML schema type 'xsd:string' + std::string regEAIReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__regEAIResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__regEAIResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__regEAIResponse, default initialized and not managed by a soap context + virtual _WS1__regEAIResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__regEAIResponse); } + public: + /// Constructor with default initializations + _WS1__regEAIResponse() : regEAIReturn(), soap() { } + virtual ~_WS1__regEAIResponse() { } + /// Friend allocator used by soap_new__WS1__regEAIResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__regEAIResponse * SOAP_FMAC2 cross_instantiate__WS1__regEAIResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:207 */ +#ifndef SOAP_TYPE__WS1__invokeSrv +#define SOAP_TYPE__WS1__invokeSrv (36) +/* complex XML schema type 'WS1:invokeSrv': */ +class SOAP_CMAC _WS1__invokeSrv { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeSrv + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeSrv; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeSrv, default initialized and not managed by a soap context + virtual _WS1__invokeSrv *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeSrv); } + public: + /// Constructor with default initializations + _WS1__invokeSrv() : in0(), soap() { } + virtual ~_WS1__invokeSrv() { } + /// Friend allocator used by soap_new__WS1__invokeSrv(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeSrv * SOAP_FMAC2 cross_instantiate__WS1__invokeSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:209 */ +#ifndef SOAP_TYPE__WS1__invokeSrvResponse +#define SOAP_TYPE__WS1__invokeSrvResponse (37) +/* complex XML schema type 'WS1:invokeSrvResponse': */ +class SOAP_CMAC _WS1__invokeSrvResponse { + public: + /// Required element 'WS1:invokeSrvReturn' of XML schema type 'xsd:string' + std::string invokeSrvReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__invokeSrvResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__invokeSrvResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__invokeSrvResponse, default initialized and not managed by a soap context + virtual _WS1__invokeSrvResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__invokeSrvResponse); } + public: + /// Constructor with default initializations + _WS1__invokeSrvResponse() : invokeSrvReturn(), soap() { } + virtual ~_WS1__invokeSrvResponse() { } + /// Friend allocator used by soap_new__WS1__invokeSrvResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__invokeSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__invokeSrvResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:211 */ +#ifndef SOAP_TYPE__WS1__escrowResendSrv +#define SOAP_TYPE__WS1__escrowResendSrv (38) +/* complex XML schema type 'WS1:escrowResendSrv': */ +class SOAP_CMAC _WS1__escrowResendSrv { + public: + /// Required element 'WS1:in0' of XML schema type 'xsd:string' + std::string in0; + /// Required element 'WS1:in1' of XML schema type 'xsd:string' + std::string in1; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__escrowResendSrv + virtual long soap_type(void) const { return SOAP_TYPE__WS1__escrowResendSrv; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__escrowResendSrv, default initialized and not managed by a soap context + virtual _WS1__escrowResendSrv *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__escrowResendSrv); } + public: + /// Constructor with default initializations + _WS1__escrowResendSrv() : in0(), in1(), soap() { } + virtual ~_WS1__escrowResendSrv() { } + /// Friend allocator used by soap_new__WS1__escrowResendSrv(struct soap*, int) + friend SOAP_FMAC1 _WS1__escrowResendSrv * SOAP_FMAC2 cross_instantiate__WS1__escrowResendSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:213 */ +#ifndef SOAP_TYPE__WS1__escrowResendSrvResponse +#define SOAP_TYPE__WS1__escrowResendSrvResponse (39) +/* complex XML schema type 'WS1:escrowResendSrvResponse': */ +class SOAP_CMAC _WS1__escrowResendSrvResponse { + public: + /// Required element 'WS1:escrowResendSrvReturn' of XML schema type 'xsd:string' + std::string escrowResendSrvReturn; + /// Context that manages this object + struct soap *soap; + public: + /// Return unique type id SOAP_TYPE__WS1__escrowResendSrvResponse + virtual long soap_type(void) const { return SOAP_TYPE__WS1__escrowResendSrvResponse; } + /// (Re)set members to default values + virtual void soap_default(struct soap*); + /// Serialize object to prepare for SOAP 1.1/1.2 encoded output (or with SOAP_XML_GRAPH) by analyzing its (cyclic) structures + virtual void soap_serialize(struct soap*) const; + /// Output object in XML, compliant with SOAP 1.1 encoding style, return error code or SOAP_OK + virtual int soap_put(struct soap*, const char *tag, const char *type) const; + /// Output object in XML, with tag and optional id attribute and xsi:type, return error code or SOAP_OK + virtual int soap_out(struct soap*, const char *tag, int id, const char *type) const; + /// Get object from XML, compliant with SOAP 1.1 encoding style, return pointer to object or NULL on error + virtual void *soap_get(struct soap*, const char *tag, const char *type); + /// Get object from XML, with matching tag and type (NULL matches any tag and type), return pointer to object or NULL on error + virtual void *soap_in(struct soap*, const char *tag, const char *type); + /// Return a new object of type _WS1__escrowResendSrvResponse, default initialized and not managed by a soap context + virtual _WS1__escrowResendSrvResponse *soap_alloc(void) const { return SOAP_NEW_UNMANAGED(_WS1__escrowResendSrvResponse); } + public: + /// Constructor with default initializations + _WS1__escrowResendSrvResponse() : escrowResendSrvReturn(), soap() { } + virtual ~_WS1__escrowResendSrvResponse() { } + /// Friend allocator used by soap_new__WS1__escrowResendSrvResponse(struct soap*, int) + friend SOAP_FMAC1 _WS1__escrowResendSrvResponse * SOAP_FMAC2 cross_instantiate__WS1__escrowResendSrvResponse(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1098 */ +#ifndef SOAP_TYPE___WS1__invokeEtl +#define SOAP_TYPE___WS1__invokeEtl (45) +/* Wrapper: */ +struct SOAP_CMAC __WS1__invokeEtl { + public: + /** Optional element 'WS1:invokeEtl' of XML schema type 'WS1:invokeEtl' */ + _WS1__invokeEtl *WS1__invokeEtl; + public: + /** Return unique type id SOAP_TYPE___WS1__invokeEtl */ + long soap_type() const { return SOAP_TYPE___WS1__invokeEtl; } + /** Constructor with member initializations */ + __WS1__invokeEtl() : WS1__invokeEtl() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__invokeEtl * SOAP_FMAC2 cross_instantiate___WS1__invokeEtl(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1165 */ +#ifndef SOAP_TYPE___WS1__getEtlJobList +#define SOAP_TYPE___WS1__getEtlJobList (49) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getEtlJobList { + public: + /** Optional element 'WS1:getEtlJobList' of XML schema type 'WS1:getEtlJobList' */ + _WS1__getEtlJobList *WS1__getEtlJobList; + public: + /** Return unique type id SOAP_TYPE___WS1__getEtlJobList */ + long soap_type() const { return SOAP_TYPE___WS1__getEtlJobList; } + /** Constructor with member initializations */ + __WS1__getEtlJobList() : WS1__getEtlJobList() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getEtlJobList * SOAP_FMAC2 cross_instantiate___WS1__getEtlJobList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1232 */ +#ifndef SOAP_TYPE___WS1__getParamList +#define SOAP_TYPE___WS1__getParamList (53) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getParamList { + public: + /** Optional element 'WS1:getParamList' of XML schema type 'WS1:getParamList' */ + _WS1__getParamList *WS1__getParamList; + public: + /** Return unique type id SOAP_TYPE___WS1__getParamList */ + long soap_type() const { return SOAP_TYPE___WS1__getParamList; } + /** Constructor with member initializations */ + __WS1__getParamList() : WS1__getParamList() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getParamList * SOAP_FMAC2 cross_instantiate___WS1__getParamList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1299 */ +#ifndef SOAP_TYPE___WS1__getProdList +#define SOAP_TYPE___WS1__getProdList (57) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getProdList { + public: + /** Optional element 'WS1:getProdList' of XML schema type 'WS1:getProdList' */ + _WS1__getProdList *WS1__getProdList; + public: + /** Return unique type id SOAP_TYPE___WS1__getProdList */ + long soap_type() const { return SOAP_TYPE___WS1__getProdList; } + /** Constructor with member initializations */ + __WS1__getProdList() : WS1__getProdList() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getProdList * SOAP_FMAC2 cross_instantiate___WS1__getProdList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1366 */ +#ifndef SOAP_TYPE___WS1__regProdAP +#define SOAP_TYPE___WS1__regProdAP (61) +/* Wrapper: */ +struct SOAP_CMAC __WS1__regProdAP { + public: + /** Optional element 'WS1:regProdAP' of XML schema type 'WS1:regProdAP' */ + _WS1__regProdAP *WS1__regProdAP; + public: + /** Return unique type id SOAP_TYPE___WS1__regProdAP */ + long soap_type() const { return SOAP_TYPE___WS1__regProdAP; } + /** Constructor with member initializations */ + __WS1__regProdAP() : WS1__regProdAP() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__regProdAP * SOAP_FMAC2 cross_instantiate___WS1__regProdAP(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1433 */ +#ifndef SOAP_TYPE___WS1__invokeUnion +#define SOAP_TYPE___WS1__invokeUnion (65) +/* Wrapper: */ +struct SOAP_CMAC __WS1__invokeUnion { + public: + /** Optional element 'WS1:invokeUnion' of XML schema type 'WS1:invokeUnion' */ + _WS1__invokeUnion *WS1__invokeUnion; + public: + /** Return unique type id SOAP_TYPE___WS1__invokeUnion */ + long soap_type() const { return SOAP_TYPE___WS1__invokeUnion; } + /** Constructor with member initializations */ + __WS1__invokeUnion() : WS1__invokeUnion() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__invokeUnion * SOAP_FMAC2 cross_instantiate___WS1__invokeUnion(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1500 */ +#ifndef SOAP_TYPE___WS1__invokeMdm +#define SOAP_TYPE___WS1__invokeMdm (69) +/* Wrapper: */ +struct SOAP_CMAC __WS1__invokeMdm { + public: + /** Optional element 'WS1:invokeMdm' of XML schema type 'WS1:invokeMdm' */ + _WS1__invokeMdm *WS1__invokeMdm; + public: + /** Return unique type id SOAP_TYPE___WS1__invokeMdm */ + long soap_type() const { return SOAP_TYPE___WS1__invokeMdm; } + /** Constructor with member initializations */ + __WS1__invokeMdm() : WS1__invokeMdm() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__invokeMdm * SOAP_FMAC2 cross_instantiate___WS1__invokeMdm(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1567 */ +#ifndef SOAP_TYPE___WS1__getProd +#define SOAP_TYPE___WS1__getProd (73) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getProd { + public: + /** Optional element 'WS1:getProd' of XML schema type 'WS1:getProd' */ + _WS1__getProd *WS1__getProd; + public: + /** Return unique type id SOAP_TYPE___WS1__getProd */ + long soap_type() const { return SOAP_TYPE___WS1__getProd; } + /** Constructor with member initializations */ + __WS1__getProd() : WS1__getProd() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getProd * SOAP_FMAC2 cross_instantiate___WS1__getProd(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1634 */ +#ifndef SOAP_TYPE___WS1__getSrv +#define SOAP_TYPE___WS1__getSrv (77) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getSrv { + public: + /** Optional element 'WS1:getSrv' of XML schema type 'WS1:getSrv' */ + _WS1__getSrv *WS1__getSrv; + public: + /** Return unique type id SOAP_TYPE___WS1__getSrv */ + long soap_type() const { return SOAP_TYPE___WS1__getSrv; } + /** Constructor with member initializations */ + __WS1__getSrv() : WS1__getSrv() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getSrv * SOAP_FMAC2 cross_instantiate___WS1__getSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1701 */ +#ifndef SOAP_TYPE___WS1__fpInvoke +#define SOAP_TYPE___WS1__fpInvoke (81) +/* Wrapper: */ +struct SOAP_CMAC __WS1__fpInvoke { + public: + /** Optional element 'WS1:fpInvoke' of XML schema type 'WS1:fpInvoke' */ + _WS1__fpInvoke *WS1__fpInvoke; + public: + /** Return unique type id SOAP_TYPE___WS1__fpInvoke */ + long soap_type() const { return SOAP_TYPE___WS1__fpInvoke; } + /** Constructor with member initializations */ + __WS1__fpInvoke() : WS1__fpInvoke() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__fpInvoke * SOAP_FMAC2 cross_instantiate___WS1__fpInvoke(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1768 */ +#ifndef SOAP_TYPE___WS1__getStandardServiceList +#define SOAP_TYPE___WS1__getStandardServiceList (85) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getStandardServiceList { + public: + /** Optional element 'WS1:getStandardServiceList' of XML schema type 'WS1:getStandardServiceList' */ + _WS1__getStandardServiceList *WS1__getStandardServiceList; + public: + /** Return unique type id SOAP_TYPE___WS1__getStandardServiceList */ + long soap_type() const { return SOAP_TYPE___WS1__getStandardServiceList; } + /** Constructor with member initializations */ + __WS1__getStandardServiceList() : WS1__getStandardServiceList() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getStandardServiceList * SOAP_FMAC2 cross_instantiate___WS1__getStandardServiceList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1835 */ +#ifndef SOAP_TYPE___WS1__getStandardDataNameList +#define SOAP_TYPE___WS1__getStandardDataNameList (89) +/* Wrapper: */ +struct SOAP_CMAC __WS1__getStandardDataNameList { + public: + /** Optional element 'WS1:getStandardDataNameList' of XML schema type 'WS1:getStandardDataNameList' */ + _WS1__getStandardDataNameList *WS1__getStandardDataNameList; + public: + /** Return unique type id SOAP_TYPE___WS1__getStandardDataNameList */ + long soap_type() const { return SOAP_TYPE___WS1__getStandardDataNameList; } + /** Constructor with member initializations */ + __WS1__getStandardDataNameList() : WS1__getStandardDataNameList() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__getStandardDataNameList * SOAP_FMAC2 cross_instantiate___WS1__getStandardDataNameList(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1902 */ +#ifndef SOAP_TYPE___WS1__regSrv +#define SOAP_TYPE___WS1__regSrv (93) +/* Wrapper: */ +struct SOAP_CMAC __WS1__regSrv { + public: + /** Optional element 'WS1:regSrv' of XML schema type 'WS1:regSrv' */ + _WS1__regSrv *WS1__regSrv; + public: + /** Return unique type id SOAP_TYPE___WS1__regSrv */ + long soap_type() const { return SOAP_TYPE___WS1__regSrv; } + /** Constructor with member initializations */ + __WS1__regSrv() : WS1__regSrv() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__regSrv * SOAP_FMAC2 cross_instantiate___WS1__regSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:1969 */ +#ifndef SOAP_TYPE___WS1__regEAI +#define SOAP_TYPE___WS1__regEAI (97) +/* Wrapper: */ +struct SOAP_CMAC __WS1__regEAI { + public: + /** Optional element 'WS1:regEAI' of XML schema type 'WS1:regEAI' */ + _WS1__regEAI *WS1__regEAI; + public: + /** Return unique type id SOAP_TYPE___WS1__regEAI */ + long soap_type() const { return SOAP_TYPE___WS1__regEAI; } + /** Constructor with member initializations */ + __WS1__regEAI() : WS1__regEAI() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__regEAI * SOAP_FMAC2 cross_instantiate___WS1__regEAI(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:2036 */ +#ifndef SOAP_TYPE___WS1__invokeSrv +#define SOAP_TYPE___WS1__invokeSrv (101) +/* Wrapper: */ +struct SOAP_CMAC __WS1__invokeSrv { + public: + /** Optional element 'WS1:invokeSrv' of XML schema type 'WS1:invokeSrv' */ + _WS1__invokeSrv *WS1__invokeSrv; + public: + /** Return unique type id SOAP_TYPE___WS1__invokeSrv */ + long soap_type() const { return SOAP_TYPE___WS1__invokeSrv; } + /** Constructor with member initializations */ + __WS1__invokeSrv() : WS1__invokeSrv() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__invokeSrv * SOAP_FMAC2 cross_instantiate___WS1__invokeSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:2103 */ +#ifndef SOAP_TYPE___WS1__escrowResendSrv +#define SOAP_TYPE___WS1__escrowResendSrv (105) +/* Wrapper: */ +struct SOAP_CMAC __WS1__escrowResendSrv { + public: + /** Optional element 'WS1:escrowResendSrv' of XML schema type 'WS1:escrowResendSrv' */ + _WS1__escrowResendSrv *WS1__escrowResendSrv; + public: + /** Return unique type id SOAP_TYPE___WS1__escrowResendSrv */ + long soap_type() const { return SOAP_TYPE___WS1__escrowResendSrv; } + /** Constructor with member initializations */ + __WS1__escrowResendSrv() : WS1__escrowResendSrv() { } + /** Friend allocator */ + friend SOAP_FMAC1 __WS1__escrowResendSrv * SOAP_FMAC2 cross_instantiate___WS1__escrowResendSrv(struct soap*, int, const char*, const char*, size_t*); +}; +#endif + +/* cross.h:2644 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Header +#define SOAP_TYPE_SOAP_ENV__Header (106) +/* SOAP_ENV__Header: */ +struct SOAP_CMAC SOAP_ENV__Header { + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Header */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Header; } + /** Constructor with member initializations */ + SOAP_ENV__Header() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Header * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Header(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* cross.h:2644 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Code +#define SOAP_TYPE_SOAP_ENV__Code (107) +/* Type SOAP_ENV__Code is a recursive data type, (in)directly referencing itself through its (base or derived class) members */ +/* SOAP_ENV__Code: */ +struct SOAP_CMAC SOAP_ENV__Code { + public: + /** Optional element 'SOAP-ENV:Value' of XML schema type 'xsd:QName' */ + char *SOAP_ENV__Value; + /** Optional element 'SOAP-ENV:Subcode' of XML schema type 'SOAP-ENV:Code' */ + struct SOAP_ENV__Code *SOAP_ENV__Subcode; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Code */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Code; } + /** Constructor with member initializations */ + SOAP_ENV__Code() : SOAP_ENV__Value(), SOAP_ENV__Subcode() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Code * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Code(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* cross.h:2644 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Detail +#define SOAP_TYPE_SOAP_ENV__Detail (109) +/* SOAP_ENV__Detail: */ +struct SOAP_CMAC SOAP_ENV__Detail { + public: + char *__any; + /** Any type of element 'fault' assigned to fault with its SOAP_TYPE_ assigned to __type */ + /** Do not create a cyclic data structure through this member unless SOAP encoding or SOAP_XML_GRAPH are used for id-ref serialization */ + int __type; + void *fault; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Detail */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Detail; } + /** Constructor with member initializations */ + SOAP_ENV__Detail() : __any(), __type(), fault() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Detail * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Detail(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* cross.h:2644 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Reason +#define SOAP_TYPE_SOAP_ENV__Reason (112) +/* SOAP_ENV__Reason: */ +struct SOAP_CMAC SOAP_ENV__Reason { + public: + /** Optional element 'SOAP-ENV:Text' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Text; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Reason */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Reason; } + /** Constructor with member initializations */ + SOAP_ENV__Reason() : SOAP_ENV__Text() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Reason * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Reason(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/* cross.h:2644 */ +#ifndef WITH_NOGLOBAL +#ifndef SOAP_TYPE_SOAP_ENV__Fault +#define SOAP_TYPE_SOAP_ENV__Fault (113) +/* SOAP_ENV__Fault: */ +struct SOAP_CMAC SOAP_ENV__Fault { + public: + /** Optional element 'faultcode' of XML schema type 'xsd:QName' */ + char *faultcode; + /** Optional element 'faultstring' of XML schema type 'xsd:string' */ + char *faultstring; + /** Optional element 'faultactor' of XML schema type 'xsd:string' */ + char *faultactor; + /** Optional element 'detail' of XML schema type 'SOAP-ENV:Detail' */ + struct SOAP_ENV__Detail *detail; + /** Optional element 'SOAP-ENV:Code' of XML schema type 'SOAP-ENV:Code' */ + struct SOAP_ENV__Code *SOAP_ENV__Code; + /** Optional element 'SOAP-ENV:Reason' of XML schema type 'SOAP-ENV:Reason' */ + struct SOAP_ENV__Reason *SOAP_ENV__Reason; + /** Optional element 'SOAP-ENV:Node' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Node; + /** Optional element 'SOAP-ENV:Role' of XML schema type 'xsd:string' */ + char *SOAP_ENV__Role; + /** Optional element 'SOAP-ENV:Detail' of XML schema type 'SOAP-ENV:Detail' */ + struct SOAP_ENV__Detail *SOAP_ENV__Detail; + public: + /** Return unique type id SOAP_TYPE_SOAP_ENV__Fault */ + long soap_type() const { return SOAP_TYPE_SOAP_ENV__Fault; } + /** Constructor with member initializations */ + SOAP_ENV__Fault() : faultcode(), faultstring(), faultactor(), detail(), SOAP_ENV__Code(), SOAP_ENV__Reason(), SOAP_ENV__Node(), SOAP_ENV__Role(), SOAP_ENV__Detail() { } + /** Friend allocator */ + friend SOAP_FMAC1 SOAP_ENV__Fault * SOAP_FMAC2 cross_instantiate_SOAP_ENV__Fault(struct soap*, int, const char*, const char*, size_t*); +}; +#endif +#endif + +/******************************************************************************\ + * * + * Typedefs * + * * +\******************************************************************************/ + + +/* (built-in):0 */ +#ifndef SOAP_TYPE__XML +#define SOAP_TYPE__XML (5) +typedef char *_XML; +#endif + +/* (built-in):0 */ +#ifndef SOAP_TYPE__QName +#define SOAP_TYPE__QName (6) +typedef char *_QName; +#endif + +/******************************************************************************\ + * * + * Serializable Types * + * * +\******************************************************************************/ + + +/* char has binding name 'byte' for type 'xsd:byte' */ +#ifndef SOAP_TYPE_byte +#define SOAP_TYPE_byte (3) +#endif + +/* int has binding name 'int' for type 'xsd:int' */ +#ifndef SOAP_TYPE_int +#define SOAP_TYPE_int (1) +#endif + +/* std::string has binding name 'std__string' for type 'xsd:string' */ +#ifndef SOAP_TYPE_std__string +#define SOAP_TYPE_std__string (40) +#endif + +/* _WS1__escrowResendSrvResponse has binding name '_WS1__escrowResendSrvResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__escrowResendSrvResponse +#define SOAP_TYPE__WS1__escrowResendSrvResponse (39) +#endif + +/* _WS1__escrowResendSrv has binding name '_WS1__escrowResendSrv' for type '' */ +#ifndef SOAP_TYPE__WS1__escrowResendSrv +#define SOAP_TYPE__WS1__escrowResendSrv (38) +#endif + +/* _WS1__invokeSrvResponse has binding name '_WS1__invokeSrvResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeSrvResponse +#define SOAP_TYPE__WS1__invokeSrvResponse (37) +#endif + +/* _WS1__invokeSrv has binding name '_WS1__invokeSrv' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeSrv +#define SOAP_TYPE__WS1__invokeSrv (36) +#endif + +/* _WS1__regEAIResponse has binding name '_WS1__regEAIResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__regEAIResponse +#define SOAP_TYPE__WS1__regEAIResponse (35) +#endif + +/* _WS1__regEAI has binding name '_WS1__regEAI' for type '' */ +#ifndef SOAP_TYPE__WS1__regEAI +#define SOAP_TYPE__WS1__regEAI (34) +#endif + +/* _WS1__regSrvResponse has binding name '_WS1__regSrvResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__regSrvResponse +#define SOAP_TYPE__WS1__regSrvResponse (33) +#endif + +/* _WS1__regSrv has binding name '_WS1__regSrv' for type '' */ +#ifndef SOAP_TYPE__WS1__regSrv +#define SOAP_TYPE__WS1__regSrv (32) +#endif + +/* _WS1__getStandardDataNameListResponse has binding name '_WS1__getStandardDataNameListResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getStandardDataNameListResponse +#define SOAP_TYPE__WS1__getStandardDataNameListResponse (31) +#endif + +/* _WS1__getStandardDataNameList has binding name '_WS1__getStandardDataNameList' for type '' */ +#ifndef SOAP_TYPE__WS1__getStandardDataNameList +#define SOAP_TYPE__WS1__getStandardDataNameList (30) +#endif + +/* _WS1__getStandardServiceListResponse has binding name '_WS1__getStandardServiceListResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getStandardServiceListResponse +#define SOAP_TYPE__WS1__getStandardServiceListResponse (29) +#endif + +/* _WS1__getStandardServiceList has binding name '_WS1__getStandardServiceList' for type '' */ +#ifndef SOAP_TYPE__WS1__getStandardServiceList +#define SOAP_TYPE__WS1__getStandardServiceList (28) +#endif + +/* _WS1__fpInvokeResponse has binding name '_WS1__fpInvokeResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__fpInvokeResponse +#define SOAP_TYPE__WS1__fpInvokeResponse (27) +#endif + +/* _WS1__fpInvoke has binding name '_WS1__fpInvoke' for type '' */ +#ifndef SOAP_TYPE__WS1__fpInvoke +#define SOAP_TYPE__WS1__fpInvoke (26) +#endif + +/* _WS1__getSrvResponse has binding name '_WS1__getSrvResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getSrvResponse +#define SOAP_TYPE__WS1__getSrvResponse (25) +#endif + +/* _WS1__getSrv has binding name '_WS1__getSrv' for type '' */ +#ifndef SOAP_TYPE__WS1__getSrv +#define SOAP_TYPE__WS1__getSrv (24) +#endif + +/* _WS1__getProdResponse has binding name '_WS1__getProdResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getProdResponse +#define SOAP_TYPE__WS1__getProdResponse (23) +#endif + +/* _WS1__getProd has binding name '_WS1__getProd' for type '' */ +#ifndef SOAP_TYPE__WS1__getProd +#define SOAP_TYPE__WS1__getProd (22) +#endif + +/* _WS1__invokeMdmResponse has binding name '_WS1__invokeMdmResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeMdmResponse +#define SOAP_TYPE__WS1__invokeMdmResponse (21) +#endif + +/* _WS1__invokeMdm has binding name '_WS1__invokeMdm' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeMdm +#define SOAP_TYPE__WS1__invokeMdm (20) +#endif + +/* _WS1__invokeUnionResponse has binding name '_WS1__invokeUnionResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeUnionResponse +#define SOAP_TYPE__WS1__invokeUnionResponse (19) +#endif + +/* _WS1__invokeUnion has binding name '_WS1__invokeUnion' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeUnion +#define SOAP_TYPE__WS1__invokeUnion (18) +#endif + +/* _WS1__regProdAPResponse has binding name '_WS1__regProdAPResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__regProdAPResponse +#define SOAP_TYPE__WS1__regProdAPResponse (17) +#endif + +/* _WS1__regProdAP has binding name '_WS1__regProdAP' for type '' */ +#ifndef SOAP_TYPE__WS1__regProdAP +#define SOAP_TYPE__WS1__regProdAP (16) +#endif + +/* _WS1__getProdListResponse has binding name '_WS1__getProdListResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getProdListResponse +#define SOAP_TYPE__WS1__getProdListResponse (15) +#endif + +/* _WS1__getProdList has binding name '_WS1__getProdList' for type '' */ +#ifndef SOAP_TYPE__WS1__getProdList +#define SOAP_TYPE__WS1__getProdList (14) +#endif + +/* _WS1__getParamListResponse has binding name '_WS1__getParamListResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getParamListResponse +#define SOAP_TYPE__WS1__getParamListResponse (13) +#endif + +/* _WS1__getParamList has binding name '_WS1__getParamList' for type '' */ +#ifndef SOAP_TYPE__WS1__getParamList +#define SOAP_TYPE__WS1__getParamList (12) +#endif + +/* _WS1__getEtlJobListResponse has binding name '_WS1__getEtlJobListResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__getEtlJobListResponse +#define SOAP_TYPE__WS1__getEtlJobListResponse (11) +#endif + +/* _WS1__getEtlJobList has binding name '_WS1__getEtlJobList' for type '' */ +#ifndef SOAP_TYPE__WS1__getEtlJobList +#define SOAP_TYPE__WS1__getEtlJobList (10) +#endif + +/* _WS1__invokeEtlResponse has binding name '_WS1__invokeEtlResponse' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeEtlResponse +#define SOAP_TYPE__WS1__invokeEtlResponse (9) +#endif + +/* _WS1__invokeEtl has binding name '_WS1__invokeEtl' for type '' */ +#ifndef SOAP_TYPE__WS1__invokeEtl +#define SOAP_TYPE__WS1__invokeEtl (8) +#endif + +/* struct SOAP_ENV__Fault has binding name 'SOAP_ENV__Fault' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Fault +#define SOAP_TYPE_SOAP_ENV__Fault (113) +#endif + +/* struct SOAP_ENV__Reason has binding name 'SOAP_ENV__Reason' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Reason +#define SOAP_TYPE_SOAP_ENV__Reason (112) +#endif + +/* struct SOAP_ENV__Detail has binding name 'SOAP_ENV__Detail' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Detail +#define SOAP_TYPE_SOAP_ENV__Detail (109) +#endif + +/* struct SOAP_ENV__Code has binding name 'SOAP_ENV__Code' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Code +#define SOAP_TYPE_SOAP_ENV__Code (107) +#endif + +/* struct SOAP_ENV__Header has binding name 'SOAP_ENV__Header' for type '' */ +#ifndef SOAP_TYPE_SOAP_ENV__Header +#define SOAP_TYPE_SOAP_ENV__Header (106) +#endif + +/* struct SOAP_ENV__Reason * has binding name 'PointerToSOAP_ENV__Reason' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Reason +#define SOAP_TYPE_PointerToSOAP_ENV__Reason (115) +#endif + +/* struct SOAP_ENV__Detail * has binding name 'PointerToSOAP_ENV__Detail' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Detail +#define SOAP_TYPE_PointerToSOAP_ENV__Detail (114) +#endif + +/* struct SOAP_ENV__Code * has binding name 'PointerToSOAP_ENV__Code' for type '' */ +#ifndef SOAP_TYPE_PointerToSOAP_ENV__Code +#define SOAP_TYPE_PointerToSOAP_ENV__Code (108) +#endif + +/* _WS1__escrowResendSrv * has binding name 'PointerTo_WS1__escrowResendSrv' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__escrowResendSrv +#define SOAP_TYPE_PointerTo_WS1__escrowResendSrv (102) +#endif + +/* _WS1__invokeSrv * has binding name 'PointerTo_WS1__invokeSrv' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__invokeSrv +#define SOAP_TYPE_PointerTo_WS1__invokeSrv (98) +#endif + +/* _WS1__regEAI * has binding name 'PointerTo_WS1__regEAI' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__regEAI +#define SOAP_TYPE_PointerTo_WS1__regEAI (94) +#endif + +/* _WS1__regSrv * has binding name 'PointerTo_WS1__regSrv' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__regSrv +#define SOAP_TYPE_PointerTo_WS1__regSrv (90) +#endif + +/* _WS1__getStandardDataNameList * has binding name 'PointerTo_WS1__getStandardDataNameList' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getStandardDataNameList +#define SOAP_TYPE_PointerTo_WS1__getStandardDataNameList (86) +#endif + +/* _WS1__getStandardServiceList * has binding name 'PointerTo_WS1__getStandardServiceList' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getStandardServiceList +#define SOAP_TYPE_PointerTo_WS1__getStandardServiceList (82) +#endif + +/* _WS1__fpInvoke * has binding name 'PointerTo_WS1__fpInvoke' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__fpInvoke +#define SOAP_TYPE_PointerTo_WS1__fpInvoke (78) +#endif + +/* _WS1__getSrv * has binding name 'PointerTo_WS1__getSrv' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getSrv +#define SOAP_TYPE_PointerTo_WS1__getSrv (74) +#endif + +/* _WS1__getProd * has binding name 'PointerTo_WS1__getProd' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getProd +#define SOAP_TYPE_PointerTo_WS1__getProd (70) +#endif + +/* _WS1__invokeMdm * has binding name 'PointerTo_WS1__invokeMdm' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__invokeMdm +#define SOAP_TYPE_PointerTo_WS1__invokeMdm (66) +#endif + +/* _WS1__invokeUnion * has binding name 'PointerTo_WS1__invokeUnion' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__invokeUnion +#define SOAP_TYPE_PointerTo_WS1__invokeUnion (62) +#endif + +/* _WS1__regProdAP * has binding name 'PointerTo_WS1__regProdAP' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__regProdAP +#define SOAP_TYPE_PointerTo_WS1__regProdAP (58) +#endif + +/* _WS1__getProdList * has binding name 'PointerTo_WS1__getProdList' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getProdList +#define SOAP_TYPE_PointerTo_WS1__getProdList (54) +#endif + +/* _WS1__getParamList * has binding name 'PointerTo_WS1__getParamList' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getParamList +#define SOAP_TYPE_PointerTo_WS1__getParamList (50) +#endif + +/* _WS1__getEtlJobList * has binding name 'PointerTo_WS1__getEtlJobList' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__getEtlJobList +#define SOAP_TYPE_PointerTo_WS1__getEtlJobList (46) +#endif + +/* _WS1__invokeEtl * has binding name 'PointerTo_WS1__invokeEtl' for type '' */ +#ifndef SOAP_TYPE_PointerTo_WS1__invokeEtl +#define SOAP_TYPE_PointerTo_WS1__invokeEtl (42) +#endif + +/* _QName has binding name '_QName' for type 'xsd:QName' */ +#ifndef SOAP_TYPE__QName +#define SOAP_TYPE__QName (6) +#endif + +/* _XML has binding name '_XML' for type '' */ +#ifndef SOAP_TYPE__XML +#define SOAP_TYPE__XML (5) +#endif + +/* char * has binding name 'string' for type 'xsd:string' */ +#ifndef SOAP_TYPE_string +#define SOAP_TYPE_string (4) +#endif + +/******************************************************************************\ + * * + * Externals * + * * +\******************************************************************************/ + + +/******************************************************************************\ + * * + * Client-Side Call Stub Functions * + * * +\******************************************************************************/ + + + /** Web service synchronous operation 'soap_call___WS1__invokeEtl' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeEtl(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeEtl *WS1__invokeEtl, _WS1__invokeEtlResponse &WS1__invokeEtlResponse); + /** Web service asynchronous operation 'soap_send___WS1__invokeEtl' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeEtl(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeEtl *WS1__invokeEtl); + /** Web service asynchronous operation 'soap_recv___WS1__invokeEtl' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeEtl(struct soap *soap, _WS1__invokeEtlResponse &WS1__invokeEtlResponse); + + /** Web service synchronous operation 'soap_call___WS1__getEtlJobList' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getEtlJobList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getEtlJobList *WS1__getEtlJobList, _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse); + /** Web service asynchronous operation 'soap_send___WS1__getEtlJobList' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getEtlJobList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getEtlJobList *WS1__getEtlJobList); + /** Web service asynchronous operation 'soap_recv___WS1__getEtlJobList' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getEtlJobList(struct soap *soap, _WS1__getEtlJobListResponse &WS1__getEtlJobListResponse); + + /** Web service synchronous operation 'soap_call___WS1__getParamList' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getParamList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getParamList *WS1__getParamList, _WS1__getParamListResponse &WS1__getParamListResponse); + /** Web service asynchronous operation 'soap_send___WS1__getParamList' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getParamList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getParamList *WS1__getParamList); + /** Web service asynchronous operation 'soap_recv___WS1__getParamList' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getParamList(struct soap *soap, _WS1__getParamListResponse &WS1__getParamListResponse); + + /** Web service synchronous operation 'soap_call___WS1__getProdList' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getProdList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProdList *WS1__getProdList, _WS1__getProdListResponse &WS1__getProdListResponse); + /** Web service asynchronous operation 'soap_send___WS1__getProdList' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getProdList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProdList *WS1__getProdList); + /** Web service asynchronous operation 'soap_recv___WS1__getProdList' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getProdList(struct soap *soap, _WS1__getProdListResponse &WS1__getProdListResponse); + + /** Web service synchronous operation 'soap_call___WS1__regProdAP' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__regProdAP(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regProdAP *WS1__regProdAP, _WS1__regProdAPResponse &WS1__regProdAPResponse); + /** Web service asynchronous operation 'soap_send___WS1__regProdAP' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__regProdAP(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regProdAP *WS1__regProdAP); + /** Web service asynchronous operation 'soap_recv___WS1__regProdAP' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__regProdAP(struct soap *soap, _WS1__regProdAPResponse &WS1__regProdAPResponse); + + /** Web service synchronous operation 'soap_call___WS1__invokeUnion' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeUnion(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeUnion *WS1__invokeUnion, _WS1__invokeUnionResponse &WS1__invokeUnionResponse); + /** Web service asynchronous operation 'soap_send___WS1__invokeUnion' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeUnion(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeUnion *WS1__invokeUnion); + /** Web service asynchronous operation 'soap_recv___WS1__invokeUnion' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeUnion(struct soap *soap, _WS1__invokeUnionResponse &WS1__invokeUnionResponse); + + /** Web service synchronous operation 'soap_call___WS1__invokeMdm' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeMdm(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeMdm *WS1__invokeMdm, _WS1__invokeMdmResponse &WS1__invokeMdmResponse); + /** Web service asynchronous operation 'soap_send___WS1__invokeMdm' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeMdm(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeMdm *WS1__invokeMdm); + /** Web service asynchronous operation 'soap_recv___WS1__invokeMdm' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeMdm(struct soap *soap, _WS1__invokeMdmResponse &WS1__invokeMdmResponse); + + /** Web service synchronous operation 'soap_call___WS1__getProd' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getProd(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProd *WS1__getProd, _WS1__getProdResponse &WS1__getProdResponse); + /** Web service asynchronous operation 'soap_send___WS1__getProd' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getProd(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getProd *WS1__getProd); + /** Web service asynchronous operation 'soap_recv___WS1__getProd' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getProd(struct soap *soap, _WS1__getProdResponse &WS1__getProdResponse); + + /** Web service synchronous operation 'soap_call___WS1__getSrv' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getSrv *WS1__getSrv, _WS1__getSrvResponse &WS1__getSrvResponse); + /** Web service asynchronous operation 'soap_send___WS1__getSrv' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getSrv *WS1__getSrv); + /** Web service asynchronous operation 'soap_recv___WS1__getSrv' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getSrv(struct soap *soap, _WS1__getSrvResponse &WS1__getSrvResponse); + + /** Web service synchronous operation 'soap_call___WS1__fpInvoke' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__fpInvoke(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__fpInvoke *WS1__fpInvoke, _WS1__fpInvokeResponse &WS1__fpInvokeResponse); + /** Web service asynchronous operation 'soap_send___WS1__fpInvoke' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__fpInvoke(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__fpInvoke *WS1__fpInvoke); + /** Web service asynchronous operation 'soap_recv___WS1__fpInvoke' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__fpInvoke(struct soap *soap, _WS1__fpInvokeResponse &WS1__fpInvokeResponse); + + /** Web service synchronous operation 'soap_call___WS1__getStandardServiceList' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getStandardServiceList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardServiceList *WS1__getStandardServiceList, _WS1__getStandardServiceListResponse &WS1__getStandardServiceListResponse); + /** Web service asynchronous operation 'soap_send___WS1__getStandardServiceList' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getStandardServiceList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardServiceList *WS1__getStandardServiceList); + /** Web service asynchronous operation 'soap_recv___WS1__getStandardServiceList' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getStandardServiceList(struct soap *soap, _WS1__getStandardServiceListResponse &WS1__getStandardServiceListResponse); + + /** Web service synchronous operation 'soap_call___WS1__getStandardDataNameList' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__getStandardDataNameList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardDataNameList *WS1__getStandardDataNameList, _WS1__getStandardDataNameListResponse &WS1__getStandardDataNameListResponse); + /** Web service asynchronous operation 'soap_send___WS1__getStandardDataNameList' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__getStandardDataNameList(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__getStandardDataNameList *WS1__getStandardDataNameList); + /** Web service asynchronous operation 'soap_recv___WS1__getStandardDataNameList' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__getStandardDataNameList(struct soap *soap, _WS1__getStandardDataNameListResponse &WS1__getStandardDataNameListResponse); + + /** Web service synchronous operation 'soap_call___WS1__regSrv' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__regSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regSrv *WS1__regSrv, _WS1__regSrvResponse &WS1__regSrvResponse); + /** Web service asynchronous operation 'soap_send___WS1__regSrv' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__regSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regSrv *WS1__regSrv); + /** Web service asynchronous operation 'soap_recv___WS1__regSrv' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__regSrv(struct soap *soap, _WS1__regSrvResponse &WS1__regSrvResponse); + + /** Web service synchronous operation 'soap_call___WS1__regEAI' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__regEAI(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regEAI *WS1__regEAI, _WS1__regEAIResponse &WS1__regEAIResponse); + /** Web service asynchronous operation 'soap_send___WS1__regEAI' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__regEAI(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__regEAI *WS1__regEAI); + /** Web service asynchronous operation 'soap_recv___WS1__regEAI' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__regEAI(struct soap *soap, _WS1__regEAIResponse &WS1__regEAIResponse); + + /** Web service synchronous operation 'soap_call___WS1__invokeSrv' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__invokeSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeSrv *WS1__invokeSrv, _WS1__invokeSrvResponse &WS1__invokeSrvResponse); + /** Web service asynchronous operation 'soap_send___WS1__invokeSrv' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__invokeSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__invokeSrv *WS1__invokeSrv); + /** Web service asynchronous operation 'soap_recv___WS1__invokeSrv' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__invokeSrv(struct soap *soap, _WS1__invokeSrvResponse &WS1__invokeSrvResponse); + + /** Web service synchronous operation 'soap_call___WS1__escrowResendSrv' to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_call___WS1__escrowResendSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__escrowResendSrv *WS1__escrowResendSrv, _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse); + /** Web service asynchronous operation 'soap_send___WS1__escrowResendSrv' to send a request message to the specified endpoint and SOAP Action header, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_send___WS1__escrowResendSrv(struct soap *soap, const char *soap_endpoint, const char *soap_action, _WS1__escrowResendSrv *WS1__escrowResendSrv); + /** Web service asynchronous operation 'soap_recv___WS1__escrowResendSrv' to receive a response message from the connected endpoint, returns SOAP_OK or error code */ + SOAP_FMAC5 int SOAP_FMAC6 soap_recv___WS1__escrowResendSrv(struct soap *soap, _WS1__escrowResendSrvResponse &WS1__escrowResendSrvResponse); + +#endif + +/* End of crossStub.h */ diff --git a/connor_erp_mes/kutil.cpp b/connor_erp_mes/kutil.cpp new file mode 100644 index 0000000..4ab77ba --- /dev/null +++ b/connor_erp_mes/kutil.cpp @@ -0,0 +1,843 @@ +#pragma warning (disable: 4996) +#pragma warning (disable: 4819) + +#include "kutil.h" +#include +FILE* logFile = NULL; + +#define MAX_PATH_LENGTH 200 +#define MAX_PRINTLINE_LENGTH 8000 + +using namespace std::chrono; + +void initUserDir(char* userId) { + char logFileDir[MAX_PATH_LENGTH]; + memset(logFileDir, 0, sizeof(logFileDir)); + sprintf(logFileDir, "%s", getenv("TEMP")); + strcat(logFileDir, "\\tc_"); + strcat(logFileDir, userId); + if (chdir(logFileDir) != ITK_ok) { + printf(">> Create Path: %s\n", logFileDir); + mkdir(logFileDir); + } +} + +int WriteToFile(FILE* file, const char* text) +{ + if (!file) { + return ITK_ok; + } + va_list arg; + //char tmp[MAX_PRINTLINE_LENGTH]; + char* time_str = getTime(); + //get the message + //memset(tmp, 0, sizeof(tmp)); + //va_start(arg, format); + //vsprintf(tmp, format, arg); + //va_end(arg); + //print message to log file + //WriteLog(debug, "дݣ%s", tmp); + fprintf(file, "[%s] - %s\r\n",time_str, text); + fflush(file); + free(time_str); + return ITK_ok; +} + +int getCurrentMilliSeconds() { + unsigned __int64 now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + std::cout << now << std::endl; + return now % 1000; +} + +char* getTime() { + time_t now; + struct tm* p; + char date_string[MAX_PATH_LENGTH]; + time(&now); + //logFile = NULL; + //current_time(&status_now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d-%02d-%02d %02d:%02d:%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec); + char* dateC = (char*)malloc(sizeof(char) * (strlen(date_string)+1)); + strcpy(dateC, date_string); + return dateC; +} + +int CreateUserFile(logical debug, const char* FunctionName, char* userId, char** fullname, FILE** file) +{ + int ifail = ITK_ok; + //date_t status_now; + //char* date_string = NULL; + char date_string[MAX_PATH_LENGTH]; + char logFileDir[MAX_PATH_LENGTH]; + char logFileName[MAX_PATH_LENGTH]; + //char* session_uid = NULL; + //tag_t session_tag = NULLTAG; + + time_t now; + struct tm* p; + + time(&now); + + //logFile = NULL; + //current_time(&status_now); + p = localtime(&now); + + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%4d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + //sprintf(date_string, "%4d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + //if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok ) + //ifail = ITK_date_to_string (status_now, &date_string ); + //if (ifail) + //{ + // printf("!*ERROR*!: Failed to get current date time\n"); + // goto CLEANUP; + //} + + memset(logFileDir, 0, sizeof(logFileDir)); + memset(logFileName, 0, sizeof(logFileName)); + //get log dir + sprintf(logFileDir, "%s", getenv("TEMP")); + strcat(logFileDir, "\\tc_"); + strcat(logFileDir, userId); + //printf("\n log file dir: %s\n", logFileDir); + //try to change dir to TC_USER_LOG_DIR + if (chdir(logFileDir) != ITK_ok) + { + WriteLog(debug, "ûļʧܣ%s", logFileDir); + //printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + return -1; + } + + //get session_uid to make sure the log file name unique + //POM_ask_session(&session_tag); + //ITK__convert_tag_to_uid(session_tag, &session_uid); + //get logFileName + sprintf(logFileName, "%s_%s.txt", FunctionName, date_string); + //printf("log file name: %s\n", logFileName); + + *fullname = (char*)MEM_alloc(sizeof(char) * 512); + sprintf(*fullname, "%s\\%s", logFileDir, logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + *file = fopen(logFileName, "a"); + return ITK_ok; + //CLEANUP:; + //DOFREE(date_string); + /*if(session_uid!=NULL){ + MEM_free(session_uid); + session_uid=NULL; + }*/ +} + + +void WriteLog(logical debug, const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + printf("%s\n", tmp); + TC_write_syslog("%s\n", tmp); +} + +void WriteLog2(logical debug, const char* format, ...) +{ + va_list arg; + char tmp[MAX_PRINTLINE_LENGTH]; + char date_string[MAX_PATH_LENGTH]; + time_t now; + struct tm* p; + + //get the message + memset(tmp, 0, sizeof(tmp)); + va_start(arg, format); + vsprintf(tmp, format, arg); + va_end(arg); + //----------print to command window for trace--------// + //printf("%s\n", tmp); + printf("%s\n", tmp); + //print message to log file + if (!debug) { + return; + } + if (logFile) + { + time(&now); + //current_time(&status_now); + p = localtime(&now); + memset(date_string, 0, sizeof(date_string)); + sprintf(date_string, "%02d:%02d:%02d", p->tm_hour, p->tm_min, p->tm_sec); + fprintf(logFile, "[%s] %s\n", date_string, tmp); + fflush(logFile); + } + else + { + printf("*!Error!*: Log File Not Exist\n"); + } +} + +void CloseLog(void) +{ + if (logFile) + { + fclose(logFile); + logFile = NULL; + } +} + +void CreateLogFile(char* FunctionName, char* userId, char** fullname) +{ + int ifail = ITK_ok; + //date_t status_now; + //char* date_string = NULL; + char date_string[MAX_PATH_LENGTH]; + char logFileDir[MAX_PATH_LENGTH]; + char logFileName[MAX_PATH_LENGTH]; + //char* session_uid = NULL; + //tag_t session_tag = NULLTAG; + + time_t now; + struct tm* p; + + time(&now); + + logFile = NULL; + //current_time(&status_now); + p = localtime(&now); + + memset(date_string, 0, sizeof(date_string)); + //sprintf(date_string,"%4d%02d%02d%02d%02d%02d",1900+p->tm_year,p->tm_mon+1 ,p->tm_mday ,p->tm_hour,p->tm_min ,p->tm_sec ); + sprintf(date_string, "%4d%02d%02d", 1900 + p->tm_year, p->tm_mon + 1, p->tm_mday); + //if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok ) + //ifail = ITK_date_to_string (status_now, &date_string ); + //if (ifail) + //{ + // printf("!*ERROR*!: Failed to get current date time\n"); + // goto CLEANUP; + //} + + memset(logFileDir, 0, sizeof(logFileDir)); + memset(logFileName, 0, sizeof(logFileName)); + //get log dir + sprintf(logFileDir, "%s", getenv("TEMP")); + strcat(logFileDir, "\\tc_"); + strcat(logFileDir, userId); + //printf("\n log file dir: %s\n", logFileDir); + //try to change dir to TC_USER_LOG_DIR + if (chdir(logFileDir) != ITK_ok) + { + //not set TC_USER_LOG_DIR + //log in to default TC_LOG + memset(logFileDir, 0, sizeof(logFileDir)); + sprintf(logFileDir, "%s", getenv("TC_LOG")); + printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", logFileDir); + if (chdir(logFileDir) != ITK_ok) + { + //still can not change to log dir + printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n"); + goto CLEANUP; + } + } + + //get session_uid to make sure the log file name unique + //POM_ask_session(&session_tag); + //ITK__convert_tag_to_uid(session_tag, &session_uid); + //get logFileName + sprintf(logFileName, "%s_%s_%s.log", FunctionName, userId, date_string); + //printf("log file name: %s\n", logFileName); + + *fullname = (char*)MEM_alloc(sizeof(char) * 512); + sprintf(*fullname, "%s\\%s", logFileDir, logFileName); + + //for(i = 0; _access((char *)logFileName, 4) == 0; i++) + /*{ + memset(logFileName, 0, sizeof(logFileName)); + sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i); + } + printf("final log file name: %s\n", logFileName);*/ + + //create log file + logFile = fopen(logFileName, "a"); + +CLEANUP:; + //DOFREE(date_string); + /*if(session_uid!=NULL){ + MEM_free(session_uid); + session_uid=NULL; + }*/ +} + + + +void set_bypass(logical bypass) +{ + //AM__set_application_bypass(bypass); + POM_AM__set_application_bypass(bypass); +} + +bool isClass(tag_t class_id, char* className) { + tag_t* pclass_ids = NULL; + char* class_name = NULL; + int pclass_count = 0, ifail = ITK_ok; + ITKCALL(POM_name_of_class(class_id, &class_name)); + printf("class name = %s\n", class_name); + bool isType = false; + if (strcmp(class_name, className) == 0) { + isType = true; + } + DOFREE(class_name); + if (isType) { + return true; + } + ITKCALL(ifail = POM_superclasses_of_class(class_id, &pclass_count, &pclass_ids)); + for (int i = 0; i < pclass_count; i++) { + isType = isClass(pclass_ids[i], className); + if (isType) { + return true; + } + } + return false; +} + +bool isType(tag_t item, char* type) { + tag_t class_id = NULLTAG, * pclass_ids = NULL; + char* class_name = NULL; + int pclass_count = 0, ifail = ITK_ok; + + ITKCALL(POM_class_of_instance(item, &class_id)); + return isClass(class_id, type); +} + +void deleteFile(bool debug, char* path) { + //?3y???t + if (remove(path) == 0) { + WriteLog(debug, "Delete File: %s", path); + } + else { + WriteLog(debug, "Delete File failed: %s", path); + } +} + + +int readError(bool debug, char* errFilePath, int errCode) { + fstream _file; + _file.open(errFilePath, ios::in); + if (_file) { + WriteLog(debug, "Find Error File: %s", errFilePath); + ifstream fin(errFilePath); + string s; + while (getline(fin, s)) + { + WriteLog(debug, s.c_str()); + EMH_store_error_s1(EMH_severity_error, errCode, s.c_str()); + } + _file.close(); + return errCode; + } + return ITK_ok; +} + +//??y?Y? +int import_dataset_file(tag_t dataset, const char* ref_name, char* ext, char* fullfilename, char* original_name) +{ + int ifail = ITK_ok; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + AOM_refresh(dataset, FALSE); + char* new_file_name = NULL; + char new_ds_name[WSO_name_size_c + 1] = ""; + char* filename = NULL; + new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + filename = strrchr(fullfilename, '\\') + 1; + if (filename == NULL) + return ITK_ok; + set_bypass(true); + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_TEXT, &new_file_tag, &file_descriptor)); + if (ifail != ITK_ok) { + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + } + ITKCALL(ifail = IMF_set_original_file_name2(new_file_tag, original_name)); + + ITKCALL(ifail = IMF_close_file(file_descriptor)); + ITKCALL(ifail = AOM_save(new_file_tag)); + AOM_unlock(new_file_tag); + ITKCALL(ifail = AOM_refresh(new_file_tag, FALSE)); + //?????y? + set_bypass(true); + ITKCALL(AOM_lock(dataset)); + ITKCALL(ifail = AE_remove_dataset_named_ref2(dataset, ref_name)); + ITKCALL(ifail = AOM_save(dataset)); + set_bypass(true); + ITKCALL(ifail = AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + AOM_save(dataset); + AOM_unlock(dataset); + set_bypass(false); + //ITKCALL( AOM_refresh( dataset, FALSE ) ); + return ifail; +} + +//??y?Y? +int import_dataset_file_binary(tag_t dataset, const char* ref_name, char* ext, char* fullfilename, char* original_name) +{ + int ifail = ITK_ok; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor = NULL; + AOM_refresh(dataset, FALSE); + char* new_file_name = NULL; + char new_ds_name[WSO_name_size_c + 1] = ""; + char* filename = NULL; + new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + filename = strrchr(fullfilename, '\\') + 1; + if (filename == NULL) + return ITK_ok; + set_bypass(true); + ITKCALL(ifail = IMF_import_file(fullfilename, new_file_name, SS_BINARY, &new_file_tag, &file_descriptor)); + ITKCALL(ifail = IMF_set_original_file_name2(new_file_tag, original_name)); + + ITKCALL(ifail = IMF_close_file(file_descriptor)); + ITKCALL(ifail = AOM_save(new_file_tag)); + AOM_unlock(new_file_tag); + ITKCALL(ifail = AOM_refresh(new_file_tag, FALSE)); + //?????y? + set_bypass(true); + ITKCALL(AOM_lock(dataset)); + ITKCALL(ifail = AE_remove_dataset_named_ref2(dataset, ref_name)); + ITKCALL(ifail = AOM_save(dataset)); + set_bypass(true); + ITKCALL(ifail = AE_add_dataset_named_ref2(dataset, ref_name, AE_PART_OF, new_file_tag)); + AOM_save(dataset); + AOM_unlock(dataset); + set_bypass(false); + //ITKCALL( AOM_refresh( dataset, FALSE ) ); + return ifail; +} + + +void Split(string strArg, char spliter, vector& ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + while (strArg.size() > 0) + { + index0 = strArg.find_first_of(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + 1); + ans.push_back(one_arg); + } + else + { + ans.push_back(strArg); + break; + } + } +} + +void Split(string strArg, string spliter, vector& ans) +{ + ans.clear(); + size_t index0 = 0; + string one_arg; + if (strArg.find_first_not_of(' ') == string::npos) + strArg = ""; + int len = spliter.size(); + while (strArg.size() > 0) + { + index0 = strArg.find(spliter); + if (index0 != string::npos) + { + one_arg = strArg.substr(0, index0); + strArg = strArg.substr(index0 + len); + ans.push_back(one_arg); + if (strArg.size() == 0) { + ans.push_back(strArg); + } + } + else + { + ans.push_back(strArg); + break; + } + } +} + +bool inArray(vector types, string type) { + int len = types.size(); + for (int i = 0; i < len; i++) { + if (type == types[i]) { + return true; + } + } + return false; +} + +int getIndexInArray(vector types, string type) { + int len = types.size(); + for (int i = 0; i < len; i++) { + if (strcmp(types[i].c_str(), type.c_str()) == 0) { + return i; + } + } + return -1; +} + +bool CheckType(string config, char* type, char spliter) { + vector types; + Split(config, spliter, types); + int len = types.size(); + for (int i = 0; i < len; i++) { + if (strcmp(types[i].c_str(), type) == 0) { + return true; + } + } + return false; +} + +int GetProcessTargets(bool debug, int att_cnt, tag_t* attachments, vector& targets, char* formType, char splitter) { + char* object_name = NULL, * object_type = NULL; + int ifail = ITK_ok; + WriteLog(debug, "Get Targets of Process: %d", att_cnt); + for (int i = 0; i < att_cnt; i++) { + ITKCALL(ifail = WSOM_ask_name2(attachments[i], &object_name)); + ITKCALL(ifail = WSOM_ask_object_type2(attachments[i], &object_type)); + WriteLog(debug, "%d. Target [%s], type: %s", i + 1, object_name, object_type); + //if (strcmp(object_type, TYPE_ITEM_PZJ.c_str()) == 0) { + if (CheckType(formType, object_type, splitter)) { + targets.push_back(attachments[i]); + } + DOFREE(object_name); + DOFREE(object_type); + } + return ITK_ok; +} + +int findUser(bool debug, string userStr, tag_t* user_tag) { + int ind1 = userStr.find_first_of('('); + int ind2 = userStr.find_first_of(')'); + WriteLog(debug, "Search User: %s", userStr.c_str()); + if (ind1 != string::npos && ind2 != string::npos && ind1 < ind2) { + userStr = userStr.substr(ind1 + 1, ind2 - ind1 - 1); + WriteLog(debug, ">> User id: %s", userStr.c_str()); + } + int ifail = ITK_ok; + ITKCALL(ifail = SA_find_user2(userStr.c_str(), user_tag)); + return ifail; +} + +int GetBomLinePropString(bool debug, tag_t line, char* propName, int errCode, char** attr_val) { + int attribute_id = 0, ifail = ITK_ok; + ITKCALL(ifail = BOM_line_look_up_attribute(propName, &attribute_id)); + if (attribute_id == 0) { + WriteLog(debug, "BOMLine property not exist: %s", propName); + EMH_store_error_s2(EMH_severity_error, errCode, "BOMLine property not exist", propName); + return errCode; + } + else { + ITKCALL(ifail = BOM_line_ask_attribute_string(line, attribute_id, &*attr_val)); + return ifail; + } + return ITK_ok; +} + +int GetStringProp(tag_t obj, char* propName, char** attr_val) { + return AOM_ask_value_string(obj, propName, &*attr_val); +} + +bool isRev(char* object_type) { + if (((strstr(object_type, "Revision") != NULL) || (strstr(object_type, "revision") != NULL)) + && (strstr(object_type, "Master") == NULL) && (strstr(object_type, "master") == NULL) + && (strstr(object_type, "BOM") == NULL) && (strstr(object_type, "bom") == NULL) && (strstr(object_type, "Bom") == NULL)) { + return true; + } + return false; +} + +int GetBomView(tag_t rev_tag, const char* viewtype, tag_t* bomView, tag_t* bomBVR, bool debug) +{ + WriteLog(debug, "Get BOM View: %s", viewtype); + int ifail = ITK_ok, bvr_count = 0; + tag_t* bvr_list = NULL, bom_view = NULLTAG, view_type = NULLTAG; + *bomBVR = NULLTAG; + *bomView = NULLTAG; + ITKCALL(ITEM_rev_list_bom_view_revs(rev_tag, &bvr_count, &bvr_list)); + if (bvr_count > 0) + { + for (int i = 0; i < bvr_count; i++) + { + ITKCALL(PS_ask_bom_view_of_bvr(bvr_list[i], &bom_view)); + + ITKCALL(PS_ask_bom_view_type(bom_view, &view_type)); + //ITKCALL( PS_find_view_type(bom_view, &view_type)); + char* view_type_name = NULL; + ITKCALL(PS_ask_view_type_name(view_type, &view_type_name)); + WriteLog(debug, "Find View: %s", view_type_name); + if (tc_strcmp(view_type_name, viewtype) == 0) + { + *bomBVR = bvr_list[i]; + *bomView = bom_view; + } + DOFREE(view_type_name); + } + } + //else { + // WriteLog(debug, "??D??bvr?a???DD?"); + // tag_t bv = NULLTAG, bvr = NULLTAG, item_tag = NULLTAG; + // int bvCnt = 0; + // tag_t* bvTags = NULL; + + + // ITKCALL(ifail = ITEM_ask_item_of_rev(rev_tag, &item_tag)); + + + // tag_t tWindow = NULLTAG; + // ITKCALL(BOM_create_window(&tWindow)); + + // tag_t tTopLine = NULLTAG; + // ITKCALL(BOM_set_window_top_line(tWindow, item_tag, NULLTAG, NULLTAG, &tTopLine)); + + // //2??-BOM? + // ITKCALL(ifail=ITEM_list_bom_views(item_tag, &bvCnt, &bvTags)); + // if (bvCnt > 0) { + // WriteLog(debug, "??????BOM?o%d", bvCnt); + // bv = bvTags[0]; + // } + // ITKCALL(AOM_lock(item_tag)); + // if (bv == NULLTAG) { + // ITKCALL(ifail=PS_create_bom_view(NULLTAG, "", "", item_tag, &bv)); + // if (ifail != ITK_ok) { + // ITKCALL(AOM_unlock(item_tag)); + // return ifail; + // } + // ITKCALL(AOM_save(bv)); + // } + // ITKCALL(ifail=PS_create_bvr(bv, "", "", false, rev_tag, &bvr)); + // if (ifail != ITK_ok) { + // ITKCALL(AOM_unlock(item_tag)); + // return ifail; + // } + // ITKCALL(AOM_save(bvr)); + // ITKCALL(AOM_save(bv)); + // ITKCALL(AOM_save(item_tag)); + + // tag_t tChildLine = NULLTAG; + + // ITKCALL(BOM_save_window(tWindow)); + // ITKCALL(BOM_close_window(tWindow)); + + // ITKCALL(AOM_unlock(item_tag)); + // *bomBVR = bvr; + // *bomView = bv; + // WriteLog(debug, "bvrD??3"); + // DOFREE(bvTags); + + //} + DOFREE(bvr_list); + return ifail; +} + +bool propExist(bool debug, tag_t obj, const char* propName) { + tag_t clTag = NULLTAG, * superClass = NULL; + char* clName = NULL; + int ifail = ITK_ok, cnt = 0; + logical exists = false; + ITKCALL(ifail = POM_class_of_instance(obj, &clTag)); + if (ifail != ITK_ok) { return false; } + ITKCALL(ifail = POM_name_of_class(clTag, &clName)); + if (ifail != ITK_ok) { return false; } + WriteLog(debug, ">> [%s] Check Property: %s", clName, propName); + ITKCALL(ifail = POM_attr_exists(propName, clName, &exists)); + if (ifail != ITK_ok) { return false; } + DOFREE(clName); + if (exists) { + //WriteLog(debug,"?D???"); + return exists; + } + ITKCALL(ifail = POM_superclasses_of_class(clTag, &cnt, &superClass)); + for (int i = 0; i < cnt; i++) { + ITKCALL(ifail = POM_name_of_class(superClass[i], &clName)); + if (ifail != ITK_ok) { return false; } + WriteLog(debug, ">> [%s] Check Property: %s", clName, propName); + ITKCALL(ifail = POM_attr_exists(propName, clName, &exists)); + DOFREE(clName); + if (exists) { + //WriteLog(debug, "?D???"); + return exists; + } + } + WriteLog(debug, "Property not exist"); + return exists; +} + +string trim(const string& str) +{ + size_t first = str.find_first_not_of(' '); + if (string::npos == first) + { + return str; + } + size_t last = str.find_last_not_of(' '); + string res= str.substr(first, (last - first + 1)); + last = res.find("\n"); + if (last == res.size() - 1) { + res = res.substr(0, res.size() - 1); + } + last = res.find("\r"); + if (last == res.size() - 1) { + res = res.substr(0, res.size() - 1); + } + return res; +} + +char* U2G(const char* utf8) +{ + int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wstr, len); + len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_ACP, 0, wstr, -1, str, len, NULL, NULL); + if (wstr) delete[] wstr; + return str; +} + + + +char* G2U(const char* gb2312) +{ + int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0); + wchar_t* wstr = new wchar_t[len + 1]; + memset(wstr, 0, len + 1); + MultiByteToWideChar(CP_ACP, 0, gb2312, -1, wstr, len); + len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + char* str = new char[len + 1]; + memset(str, 0, len + 1); + WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL); + if (wstr) delete[] wstr; + return str; +} + +int getPrefStrings(const char* preference, TC_preference_search_scope_t scope, vector& pref_vec) +{ + int ifail = ITK_ok, i = 0, j = 0, k = 0, num = 0; + char** values; + TC_preference_search_scope_t old_scope; + //ITKCALL(ifail = PREF_ask_search_scope(&old_scope)); + //ITKCALL(ifail = PREF_set_search_scope(scope)); + //ITKCALL(ifail = PREF_ask_char_values(preference, &num, &values)); + ITKCALL(ifail = PREF_ask_char_values_at_location(preference, scope, &num, &values)); + if (ifail != ITK_ok) { + return ifail; + } + for (i = 0; i < num; i++) + { + pref_vec.push_back(values[i]); + } + DOFREE(values); + //ITKCALL(ifail = PREF_set_search_scope(old_scope)); + return ifail; +} + +int getPrefStrings2(const char* preference, TC_preference_search_scope_t scope, char splitter, vector& pref_vec) +{ + int ifail = ITK_ok, i = 0, j = 0, k = 0, num = 0; + char** values; + TC_preference_search_scope_t old_scope; + //ITKCALL(ifail = PREF_ask_search_scope(&old_scope)); + //ITKCALL(ifail = PREF_set_search_scope(scope)); + //ITKCALL(ifail = PREF_ask_char_values(preference, &num, &values)); + ITKCALL(ifail = PREF_ask_char_values_at_location(preference, scope, &num, &values)); + if (ifail != ITK_ok) { + return ifail; + } + for (i = 0; i < num; i++) + { + vector split; + Split(values[i], splitter, split); + int size = split.size(); + for (j = 0; j < size; j++) { + pref_vec.push_back(split[j]); + } + /*for each (string val in split) { + pref_vec.push_back(val); + }*/ + } + DOFREE(values); + //ITKCALL(ifail = PREF_set_search_scope(old_scope)); + return ifail; +} + +//?3?y?Y????t +int export_dataset_file(bool debug, tag_t dataset, const char* ref_name, const char* ext, char** filename, char** original_name) +{ + int ifail = ITK_ok; + tag_t ref_object = NULLTAG, + datasettype = NULLTAG, + new_ds = NULLTAG, + tool = NULLTAG, + folder_tag = NULLTAG, + spec_dataset_rev = NULLTAG; + AE_reference_type_t reference_type; + tag_t new_file_tag = NULLTAG; + IMF_file_t file_descriptor; + char* target_ds_name = NULL; + char* new_file_name; + WSOM_ask_name2(dataset, &target_ds_name); + WriteLog(debug, "Download file from dataset %s", target_ds_name); + DOFREE(target_ds_name); + *filename = (char*)MEM_alloc(sizeof(char) * 512); + *original_name = (char*)MEM_alloc(sizeof(char) * 512); + strcpy(*filename, ""); + AE_ask_dataset_latest_rev(dataset, &spec_dataset_rev); + AE_ask_dataset_named_ref2(dataset, ref_name, &reference_type, &ref_object); + if (ref_object == NULLTAG) + { + WriteLog(debug, "File ref not exist"); + return 1; + } + if (reference_type == AE_PART_OF) + { + char* pathname2 = NULL; + IMF_ask_file_pathname2(ref_object, SS_WNT_MACHINE, &pathname2); + DOFREE(pathname2); + char* origin_file_name2 = NULL; + IMF_ask_original_file_name2(ref_object, &origin_file_name2); + strcpy(*original_name, origin_file_name2); + DOFREE(origin_file_name2); + char new_ds_name[WSO_name_size_c + 1] = ""; + char* new_file_name = USER_new_file_name(new_ds_name, ref_name, ext, 0); + char* temp_dir = getenv("TEMP"); + char temp_file[SS_MAXPATHLEN] = ""; + strcpy(temp_file, temp_dir); + //strcat(temp_file, "\\tc_"); + //strcat(temp_file, userId); + strcat(temp_file, "\\"); + strcat(temp_file, new_file_name); + WriteLog(debug, "Temp path: %s", temp_file); + if ((_access(temp_file, 0)) != -1) { + if (!remove(temp_file)) { + remove(temp_file); + } + } + IMF_export_file(ref_object, temp_file); + strcpy(*filename, temp_file); + return ITK_ok; + } + return -1; +} \ No newline at end of file diff --git a/connor_erp_mes/kutil.h b/connor_erp_mes/kutil.h new file mode 100644 index 0000000..5734b91 --- /dev/null +++ b/connor_erp_mes/kutil.h @@ -0,0 +1,93 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifdef WIN32 +#include +#include +#else +#include +#endif + +#define DOFREE(obj) \ +{ \ + if(obj) \ + { \ + MEM_free(obj); \ + obj = NULL; \ + } \ +} + +extern "C" int POM_AM__set_application_bypass(logical bypass); + +using namespace std; + +char* getTime(); +int getCurrentMilliSeconds(); +string trim(const string& str); +void WriteLog(logical debug, const char* format, ...); +void set_bypass(logical bypass); +char* G2U(const char* gb2312); +char* U2G(const char* utf8); +int getPrefStrings(const char* preference, TC_preference_search_scope_t scope, vector& pref_vec); +int export_dataset_file(bool debug, tag_t dataset, const char* ref_name, const char* ext, char** filename, char** original_name); +int GetBomView(tag_t rev_tag, const char* viewtype, tag_t* bomView, tag_t* bomBVR, bool debug); +int GetBomLinePropString(bool debug, tag_t line, char* propName, int errCode, char** attr_val); +void Split(string strArg, char spliter, vector& ans); +void Split(string strArg, string spliter, vector& ans); +int getPrefStrings2(const char* preference, TC_preference_search_scope_t scope, char splitter, vector& pref_vec); +int import_dataset_file(tag_t dataset, const char* ref_name, char* ext, char* fullfilename, char* original_name); +int import_dataset_file_binary(tag_t dataset, const char* ref_name, char* ext, char* fullfilename, char* original_name); +int readError(bool debug, char* errFilePath, int errCode); +void deleteFile(bool debug, char* path); +bool CheckType(string config, char* type, char spliter); +bool propExist(bool debug, tag_t obj, const char* propName); +bool isRev(char* object_type); +int GetProcessTargets(bool debug, int att_cnt, tag_t* attachments, vector& targets, char* formType, char splitter); +bool inArray(vector types, string type); +int getIndexInArray(vector types, string type); +int findUser(bool debug, string userStr, tag_t* user_tag); +bool isType(tag_t item, char* type); +void initUserDir(char* userId); +int CreateUserFile(logical debug, const char* FunctionName, char* userId, char** fullname, FILE** file); +int WriteToFile(FILE* file, const char* text); \ No newline at end of file diff --git a/connor_erp_mes/md5.cpp b/connor_erp_mes/md5.cpp new file mode 100644 index 0000000..c1d7139 --- /dev/null +++ b/connor_erp_mes/md5.cpp @@ -0,0 +1,273 @@ +/** + * @file md5.cpp + * @The implement of md5. + * @author Jiewei Wei + * @mail weijieweijerry@163.com + * @github https://github.com/JieweiWei + * @data Oct 19 2014 + * + */ + +#include "md5.h" + + /* Define the static member of MD5. */ +const byte MD5::PADDING[64] = { 0x80 }; +const char MD5::HEX_NUMBERS[16] = { + '0', '1', '2', '3', + '4', '5', '6', '7', + '8', '9', 'a', 'b', + 'c', 'd', 'e', 'f' +}; + +/** + * @Construct a MD5 object with a string. + * + * @param {message} the message will be transformed. + * + */ +MD5::MD5(const string& message) { + finished = false; + /* Reset number of bits. */ + count[0] = count[1] = 0; + /* Initialization constants. */ + state[0] = 0x67452301; + state[1] = 0xefcdab89; + state[2] = 0x98badcfe; + state[3] = 0x10325476; + + /* Initialization the object according to message. */ + init((const byte*)message.c_str(), message.length()); +} + +/** + * @Generate md5 digest. + * + * @return the message-digest. + * + */ +const byte* MD5::getDigest() { + if (!finished) { + finished = true; + + byte bits[8]; + bit32 oldState[4]; + bit32 oldCount[2]; + bit32 index, padLen; + + /* Save current state and count. */ + memcpy(oldState, state, 16); + memcpy(oldCount, count, 8); + + /* Save number of bits */ + encode(count, bits, 8); + + /* Pad out to 56 mod 64. */ + index = (bit32)((count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + init(PADDING, padLen); + + /* Append length (before padding) */ + init(bits, 8); + + /* Store state in digest */ + encode(state, digest, 16); + + /* Restore current state and count. */ + memcpy(state, oldState, 16); + memcpy(count, oldCount, 8); + } + return digest; +} + +/** + * @Initialization the md5 object, processing another message block, + * and updating the context. + * + * @param {input} the input message. + * + * @param {len} the number btye of message. + * + */ +void MD5::init(const byte* input, size_t len) { + + bit32 i, index, partLen; + + finished = false; + + /* Compute number of bytes mod 64 */ + index = (bit32)((count[0] >> 3) & 0x3f); + + /* update number of bits */ + if ((count[0] += ((bit32)len << 3)) < ((bit32)len << 3)) { + ++count[1]; + } + count[1] += ((bit32)len >> 29); + + partLen = 64 - index; + + /* transform as many times as possible. */ + if (len >= partLen) { + + memcpy(&buffer[index], input, partLen); + transform(buffer); + + for (i = partLen; i + 63 < len; i += 64) { + transform(&input[i]); + } + index = 0; + + } + else { + i = 0; + } + + /* Buffer remaining input */ + memcpy(&buffer[index], &input[i], len - i); +} + +/** + * @MD5 basic transformation. Transforms state based on block. + * + * @param {block} the message block. + */ +void MD5::transform(const byte block[64]) { + + bit32 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + decode(block, x, 64); + + /* Round 1 */ + FF(a, b, c, d, x[0], s11, 0xd76aa478); + FF(d, a, b, c, x[1], s12, 0xe8c7b756); + FF(c, d, a, b, x[2], s13, 0x242070db); + FF(b, c, d, a, x[3], s14, 0xc1bdceee); + FF(a, b, c, d, x[4], s11, 0xf57c0faf); + FF(d, a, b, c, x[5], s12, 0x4787c62a); + FF(c, d, a, b, x[6], s13, 0xa8304613); + FF(b, c, d, a, x[7], s14, 0xfd469501); + FF(a, b, c, d, x[8], s11, 0x698098d8); + FF(d, a, b, c, x[9], s12, 0x8b44f7af); + FF(c, d, a, b, x[10], s13, 0xffff5bb1); + FF(b, c, d, a, x[11], s14, 0x895cd7be); + FF(a, b, c, d, x[12], s11, 0x6b901122); + FF(d, a, b, c, x[13], s12, 0xfd987193); + FF(c, d, a, b, x[14], s13, 0xa679438e); + FF(b, c, d, a, x[15], s14, 0x49b40821); + + /* Round 2 */ + GG(a, b, c, d, x[1], s21, 0xf61e2562); + GG(d, a, b, c, x[6], s22, 0xc040b340); + GG(c, d, a, b, x[11], s23, 0x265e5a51); + GG(b, c, d, a, x[0], s24, 0xe9b6c7aa); + GG(a, b, c, d, x[5], s21, 0xd62f105d); + GG(d, a, b, c, x[10], s22, 0x2441453); + GG(c, d, a, b, x[15], s23, 0xd8a1e681); + GG(b, c, d, a, x[4], s24, 0xe7d3fbc8); + GG(a, b, c, d, x[9], s21, 0x21e1cde6); + GG(d, a, b, c, x[14], s22, 0xc33707d6); + GG(c, d, a, b, x[3], s23, 0xf4d50d87); + GG(b, c, d, a, x[8], s24, 0x455a14ed); + GG(a, b, c, d, x[13], s21, 0xa9e3e905); + GG(d, a, b, c, x[2], s22, 0xfcefa3f8); + GG(c, d, a, b, x[7], s23, 0x676f02d9); + GG(b, c, d, a, x[12], s24, 0x8d2a4c8a); + + /* Round 3 */ + HH(a, b, c, d, x[5], s31, 0xfffa3942); + HH(d, a, b, c, x[8], s32, 0x8771f681); + HH(c, d, a, b, x[11], s33, 0x6d9d6122); + HH(b, c, d, a, x[14], s34, 0xfde5380c); + HH(a, b, c, d, x[1], s31, 0xa4beea44); + HH(d, a, b, c, x[4], s32, 0x4bdecfa9); + HH(c, d, a, b, x[7], s33, 0xf6bb4b60); + HH(b, c, d, a, x[10], s34, 0xbebfbc70); + HH(a, b, c, d, x[13], s31, 0x289b7ec6); + HH(d, a, b, c, x[0], s32, 0xeaa127fa); + HH(c, d, a, b, x[3], s33, 0xd4ef3085); + HH(b, c, d, a, x[6], s34, 0x4881d05); + HH(a, b, c, d, x[9], s31, 0xd9d4d039); + HH(d, a, b, c, x[12], s32, 0xe6db99e5); + HH(c, d, a, b, x[15], s33, 0x1fa27cf8); + HH(b, c, d, a, x[2], s34, 0xc4ac5665); + + /* Round 4 */ + II(a, b, c, d, x[0], s41, 0xf4292244); + II(d, a, b, c, x[7], s42, 0x432aff97); + II(c, d, a, b, x[14], s43, 0xab9423a7); + II(b, c, d, a, x[5], s44, 0xfc93a039); + II(a, b, c, d, x[12], s41, 0x655b59c3); + II(d, a, b, c, x[3], s42, 0x8f0ccc92); + II(c, d, a, b, x[10], s43, 0xffeff47d); + II(b, c, d, a, x[1], s44, 0x85845dd1); + II(a, b, c, d, x[8], s41, 0x6fa87e4f); + II(d, a, b, c, x[15], s42, 0xfe2ce6e0); + II(c, d, a, b, x[6], s43, 0xa3014314); + II(b, c, d, a, x[13], s44, 0x4e0811a1); + II(a, b, c, d, x[4], s41, 0xf7537e82); + II(d, a, b, c, x[11], s42, 0xbd3af235); + II(c, d, a, b, x[2], s43, 0x2ad7d2bb); + II(b, c, d, a, x[9], s44, 0xeb86d391); + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; +} + +/** +* @Encodes input (unsigned long) into output (byte). +* +* @param {input} usigned long. +* +* @param {output} byte. +* +* @param {length} the length of input. +* +*/ +void MD5::encode(const bit32* input, byte* output, size_t length) { + + for (size_t i = 0, j = 0; j < length; ++i, j += 4) { + output[j] = (byte)(input[i] & 0xff); + output[j + 1] = (byte)((input[i] >> 8) & 0xff); + output[j + 2] = (byte)((input[i] >> 16) & 0xff); + output[j + 3] = (byte)((input[i] >> 24) & 0xff); + } +} + +/** + * @Decodes input (byte) into output (usigned long). + * + * @param {input} bytes. + * + * @param {output} unsigned long. + * + * @param {length} the length of input. + * + */ +void MD5::decode(const byte* input, bit32* output, size_t length) { + for (size_t i = 0, j = 0; j < length; ++i, j += 4) { + output[i] = ((bit32)input[j]) | (((bit32)input[j + 1]) << 8) | + (((bit32)input[j + 2]) << 16) | (((bit32)input[j + 3]) << 24); + } +} + + +/** + * @Convert digest to string value. + * + * @return the hex string of digest. + * + */ +string MD5::toStr() { + const byte* digest_ = getDigest(); + string str; + str.reserve(16 << 1); + for (size_t i = 0; i < 16; ++i) { + int t = digest_[i]; + int a = t / 16; + int b = t % 16; + str.append(1, HEX_NUMBERS[a]); + str.append(1, HEX_NUMBERS[b]); + } + return str; +} \ No newline at end of file diff --git a/connor_erp_mes/md5.h b/connor_erp_mes/md5.h new file mode 100644 index 0000000..1ee13d3 --- /dev/null +++ b/connor_erp_mes/md5.h @@ -0,0 +1,137 @@ +/** + * @file md5.h + * @The header file of md5. + * @author Jiewei Wei + * @mail weijieweijerry@163.com + * @github https://github.com/JieweiWei + * @data Oct 19 2014 + * + */ + +#ifndef MD5_H +#define MD5_H + + /* Parameters of MD5. */ +#define s11 7 +#define s12 12 +#define s13 17 +#define s14 22 +#define s21 5 +#define s22 9 +#define s23 14 +#define s24 20 +#define s31 4 +#define s32 11 +#define s33 16 +#define s34 23 +#define s41 6 +#define s42 10 +#define s43 15 +#define s44 21 + +/** + * @Basic MD5 functions. + * + * @param there bit32. + * + * @return one bit32. + */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + + /** + * @Rotate Left. + * + * @param {num} the raw number. + * + * @param {n} rotate left n. + * + * @return the number after rotated left. + */ +#define ROTATELEFT(num, n) (((num) << (n)) | ((num) >> (32-(n)))) + + /** + * @Transformations for rounds 1, 2, 3, and 4. + */ +#define FF(a, b, c, d, x, s, ac) { \ + (a) += F ((b), (c), (d)) + (x) + ac; \ + (a) = ROTATELEFT ((a), (s)); \ + (a) += (b); \ +} +#define GG(a, b, c, d, x, s, ac) { \ + (a) += G ((b), (c), (d)) + (x) + ac; \ + (a) = ROTATELEFT ((a), (s)); \ + (a) += (b); \ +} +#define HH(a, b, c, d, x, s, ac) { \ + (a) += H ((b), (c), (d)) + (x) + ac; \ + (a) = ROTATELEFT ((a), (s)); \ + (a) += (b); \ +} +#define II(a, b, c, d, x, s, ac) { \ + (a) += I ((b), (c), (d)) + (x) + ac; \ + (a) = ROTATELEFT ((a), (s)); \ + (a) += (b); \ +} + +#include +#include + +using std::string; + +/* Define of btye.*/ +typedef unsigned char byte; +/* Define of byte. */ +typedef unsigned int bit32; + +class MD5 { +public: + /* Construct a MD5 object with a string. */ + MD5(const string& message); + + /* Generate md5 digest. */ + const byte* getDigest(); + + /* Convert digest to string value */ + string toStr(); + +private: + /* Initialization the md5 object, processing another message block, + * and updating the context.*/ + void init(const byte* input, size_t len); + + /* MD5 basic transformation. Transforms state based on block. */ + void transform(const byte block[64]); + + /* Encodes input (usigned long) into output (byte). */ + void encode(const bit32* input, byte* output, size_t length); + + /* Decodes input (byte) into output (usigned long). */ + void decode(const byte* input, bit32* output, size_t length); + +private: + /* Flag for mark whether calculate finished. */ + bool finished; + + /* state (ABCD). */ + bit32 state[4]; + + /* number of bits, low-order word first. */ + bit32 count[2]; + + /* input buffer. */ + byte buffer[64]; + + /* message digest. */ + byte digest[16]; + + /* padding for calculate. */ + static const byte PADDING[64]; + + /* Hex numbers. */ + static const char HEX_NUMBERS[16]; +}; + +#endif // MD5_H \ No newline at end of file diff --git a/connor_erp_mes/plugin.c b/connor_erp_mes/plugin.c new file mode 100644 index 0000000..01ea041 --- /dev/null +++ b/connor_erp_mes/plugin.c @@ -0,0 +1,97 @@ +/* + plugin.c + + Example gSOAP plug-in + + Copyright (C) 2000-2002 Robert A. van Engelen. All Rights Reserved. + + Compile & link with gSOAP clients and services to view SOAP messages. + + Usage (client/server code): + struct soap soap; + soap_init(&soap); + soap_register_plugin(&soap, plugin); // register plugin + ... + ... = soap_copy(&soap); // copies plugin too + ... + soap_done(&soap); // detach plugin + + A plugin is copied with the soap_copy() call. Upon this call, two + situations may arise depending on setting the fcopy() callback and + the need to share or not share plugin data: + + 1. if the plugin fcopy() callback is set, it will be called to allow + the plugin to copy its local data. When soap_done() is called on + the copy, the fdelete() callback is called for cleanup. + + 2. if the plugin fcopy() callback is not set, then the plugin data + will be shared (i.e. the data pointer points to the same address). + The fdelete() callback will not be called upon a soap_done() on a + copy of the soap struct. The fdelete() callback will be called for + the original soap struct with which the plugin registered. + +*/ + +#include "plugin.h" + +static const char plugin_id[] = PLUGIN_ID; + +static int plugin_init(struct soap *soap, struct plugin_data *data); +static int plugin_copy(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src); +static void plugin_delete(struct soap *soap, struct soap_plugin *p); +static int plugin_send(struct soap *soap, const char *buf, size_t len); +static size_t plugin_recv(struct soap *soap, char *buf, size_t len); + +int plugin(struct soap *soap, struct soap_plugin *p, void *arg) +{ + p->id = plugin_id; + p->data = (void*)malloc(sizeof(struct plugin_data)); + /* optional: define fcopy() operation. When defined, fdelete() will be called for every copy of the plugin created with fcopy(), when NOT defined, fdelete() will only be called on the original non-copied plugin */ + p->fcopy = plugin_copy; + p->fdelete = plugin_delete; + if (!p->data) + return SOAP_EOM; + if (plugin_init(soap, (struct plugin_data*)p->data)) + { + free(p->data); /* error: could not init */ + return SOAP_EOM; /* return error */ + } + return SOAP_OK; +} + +static int plugin_init(struct soap *soap, struct plugin_data *data) +{ + data->fsend = soap->fsend; /* save old recv callback */ + data->frecv = soap->frecv; /* save old send callback */ + soap->fsend = plugin_send; /* replace send callback with ours */ + soap->frecv = plugin_recv; /* replace recv callback with ours */ + return SOAP_OK; +} + +static int plugin_copy(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src) +{ + if (!(dst->data = (struct plugin_data*)malloc(sizeof(struct plugin_data)))) + return SOAP_EOM; + (*dst).data = (*src).data; + return SOAP_OK; +} + +static void plugin_delete(struct soap *soap, struct soap_plugin *p) +{ + free(p->data); /* free allocated plugin data. If fcopy() is not set, then this function is not called for all copies of the plugin created with soap_copy(). In this example, the fcopy() callback can be safely omitted. When omitted, the plugin data is shared by the soap copies created with soap_copy() */ +} + +static int plugin_send(struct soap *soap, const char *buf, size_t len) +{ + struct plugin_data *data = (struct plugin_data*)soap_lookup_plugin(soap, plugin_id); + fwrite(buf, len, 1, stderr); + return data->fsend(soap, buf, len); /* pass data on to old send callback */ +} + +static size_t plugin_recv(struct soap *soap, char *buf, size_t len) +{ + struct plugin_data *data = (struct plugin_data*)soap_lookup_plugin(soap, plugin_id); + size_t res = data->frecv(soap, buf, len); /* get data from old recv callback */ + fwrite(buf, res, 1, stderr); + return res; +} diff --git a/connor_erp_mes/plugin.h b/connor_erp_mes/plugin.h new file mode 100644 index 0000000..23cb081 --- /dev/null +++ b/connor_erp_mes/plugin.h @@ -0,0 +1,27 @@ +/* + plugin.h + + Example gSOAP plug-in. Include this file and link with plugin.c + + Copyright (C) 2000-2002 Robert A. van Engelen. All Rights Reserved. +*/ + +#include "stdsoap2.h" + +#define PLUGIN_ID "SOAP-PLUGIN/1.0" /* plugin identification */ + +#ifdef __cplusplus +extern "C" { +#endif + +struct plugin_data { + int (*fsend)(struct soap*, const char*, size_t); /* example: to save and use send callback */ + size_t (*frecv)(struct soap*, char*, size_t); /* example: to save and use recv callback */ +}; + +int plugin(struct soap *soap, struct soap_plugin *plugin, void *arg); + +#ifdef __cplusplus +} +#endif + diff --git a/connor_erp_mes/stdsoap2.cpp b/connor_erp_mes/stdsoap2.cpp new file mode 100644 index 0000000..a112700 --- /dev/null +++ b/connor_erp_mes/stdsoap2.cpp @@ -0,0 +1,22947 @@ +/* + stdsoap2.c[pp] 2.8.91 + + gSOAP runtime engine + +gSOAP XML Web services tools +Copyright (C) 2000-2019, Robert van Engelen, Genivia Inc., All Rights Reserved. +This part of the software is released under ONE of the following licenses: +GPL, or the gSOAP public license, or Genivia's license for commercial use. +-------------------------------------------------------------------------------- +Contributors: + +Wind River Systems, Inc., for the following addition licensed under the gSOAP +public license: + - vxWorks compatible, enabled with compiler option -DVXWORKS +-------------------------------------------------------------------------------- +gSOAP public license. + +The contents of this file are subject to the gSOAP Public License Version 1.3 +(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.cs.fsu.edu/~engelen/soaplicense.html +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the License. + +The Initial Developer of the Original Code is Robert A. van Engelen. +Copyright (C) 2000-2019, Robert van Engelen, Genivia Inc., All Rights Reserved. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#define GSOAP_LIB_VERSION 20891 + +#ifdef AS400 +# pragma convert(819) /* EBCDIC to ASCII */ +#endif + +#if defined(__gnu_linux__) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE 1 +#endif + +#include "stdsoap2.h" + +#if GSOAP_VERSION != GSOAP_LIB_VERSION +# error "GSOAP VERSION MISMATCH IN LIBRARY: PLEASE REINSTALL PACKAGE" +#endif + +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +# include /* vxWorks compatible */ +#endif + +#ifdef __BORLANDC__ +# pragma warn -8060 +#else +# ifdef WIN32 +# ifdef UNDER_CE +# pragma comment(lib, "ws2.lib") /* WinCE */ +# else +# pragma comment(lib, "Ws2_32.lib") +# endif +# pragma warning(disable : 4996) /* disable deprecation warnings */ +# endif +#endif + +#ifdef __cplusplus +SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.8.91 2019-08-15 00:00:00 GMT") +extern "C" { +#else +SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.8.91 2019-08-15 00:00:00 GMT") +#endif + +/* 8bit character representing unknown character entity or multibyte data */ +#ifndef SOAP_UNKNOWN_CHAR +# define SOAP_UNKNOWN_CHAR (0x7F) +#endif + +/* unicode character representing unknown characters outside the XML 1.0 UTF8 unicode space */ +#ifdef WITH_REPLACE_ILLEGAL_UTF8 +# ifndef SOAP_UNKNOWN_UNICODE_CHAR +# define SOAP_UNKNOWN_UNICODE_CHAR (0xFFFD) +# endif +#endif + +/* EOF=-1 */ +#define SOAP_LT (soap_wchar)(-2) /* XML-specific '<' */ +#define SOAP_TT (soap_wchar)(-3) /* XML-specific '' */ +#define SOAP_QT (soap_wchar)(-5) /* XML-specific '"' */ +#define SOAP_AP (soap_wchar)(-6) /* XML-specific ''' */ + +#define soap_coblank(c) ((c)+1 > 0 && (c) <= 32) + +#if defined(WIN32) && !defined(UNDER_CE) +#define soap_hash_ptr(p) ((size_t)((PtrToUlong(p) >> 3) & (SOAP_PTRHASH - 1))) +#else +#define soap_hash_ptr(p) ((size_t)(((unsigned long)(p) >> 3) & (SOAP_PTRHASH-1))) +#endif + +#ifdef SOAP_DEBUG +static void soap_init_logs(struct soap*); +static void soap_close_logfile(struct soap*, int); +static void soap_set_logfile(struct soap*, int, const char*); +#endif + +#ifdef SOAP_MEM_DEBUG +static void soap_init_mht(struct soap*); +static void soap_free_mht(struct soap*); +static void soap_track_unlink(struct soap*, const void*); +#endif + +static int soap_set_error(struct soap*, const char*, const char*, const char*, const char*, int); +static int soap_copy_fault(struct soap*, const char*, const char*, const char*, const char*); +static int soap_getattrval(struct soap*, char*, size_t*, soap_wchar); +static void soap_version(struct soap*); +static void soap_free_ns(struct soap*); +static soap_wchar soap_char(struct soap*); +static soap_wchar soap_getpi(struct soap*); +static int soap_isxdigit(int); +static void *fplugin(struct soap*, const char*); +static ULONG64 soap_count_attachments(struct soap*); +static int soap_try_connect_command(struct soap*, int http_command, const char *endpoint, const char *action); +static int soap_init_send(struct soap*); + +#ifdef WITH_NTLM +static int soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const char *host, int port); +#endif + +#ifndef WITH_NOIDREF +static int soap_has_copies(struct soap*, const char*, const char*); +static int soap_type_punned(struct soap*, const struct soap_ilist*); +static int soap_is_shaky(struct soap*, void*); +static void soap_init_iht(struct soap*); +static void soap_free_iht(struct soap*); +#endif +static void soap_init_pht(struct soap*); +static void soap_free_pht(struct soap*); + +#ifndef WITH_LEAN +static const char *soap_set_validation_fault(struct soap*, const char*, const char*); +static int soap_isnumeric(struct soap*, const char*); +static struct soap_nlist *soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized, short isearly); +static void soap_utilize_ns(struct soap *soap, const char *tag, short isearly); +static const wchar_t* soap_wstring(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern); +static wchar_t* soap_wcollapse(struct soap *soap, wchar_t *s, int flag, int insitu); +#endif + +static const char* soap_string(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern); +static char* soap_collapse(struct soap *soap, char *s, int flag, int insitu); +static const char* soap_QName(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern); + +#ifndef WITH_LEANER +static int soap_begin_attachments(struct soap*); +static int soap_end_attachments(struct soap *soap); +static struct soap_multipart *soap_alloc_multipart(struct soap*, struct soap_multipart**, struct soap_multipart**, const char*, size_t); +static int soap_putdimefield(struct soap*, const char*, size_t); +static char *soap_getdimefield(struct soap*, size_t); +static void soap_select_mime_boundary(struct soap*); +static int soap_valid_mime_boundary(struct soap*); +static void soap_resolve_attachment(struct soap*, struct soap_multipart*); +#endif + +#ifdef WITH_GZIP +static int soap_getgziphdr(struct soap*); +#endif + +#ifdef WITH_OPENSSL +# ifndef SOAP_SSL_RSA_BITS +# define SOAP_SSL_RSA_BITS 2048 +# endif +static int soap_ssl_init_done = 0; +static int ssl_auth_init(struct soap*); +static int ssl_verify_callback(int, X509_STORE_CTX*); +static int ssl_verify_callback_allow_expired_certificate(int, X509_STORE_CTX*); +static int ssl_password(char*, int, int, void *); +#endif + +#ifdef WITH_GNUTLS +# ifndef SOAP_SSL_RSA_BITS +# define SOAP_SSL_RSA_BITS 2048 +# endif +static int soap_ssl_init_done = 0; +static int ssl_auth_init(struct soap*); +static const char *ssl_verify(struct soap *soap, const char *host); +# if GNUTLS_VERSION_NUMBER < 0x020b00 +# if defined(HAVE_PTHREAD_H) +# include + /* make GNUTLS thread safe with pthreads */ + GCRY_THREAD_OPTION_PTHREAD_IMPL; +# elif defined(HAVE_PTH_H) + #include + /* make GNUTLS thread safe with PTH */ + GCRY_THREAD_OPTION_PTH_IMPL; +# endif +# endif +#endif + +#ifdef WITH_SYSTEMSSL +static int ssl_auth_init(struct soap*); +static int ssl_recv(int sk, void *s, int n, char *user); +static int ssl_send(int sk, void *s, int n, char *user); +#endif + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +static const char * soap_decode(char*, size_t, const char*, const char*); +#endif + +#ifndef WITH_NOHTTP +static soap_wchar soap_getchunkchar(struct soap*); +static const char *http_error(struct soap*, int); +static int http_get(struct soap*); +static int http_put(struct soap*); +static int http_patch(struct soap*); +static int http_del(struct soap*); +static int http_200(struct soap*); +static int http_post(struct soap*, const char*, const char*, int, const char*, const char*, ULONG64); +static int http_send_header(struct soap*, const char*); +static int http_post_header(struct soap*, const char*, const char*); +static int http_response(struct soap*, int, ULONG64); +static int http_parse(struct soap*); +static int http_parse_header(struct soap*, const char*, const char*); +#endif + +#ifndef WITH_NOIO + +static int fsend(struct soap*, const char*, size_t); +static size_t frecv(struct soap*, char*, size_t); +static int tcp_init(struct soap*); +static const char *tcp_error(struct soap*); + +#if !defined(WITH_IPV6) +static int tcp_gethost(struct soap*, const char *addr, struct in_addr *inaddr); +#endif +#if !defined(WITH_IPV6) || defined(WITH_COOKIES) +static int tcp_gethostbyname(struct soap*, const char *addr, struct hostent *hostent, struct in_addr *inaddr); +#endif + +static SOAP_SOCKET tcp_connect(struct soap*, const char *endpoint, const char *host, int port); +static SOAP_SOCKET tcp_accept(struct soap*, SOAP_SOCKET, struct sockaddr*, int*); +static int tcp_select(struct soap*, SOAP_SOCKET, int, int); +static int tcp_disconnect(struct soap*); +static int tcp_closesocket(struct soap*, SOAP_SOCKET); +static int tcp_shutdownsocket(struct soap*, SOAP_SOCKET, int); +static const char *soap_strerror(struct soap*); + +#define SOAP_TCP_SELECT_RCV 0x1 +#define SOAP_TCP_SELECT_SND 0x2 +#define SOAP_TCP_SELECT_ERR 0x4 +#define SOAP_TCP_SELECT_ALL 0x7 +#define SOAP_TCP_SELECT_PIP 0x8 + +#if defined(WIN32) + #define SOAP_SOCKBLOCK(fd) \ + { \ + u_long blocking = 0; \ + ioctlsocket(fd, FIONBIO, &blocking); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + u_long nonblocking = 1; \ + ioctlsocket(fd, FIONBIO, &nonblocking); \ + } +#elif defined(VXWORKS) + #define SOAP_SOCKBLOCK(fd) \ + { \ + u_long blocking = 0; \ + ioctl(fd, FIONBIO, (int)(&blocking)); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + u_long nonblocking = 1; \ + ioctl(fd, FIONBIO, (int)(&nonblocking)); \ + } +#elif defined(__VMS) + #define SOAP_SOCKBLOCK(fd) \ + { \ + int blocking = 0; \ + ioctl(fd, FIONBIO, &blocking); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + int nonblocking = 1; \ + ioctl(fd, FIONBIO, &nonblocking); \ + } +#elif defined(SYMBIAN) + #define SOAP_SOCKBLOCK(fd) \ + { \ + long blocking = 0; \ + ioctl(fd, 0/*FIONBIO*/, &blocking); \ + } + #define SOAP_SOCKNONBLOCK(fd) \ + { \ + long nonblocking = 1; \ + ioctl(fd, 0/*FIONBIO*/, &nonblocking); \ + } +#else + #define SOAP_SOCKBLOCK(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)&~O_NONBLOCK); + #define SOAP_SOCKNONBLOCK(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL)|O_NONBLOCK); +#endif + +#endif + +static const char soap_env1[42] = "http://schemas.xmlsoap.org/soap/envelope/"; +static const char soap_enc1[42] = "http://schemas.xmlsoap.org/soap/encoding/"; +static const char soap_env2[40] = "http://www.w3.org/2003/05/soap-envelope"; +static const char soap_enc2[40] = "http://www.w3.org/2003/05/soap-encoding"; +static const char soap_rpc[35] = "http://www.w3.org/2003/05/soap-rpc"; + +const union soap_double_nan soap_double_nan = {{0xFFFFFFFF, 0xFFFFFFFF}}; +const char soap_base64o[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +const char soap_base64i[81] = "\76XXX\77\64\65\66\67\70\71\72\73\74\75XXXXXXX\00\01\02\03\04\05\06\07\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31XXXXXX\32\33\34\35\36\37\40\41\42\43\44\45\46\47\50\51\52\53\54\55\56\57\60\61\62\63"; + +#ifndef WITH_LEAN +static const char soap_indent[21] = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; +/* Alternative indentation form for SOAP_XML_INDENT with spaces instead of tabs: +static const char soap_indent[41] = "\n "; +*/ +#endif + +#ifndef SOAP_CANARY +# define SOAP_CANARY (0xC0DE) +#endif + +static const char soap_padding[4] = "\0\0\0"; +#define SOAP_STR_PADDING (soap_padding) +#define SOAP_STR_EOS (soap_padding) +#define SOAP_NON_NULL (soap_padding) + +#ifndef WITH_LEAN +static const struct soap_code_map html_entity_codes[] = /* entities for XHTML parsing */ +{ + { 160, "nbsp" }, + { 161, "iexcl" }, + { 162, "cent" }, + { 163, "pound" }, + { 164, "curren" }, + { 165, "yen" }, + { 166, "brvbar" }, + { 167, "sect" }, + { 168, "uml" }, + { 169, "copy" }, + { 170, "ordf" }, + { 171, "laquo" }, + { 172, "not" }, + { 173, "shy" }, + { 174, "reg" }, + { 175, "macr" }, + { 176, "deg" }, + { 177, "plusmn" }, + { 178, "sup2" }, + { 179, "sup3" }, + { 180, "acute" }, + { 181, "micro" }, + { 182, "para" }, + { 183, "middot" }, + { 184, "cedil" }, + { 185, "sup1" }, + { 186, "ordm" }, + { 187, "raquo" }, + { 188, "frac14" }, + { 189, "frac12" }, + { 190, "frac34" }, + { 191, "iquest" }, + { 192, "Agrave" }, + { 193, "Aacute" }, + { 194, "Acirc" }, + { 195, "Atilde" }, + { 196, "Auml" }, + { 197, "Aring" }, + { 198, "AElig" }, + { 199, "Ccedil" }, + { 200, "Egrave" }, + { 201, "Eacute" }, + { 202, "Ecirc" }, + { 203, "Euml" }, + { 204, "Igrave" }, + { 205, "Iacute" }, + { 206, "Icirc" }, + { 207, "Iuml" }, + { 208, "ETH" }, + { 209, "Ntilde" }, + { 210, "Ograve" }, + { 211, "Oacute" }, + { 212, "Ocirc" }, + { 213, "Otilde" }, + { 214, "Ouml" }, + { 215, "times" }, + { 216, "Oslash" }, + { 217, "Ugrave" }, + { 218, "Uacute" }, + { 219, "Ucirc" }, + { 220, "Uuml" }, + { 221, "Yacute" }, + { 222, "THORN" }, + { 223, "szlig" }, + { 224, "agrave" }, + { 225, "aacute" }, + { 226, "acirc" }, + { 227, "atilde" }, + { 228, "auml" }, + { 229, "aring" }, + { 230, "aelig" }, + { 231, "ccedil" }, + { 232, "egrave" }, + { 233, "eacute" }, + { 234, "ecirc" }, + { 235, "euml" }, + { 236, "igrave" }, + { 237, "iacute" }, + { 238, "icirc" }, + { 239, "iuml" }, + { 240, "eth" }, + { 241, "ntilde" }, + { 242, "ograve" }, + { 243, "oacute" }, + { 244, "ocirc" }, + { 245, "otilde" }, + { 246, "ouml" }, + { 247, "divide" }, + { 248, "oslash" }, + { 249, "ugrave" }, + { 250, "uacute" }, + { 251, "ucirc" }, + { 252, "uuml" }, + { 253, "yacute" }, + { 254, "thorn" }, + { 255, "yuml" }, + { 0, NULL } +}; +#endif + +#ifndef WITH_NOIO +#ifndef WITH_LEAN +static const struct soap_code_map h_error_codes[] = +{ +#ifdef HOST_NOT_FOUND + { HOST_NOT_FOUND, "Host not found" }, +#endif +#ifdef TRY_AGAIN + { TRY_AGAIN, "Try Again" }, +#endif +#ifdef NO_RECOVERY + { NO_RECOVERY, "No Recovery" }, +#endif +#ifdef NO_DATA + { NO_DATA, "No Data" }, +#endif +#ifdef NO_ADDRESS + { NO_ADDRESS, "No Address" }, +#endif + { 0, NULL } +}; +#endif +#endif + +#ifndef WITH_NOHTTP +#ifndef WITH_LEAN +static const struct soap_code_map h_http_error_codes[] = +{ + { 100, "Continue" }, + { 101, "Switching Protocols" }, + { 200, "OK" }, + { 201, "Created" }, + { 202, "Accepted" }, + { 203, "Non-Authoritative Information" }, + { 204, "No Content" }, + { 205, "Reset Content" }, + { 206, "Partial Content" }, + { 300, "Multiple Choices" }, + { 301, "Moved Permanently" }, + { 302, "Found" }, + { 303, "See Other" }, + { 304, "Not Modified" }, + { 305, "Use Proxy" }, + { 307, "Temporary Redirect" }, + { 400, "Bad Request" }, + { 401, "Unauthorized" }, + { 402, "Payment Required" }, + { 403, "Forbidden" }, + { 404, "Not Found" }, + { 405, "Method Not Allowed" }, + { 406, "Not Acceptable" }, + { 407, "Proxy Authentication Required" }, + { 408, "Request Time-out" }, + { 409, "Conflict" }, + { 410, "Gone" }, + { 411, "Length Required" }, + { 412, "Precondition Failed" }, + { 413, "Request Entity Too Large" }, + { 414, "Request-URI Too Large" }, + { 415, "Unsupported Media Type" }, + { 416, "Requested range not satisfiable" }, + { 417, "Expectation Failed" }, + { 422, "Unprocessable Entity" }, + { 426, "Upgrade Required" }, + { 428, "Precondition Required" }, + { 429, "Too Many Requests" }, + { 431, "Request Header Fields Too Large" }, + { 500, "Internal Server Error" }, + { 501, "Not Implemented" }, + { 502, "Bad Gateway" }, + { 503, "Service Unavailable" }, + { 504, "Gateway Time-out" }, + { 505, "HTTP Version not supported" }, + { 511, "Network Authentication Required" }, + { 0, NULL } +}; +#endif +#endif + +#ifdef WITH_OPENSSL +static const struct soap_code_map h_ssl_error_codes[] = +{ +#define _SSL_ERROR(e) { e, #e } + _SSL_ERROR(SSL_ERROR_SSL), + _SSL_ERROR(SSL_ERROR_ZERO_RETURN), + _SSL_ERROR(SSL_ERROR_WANT_READ), + _SSL_ERROR(SSL_ERROR_WANT_WRITE), + _SSL_ERROR(SSL_ERROR_WANT_CONNECT), + _SSL_ERROR(SSL_ERROR_WANT_X509_LOOKUP), + _SSL_ERROR(SSL_ERROR_SYSCALL), + { 0, NULL } +}; +#endif + +#ifndef WITH_LEANER +static const struct soap_code_map mime_codes[] = +{ + { SOAP_MIME_7BIT, "7bit" }, + { SOAP_MIME_8BIT, "8bit" }, + { SOAP_MIME_BINARY, "binary" }, + { SOAP_MIME_QUOTED_PRINTABLE, "quoted-printable" }, + { SOAP_MIME_BASE64, "base64" }, + { SOAP_MIME_IETF_TOKEN, "ietf-token" }, + { SOAP_MIME_X_TOKEN, "x-token" }, + { 0, NULL } +}; +#endif + +#ifdef WIN32 +static int tcp_done = 0; +#endif + +#if (defined(_AIX43) || defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R) +#ifndef h_errno +extern int h_errno; +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +fsend(struct soap *soap, const char *s, size_t n) +{ + int nwritten, err; + SOAP_SOCKET sk; + soap->errnum = 0; +#if defined(__cplusplus) && !defined(WITH_COMPAT) + if (soap->os) + { + soap->os->write(s, (std::streamsize)n); + if (soap->os->good()) + return SOAP_OK; + return SOAP_EOF; + } +#endif + sk = soap->sendsk; + if (!soap_valid_socket(sk)) + sk = soap->socket; + while (n) + { + if (soap_valid_socket(sk)) + { + if (soap->send_timeout) + { + for (;;) + { + int r; +#ifdef WITH_SELF_PIPE +#ifdef WITH_OPENSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL | SOAP_TCP_SELECT_PIP, soap->send_timeout); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR | SOAP_TCP_SELECT_PIP, soap->send_timeout); + if ((r & SOAP_TCP_SELECT_PIP)) /* abort if data is pending on pipe */ + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection closed by self pipe\n")); + return SOAP_EOF; + } +#else +#ifdef WITH_OPENSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_ALL, soap->send_timeout); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout); +#endif + if (r > 0) + break; + if (!r) + return SOAP_EOF; + err = soap->errnum; + if (!err) + return soap->error; + if (err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK) + return SOAP_EOF; + } + } +#ifndef WITH_LEAN + if (soap->transfer_timeout) + { + time_t now = time(NULL); + if ((soap->transfer_timeout > 0 && difftime(now, (time_t)soap->start) > (double)soap->transfer_timeout) + || (soap->transfer_timeout < 0 && difftime(now, (time_t)soap->start) > -1000000.0 * (double)soap->transfer_timeout)) + return SOAP_EOF; + } +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + nwritten = SSL_write(soap->ssl, s, (int)n); + else if (soap->bio) + nwritten = BIO_write(soap->bio, s, (int)n); + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + nwritten = gnutls_record_send(soap->session, s, n); + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + { + err = gsk_secure_socket_write(soap->ssl, (char*)s, n, &nwritten); + if (err != GSK_OK) + nwritten = 0; + } + else +#endif +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + { + if (soap->peerlen) + nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, (SOAP_WINSOCKINT)soap->peerlen); + else + nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags); + /* retry and back-off algorithm */ + /* TODO: this is not very clear from specs so verify and limit conditions under which we should loop (e.g. ENOBUFS) */ + if (nwritten < 0) + { + int udp_repeat; + int udp_delay; + if ((soap->connect_flags & SO_BROADCAST)) + udp_repeat = 2; /* SOAP-over-UDP MULTICAST_UDP_REPEAT - 1 */ + else + udp_repeat = 1; /* SOAP-over-UDP UNICAST_UDP_REPEAT - 1 */ + udp_delay = ((unsigned int)soap_random % 201) + 50; /* UDP_MIN_DELAY .. UDP_MAX_DELAY */ + do + { + tcp_select(soap, sk, SOAP_TCP_SELECT_ERR, -1000 * udp_delay); + if (soap->peerlen) + nwritten = sendto(sk, (char*)s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, (SOAP_WINSOCKINT)soap->peerlen); + else + nwritten = send(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags); + udp_delay <<= 1; + if (udp_delay > 500) /* UDP_UPPER_DELAY */ + udp_delay = 500; + } while (nwritten < 0 && --udp_repeat > 0); + } + if (nwritten < 0) + { + err = soap_socket_errno(sk); + if (err && err != SOAP_EINTR) + { + soap->errnum = err; + return SOAP_EOF; + } + nwritten = 0; /* and call write() again */ + } + } + else +#endif +#if !defined(AS400) + nwritten = send(sk, s, (int)n, soap->socket_flags); +#else + nwritten = send(sk, (void*)s, n, soap->socket_flags); +#endif + if (nwritten <= 0) + { + int r = 0; + err = soap_socket_errno(sk); +#ifdef WITH_OPENSSL + if (soap->ssl && (r = SSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && r != SSL_ERROR_WANT_READ && r != SSL_ERROR_WANT_WRITE) + { + soap->errnum = err; + return SOAP_EOF; + } +#endif +#ifdef WITH_GNUTLS + if (soap->session) + { + if (nwritten == GNUTLS_E_INTERRUPTED) + err = SOAP_EINTR; + else if (nwritten == GNUTLS_E_AGAIN) + err = SOAP_EAGAIN; + } +#endif + if (err == SOAP_EWOULDBLOCK || err == SOAP_EAGAIN) + { +#if defined(WITH_OPENSSL) + if (soap->ssl && r == SSL_ERROR_WANT_READ) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + else +#elif defined(WITH_GNUTLS) + if (soap->session && !gnutls_record_get_direction(soap->session)) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->send_timeout ? soap->send_timeout : -10000); + if (!r && soap->send_timeout) + return SOAP_EOF; + if (r < 0) + return SOAP_EOF; + } + else if (err && err != SOAP_EINTR) + { + soap->errnum = err; + return SOAP_EOF; + } + nwritten = 0; /* and call write() again */ + } + } + else + { +#ifdef WITH_FASTCGI + nwritten = fwrite((void*)s, 1, n, stdout); + fflush(stdout); +#else +#ifdef UNDER_CE + nwritten = fwrite(s, 1, n, soap->sendfd); +#else +#ifdef WMW_RPM_IO + /* vxWorks compatible */ + if (soap->rpmreqid) + nwritten = (httpBlockPut(soap->rpmreqid, (char*)s, n) == 0) ? n : -1; + else +#endif +#ifdef WIN32 + nwritten = _write(soap->sendfd, s, (unsigned int)n); +#else + nwritten = write(soap->sendfd, s, (unsigned int)n); +#endif +#endif +#endif + if (nwritten <= 0) + { +#ifndef WITH_FASTCGI + err = soap_errno; +#else + err = EOF; +#endif + if (err && err != SOAP_EINTR && err != SOAP_EWOULDBLOCK && err != SOAP_EAGAIN) + { + soap->errnum = err; + return SOAP_EOF; + } + nwritten = 0; /* and call write() again */ + } + } + n -= nwritten; + s += nwritten; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send_raw(struct soap *soap, const char *s, size_t n) +{ + if (!s || !n) + return SOAP_OK; +#ifndef WITH_LEANER + if (soap->fpreparesend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->mode & SOAP_IO_LENGTH) && (soap->error = soap->fpreparesend(soap, s, n)) != SOAP_OK) + return soap->error; + if (soap->ffiltersend && (soap->error = soap->ffiltersend(soap, &s, &n)) != SOAP_OK) + return soap->error; +#endif + if ((soap->mode & SOAP_IO_LENGTH)) + { + soap->count += n; + } + else if ((soap->mode & SOAP_IO)) + { + size_t i = sizeof(soap->buf) - soap->bufidx; + while (n >= i) + { + (void)soap_memcpy((void*)(soap->buf + soap->bufidx), i, (const void*)s, i); + soap->bufidx = sizeof(soap->buf); + if (soap_flush(soap)) + return soap->error; + s += i; + n -= i; + i = sizeof(soap->buf); + } + (void)soap_memcpy((void*)(soap->buf + soap->bufidx), sizeof(soap->buf) - soap->bufidx, (const void*)s, n); + soap->bufidx += n; + } + else + { + return soap_flush_raw(soap, s, n); + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_flush(struct soap *soap) +{ + size_t n = soap->bufidx; + if (!n) + return soap->error = soap->fsend(soap, SOAP_STR_EOS, 0); /* force a zero send for HTTP GET and DELETE */ +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE) + { + int r; + if (soap->fpreparesend && (r = soap->fpreparesend(soap, soap->buf, n)) != SOAP_OK) + return soap->error = r; + } +#endif + soap->bufidx = 0; +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + soap->d_stream->next_in = (Byte*)soap->buf; + soap->d_stream->avail_in = (unsigned int)n; +#ifdef WITH_GZIP + soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)n); +#endif + do + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating %u bytes\n", soap->d_stream->avail_in)); + if (deflate(soap->d_stream, Z_NO_FLUSH) != Z_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + return soap->error = SOAP_ZLIB_ERROR; + } + if (!soap->d_stream->avail_out) + { + if (soap_flush_raw(soap, soap->z_buf, sizeof(soap->buf))) + return soap->error; + soap->d_stream->next_out = (Byte*)soap->z_buf; + soap->d_stream->avail_out = sizeof(soap->buf); + } + } while (soap->d_stream->avail_in); + return SOAP_OK; + } +#endif + return soap_flush_raw(soap, soap->buf, n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_flush_raw(struct soap *soap, const char *s, size_t n) +{ + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE) + { + void *t; + t = soap_push_block(soap, NULL, n); + if (!t) + return soap->error = SOAP_EOM; + (void)soap_memcpy(t, n, (const void*)s, n); + return SOAP_OK; + } +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + { + char t[24]; + (SOAP_SNPRINTF(t, sizeof(t), 20), &"\r\n%lX\r\n"[soap->chunksize ? 0 : 2], (unsigned long)n); + DBGMSG(SENT, t, strlen(t)); + soap->error = soap->fsend(soap, t, strlen(t)); + if (soap->error) + return soap->error; + soap->chunksize += n; + } + DBGMSG(SENT, s, n); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send %u bytes to socket=%d/fd=%d\n", (unsigned int)n, (int)soap->socket, soap->sendfd)); +#endif + return soap->error = soap->fsend(soap, s, n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send(struct soap *soap, const char *s) +{ + if (!s) + return SOAP_OK; + return soap_send_raw(soap, s, strlen(s)); +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send2(struct soap *soap, const char *s1, const char *s2) +{ + if (soap_send(soap, s1)) + return soap->error; + return soap_send(soap, s2); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send3(struct soap *soap, const char *s1, const char *s2, const char *s3) +{ + if (soap_send(soap, s1) + || soap_send(soap, s2)) + return soap->error; + return soap_send(soap, s3); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_query_send_key(struct soap *soap, const char *s) +{ + if (!s) + return SOAP_OK; + if (!soap->body && soap_send_raw(soap, "&", 1)) + return soap->error; + soap->body = 0; + (void)soap_encode_url(s, soap->msgbuf, (int)sizeof(soap->msgbuf)); /* msgbuf length is max SOAP_TMPLEN or just 1024 bytes */ + return soap_send(soap, soap->msgbuf); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_query_send_val(struct soap *soap, const char *s) +{ + if (!s) + return SOAP_OK; + if (soap_send_raw(soap, "=", 1)) + return soap->error; + (void)soap_encode_url(s, soap->msgbuf, (int)sizeof(soap->msgbuf)); /* msgbuf length is max SOAP_TMPLEN or just 1024 bytes */ + return soap_send(soap, soap->msgbuf); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_query(struct soap *soap) +{ + return strchr(soap->path, '?'); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_query_key(struct soap *soap, char **s) +{ + char *t = *s; + (void)soap; + if (t && *t) + { + *s = (char*)soap_query_decode(t, strlen(t), t + 1); + return t; + } + return *s = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_query_val(struct soap *soap, char **s) +{ + char *t = *s; + (void)soap; + if (t && *t == '=') + { + *s = (char*)soap_query_decode(t, strlen(t), t + 1); + return t; + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_query_decode(char *buf, size_t len, const char *val) +{ + const char *s; + char *t; + for (s = val; *s; s++) + if (*s != ' ' && *s != '=') + break; + if (*s == '"') + { + t = buf; + s++; + while (*s && *s != '"' && --len) + *t++ = *s++; + *t = '\0'; + do s++; + while (*s && *s != '&' && *s != '='); + } + else + { + t = buf; + while (*s && *s != '&' && *s != '=' && --len) + { + switch (*s) + { + case '+': + *t++ = ' '; + s++; + break; + case '\t': + case '\n': + case '\r': + case ' ': + s++; + break; + case '%': + *t++ = ((s[1] >= 'A' ? (s[1]&0x7) + 9 : s[1] - '0') << 4) + (s[2] >= 'A' ? (s[2]&0x7) + 9 : s[2] - '0'); + s += 3; + break; + default: + *t++ = *s++; + } + } + *t = '\0'; + } + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static size_t +frecv(struct soap *soap, char *s, size_t n) +{ + int r; + int retries = 100; /* max 100 retries with non-blocking sockets */ + SOAP_SOCKET sk; + soap->errnum = 0; +#if defined(__cplusplus) && !defined(WITH_COMPAT) + if (soap->is) /* recv from C++ stream */ + { + if (soap->is->good()) + return (size_t)soap->is->read(s, (std::streamsize)n).gcount(); /* downcast to std::streamsize is OK: gcount() returns how much we got in s[] */ + return 0; + } +#else + if (soap->is) /* recv from C buffer until NUL */ + { + size_t l = strlen(soap->is); + if (l > n) + l = n; + (void)soap_memcpy((void*)s, n, soap->is, l); + soap->is += l; + return l; + } +#endif + sk = soap->recvsk; + if (!soap_valid_socket(sk)) + sk = soap->socket; + if (soap_valid_socket(sk)) + { + for (;;) + { +#if defined(WITH_OPENSSL) || defined(WITH_SYSTEMSSL) + int err = 0; +#endif +#ifdef WITH_OPENSSL + if (soap->recv_timeout && !soap->ssl) /* OpenSSL: sockets are nonblocking so go ahead to read */ +#else + if (soap->recv_timeout) +#endif + { + for (;;) + { +#ifdef WITH_SELF_PIPE + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR | SOAP_TCP_SELECT_PIP, soap->recv_timeout); + if ((r & SOAP_TCP_SELECT_PIP)) /* abort if data is pending on pipe */ + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection closed by self pipe\n")); + return 0; + } +#else + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout); +#endif + if (r > 0) + break; + if (!r) + return 0; + r = soap->errnum; + if (r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK) + return 0; + } + } +#ifndef WITH_LEAN + if (soap->transfer_timeout) + { + time_t now = time(NULL); + if ((soap->transfer_timeout > 0 && difftime(now, (time_t)soap->start) > (double)soap->transfer_timeout) + || (soap->transfer_timeout < 0 && difftime(now, (time_t)soap->start) > -1000000.0 * (double)soap->transfer_timeout)) + return 0; + } +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + { + r = SSL_read(soap->ssl, s, (int)n); + if (r > 0) + return (size_t)r; + err = SSL_get_error(soap->ssl, r); + if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE) + return 0; + } + else if (soap->bio) + { + r = BIO_read(soap->bio, s, (int)n); + if (r > 0) + return (size_t)r; + return 0; + } + else +#endif +#ifdef WITH_GNUTLS + if (soap->session) + { + r = (int)gnutls_record_recv(soap->session, s, n); + if (r >= 0) + return (size_t)r; + } + else +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + { + err = gsk_secure_socket_read(soap->ssl, s, n, &r); + if (err == GSK_OK && r > 0) + return (size_t)r; + if (err != GSK_OK && err != GSK_WOULD_BLOCK && err != GSK_WOULD_BLOCK_WRITE) + return 0; + } + else +#endif + { +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + { + SOAP_SOCKLEN_T k = (SOAP_SOCKLEN_T)sizeof(soap->peer); + memset((void*)&soap->peer, 0, sizeof(soap->peer)); + r = recvfrom(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags, &soap->peer.addr, &k); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h, SOAP_WINSOCKINT cast is safe due to limited range of n in the engine (64K) */ + soap->peerlen = (size_t)k; +#ifdef WITH_IPV6 + soap->ip = 0; + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0; + soap->ip6[3] = 0; +#else + soap->ip = ntohl(soap->peer.in.sin_addr.s_addr); + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0xFFFF; + soap->ip6[3] = soap->ip; +#endif + } + else +#endif + r = recv(sk, s, (SOAP_WINSOCKINT)n, soap->socket_flags); /* SOAP_WINSOCKINT cast is safe due to limited range of n in the engine (64K) */ + if (r >= 0) + return (size_t)r; + r = soap_socket_errno(sk); + if (r != SOAP_EINTR && r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK) + { + soap->errnum = r; + return 0; + } + } +#if defined(WITH_OPENSSL) + if (soap->ssl && err == SSL_ERROR_WANT_WRITE) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#elif defined(WITH_GNUTLS) + if (soap->session && gnutls_record_get_direction(soap->session)) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#elif defined(WITH_SYSTEMSSL) + if (soap->ssl && err == GSK_WOULD_BLOCK_WRITE) + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + else +#endif + r = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, soap->recv_timeout ? soap->recv_timeout : 5); + if (!r && soap->recv_timeout) + return 0; + if (r < 0) + { + r = soap->errnum; + if (r != SOAP_EAGAIN && r != SOAP_EWOULDBLOCK) + return 0; + } + if (retries-- <= 0) + return 0; + } + } +#ifdef WITH_FASTCGI + return fread(s, 1, n, stdin); +#else +#ifdef UNDER_CE + return fread(s, 1, n, soap->recvfd); +#else +#ifdef WMW_RPM_IO + if (soap->rpmreqid) + r = httpBlockRead(soap->rpmreqid, s, n); + else +#endif +#ifdef WIN32 + r = _read(soap->recvfd, s, (unsigned int)n); +#else + r = read(soap->recvfd, s, n); +#endif + if (r >= 0) + return (size_t)r; + soap->errnum = soap_errno; + return 0; +#endif +#endif +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static soap_wchar +soap_getchunkchar(struct soap *soap) +{ + if (soap->bufidx < soap->buflen) + return soap->buf[soap->bufidx++]; + soap->bufidx = 0; + soap->buflen = soap->chunkbuflen = soap->frecv(soap, soap->buf, sizeof(soap->buf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket=%d/fd=%d\n", (unsigned int)soap->buflen, (int)soap->socket, soap->recvfd)); + DBGMSG(RECV, soap->buf, soap->buflen); + if (soap->buflen) + return soap->buf[soap->bufidx++]; + return EOF; +} +#endif + +/******************************************************************************/ + +static int +soap_isxdigit(int c) +{ + return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_raw(struct soap *soap) +{ + size_t ret; +#if !defined(WITH_LEANER) || defined(WITH_ZLIB) + int r; +#endif +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + if (soap->d_stream->next_out == Z_NULL) + { + soap->bufidx = soap->buflen = 0; + return EOF; + } + if (soap->d_stream->avail_in || !soap->d_stream->avail_out) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflating\n")); + soap->d_stream->next_out = (Byte*)soap->buf; + soap->d_stream->avail_out = sizeof(soap->buf); + r = inflate(soap->d_stream, Z_NO_FLUSH); + if (r == Z_NEED_DICT && soap->z_dict) + r = inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len); + if (r == Z_OK || r == Z_STREAM_END) + { + soap->bufidx = 0; + ret = soap->buflen = sizeof(soap->buf) - soap->d_stream->avail_out; + if (soap->zlib_in == SOAP_ZLIB_GZIP) + soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)ret); + if (r == Z_STREAM_END) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out)); + soap->d_stream->next_out = Z_NULL; + } + if (ret) + { + if (soap->count + ret < soap->count) + return soap->error = SOAP_EOF; + soap->count += ret; + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + return soap->error = SOAP_EOF; + soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out; + if (soap->count > SOAP_MAXINFLATESIZE && soap->z_ratio_in < SOAP_MINDEFLATERATIO) + { + soap->d_stream->msg = (char*)"caught SOAP_MINDEFLATERATIO explosive decompression guard (remedy: increase SOAP_MAXINFLATESIZE and/or decrease SOAP_MINDEFLATERATIO)"; + return soap->error = SOAP_ZLIB_ERROR; + } + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n")); + DBGMSG(RECV, soap->buf, ret); + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n----\n")); +#ifndef WITH_LEANER + if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)) != SOAP_OK) + return soap->error = r; +#endif + return SOAP_OK; + } + } + else if (r != Z_BUF_ERROR) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate error: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + soap->d_stream->next_out = Z_NULL; + return soap->error = SOAP_ZLIB_ERROR; + } + } +zlib_again: + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK && !soap->chunksize) + { + (void)soap_memcpy((void*)soap->buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf)); + soap->buflen = soap->z_buflen; + } + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- compressed ----\n")); + } +#endif +#ifndef WITH_NOHTTP + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) /* read HTTP chunked transfer */ + { + for (;;) + { + soap_wchar c; + char *t, tmp[17]; + if (soap->chunksize) + { + soap->buflen = ret = soap->frecv(soap, soap->buf, soap->chunksize > sizeof(soap->buf) ? sizeof(soap->buf) : soap->chunksize); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk: read %u bytes\n", (unsigned int)ret)); + DBGMSG(RECV, soap->buf, ret); + soap->bufidx = 0; + if (!ret) + { + soap->ahead = EOF; + return EOF; + } + soap->chunksize -= ret; + break; + } + if (!soap->chunkbuflen) + { + soap->chunkbuflen = ret = soap->frecv(soap, soap->buf, sizeof(soap->buf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes (chunked) from socket=%d\n", (unsigned int)ret, (int)soap->socket)); + DBGMSG(RECV, soap->buf, ret); + soap->bufidx = 0; + if (!ret) + { + soap->ahead = EOF; + return EOF; + } + } + else + { + soap->bufidx = soap->buflen; + } + soap->buflen = soap->chunkbuflen; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk size (idx=%u len=%u)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen)); + while (!soap_isxdigit((int)(c = soap_getchunkchar(soap)))) + { + if ((int)c == EOF) + { + soap->ahead = EOF; + return EOF; + } + } + t = tmp; + do + { + *t++ = (char)c; + } while (soap_isxdigit((int)(c = soap_getchunkchar(soap))) && (size_t)(t - tmp) < sizeof(tmp)-1); + while ((int)c != EOF && c != '\n') + c = soap_getchunkchar(soap); + if ((int)c == EOF) + { + soap->ahead = EOF; + return EOF; + } + *t = '\0'; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunk size = %s (hex)\n", tmp)); + soap->chunksize = (size_t)soap_strtoul(tmp, &t, 16); + if (!soap->chunksize) + { + soap->bufidx = soap->buflen = soap->chunkbuflen = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of chunked message\n")); + ret = 0; + soap->ahead = EOF; + break; + } + soap->buflen = soap->bufidx + soap->chunksize; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving buf len to idx=%u len=%u (%s)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen, tmp)); + if (soap->buflen > soap->chunkbuflen) + { + soap->buflen = soap->chunkbuflen; + soap->chunksize -= soap->buflen - soap->bufidx; + soap->chunkbuflen = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Passed end of buffer for chunked HTTP (%u bytes left)\n", (unsigned int)(soap->buflen - soap->bufidx))); + } + else if (soap->chunkbuflen) + { + soap->chunksize = 0; + } + ret = soap->buflen - soap->bufidx; + if (ret) + break; + } + } + else +#endif + { + soap->bufidx = 0; + soap->buflen = ret = soap->frecv(soap, soap->buf, sizeof(soap->buf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket=%d/fd=%d\n", (unsigned int)ret, (int)soap->socket, soap->recvfd)); + DBGMSG(RECV, soap->buf, ret); + } +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB)) + { + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf)); + soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx); + soap->d_stream->avail_in = (unsigned int)ret; + soap->d_stream->next_out = (Byte*)soap->buf; + soap->d_stream->avail_out = sizeof(soap->buf); + r = inflate(soap->d_stream, Z_NO_FLUSH); + if (r == Z_NEED_DICT && soap->z_dict) + r = inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len); + if (r == Z_OK || r == Z_STREAM_END) + { + soap->bufidx = 0; + soap->z_buflen = soap->buflen; + soap->buflen = sizeof(soap->buf) - soap->d_stream->avail_out; + if (soap->zlib_in == SOAP_ZLIB_GZIP) + soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->buflen); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %u bytes\n", (unsigned int)soap->buflen)); + if (ret && !soap->buflen && r != Z_STREAM_END) + goto zlib_again; + ret = soap->buflen; + if (r == Z_STREAM_END) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out)); + soap->d_stream->next_out = Z_NULL; + } + soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out; + if (soap->count + ret > SOAP_MAXINFLATESIZE && soap->z_ratio_in < SOAP_MINDEFLATERATIO) + { + soap->d_stream->msg = (char*)"caught SOAP_MINDEFLATERATIO explosive decompression guard (remedy: increase SOAP_MAXINFLATESIZE and/or decrease SOAP_MINDEFLATERATIO)"; + return soap->error = SOAP_ZLIB_ERROR; + } + DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n")); + DBGMSG(RECV, soap->buf, ret); +#ifndef WITH_LEANER + if (soap->fpreparerecv && (r = soap->fpreparerecv(soap, soap->buf, ret)) != SOAP_OK) + return soap->error = r; +#endif + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to inflate: (%d) %s\n", r, soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + soap->d_stream->next_out = Z_NULL; + return soap->error = SOAP_ZLIB_ERROR; + } + } +#endif +#ifndef WITH_LEANER + if (soap->fpreparerecv +#ifdef WITH_ZLIB + && soap->zlib_in == SOAP_ZLIB_NONE +#endif + && (r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, ret))) + return soap->error = r; +#endif + if (ret) + { + if (soap->count + ret < soap->count) + return EOF; + soap->count += ret; + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + return EOF; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read count=" SOAP_ULONG_FORMAT " (+%lu)\n", soap->count, (unsigned long)ret)); + return SOAP_OK; + } + return EOF; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv(struct soap *soap) +{ +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_DIME)) + { + if (soap->dime.buflen) + { + char *s; + int i; + unsigned char tmp[12]; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME hdr for chunked SOAP in DIME is in buffer\n")); + soap->buflen = soap->dime.buflen; + soap->dime.buflen = 0; + soap->dime.chunksize = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip padding (%ld bytes)\n", -(long)soap->dime.size&3)); + for (i = -(long)soap->dime.size&3; i > 0; i--) + { + soap->bufidx++; + if (soap->bufidx >= soap->buflen) + if (soap_recv_raw(soap)) + return EOF; + } + if (!(soap->dime.flags & SOAP_DIME_CF)) + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME hdr for next SOAP in DIME chunk\n")); + s = (char*)tmp; + for (i = 12; i > 0; i--) + { + *s++ = soap->buf[soap->bufidx++]; + if (soap->bufidx >= soap->buflen) + if (soap_recv_raw(soap)) + return EOF; + } + if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION) + return soap->error = SOAP_DIME_MISMATCH; + soap->dime.flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0); + soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get SOAP in DIME chunk (%u bytes)\n", (unsigned int)soap->dime.size)); + soap->dime.chunksize = soap->dime.size; + if (soap->buflen - soap->bufidx >= soap->dime.size) + { + if ((soap->dime.flags & SOAP_DIME_ME)) + { + soap->mode &= ~SOAP_ENC_DIME; + } + else + { + soap->dime.buflen = soap->buflen; + soap->buflen = soap->bufidx + soap->dime.chunksize; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes buffered)\n", (unsigned int)soap->buflen)); + } + } + else + { + soap->dime.chunksize -= soap->buflen - soap->bufidx; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes in chunk left)\n", (unsigned int)soap->dime.chunksize)); + } + return SOAP_OK; + } + if (soap->dime.chunksize) + { + if (soap_recv_raw(soap)) + return EOF; + if (soap->buflen - soap->bufidx >= soap->dime.chunksize) + { + if ((soap->dime.flags & SOAP_DIME_ME)) + { + soap->dime.chunksize = 0; + soap->mode &= ~SOAP_ENC_DIME; + } + else + { + soap->dime.buflen = soap->buflen; + soap->buflen = soap->bufidx + soap->dime.chunksize; + soap->dime.chunksize = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes buffered)\n", (unsigned int)soap->buflen)); + } + } + else + { + soap->dime.chunksize -= soap->buflen - soap->bufidx; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME (%u bytes in chunk left)\n", (unsigned int)soap->dime.chunksize)); + } + return SOAP_OK; + } + } + if (soap->ffilterrecv) + { + int err; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filter recverror = %d bufidx = %lu buflen = %lu\n", soap->recverror, (unsigned long)soap->bufidx, (unsigned long)soap->buflen)); + if (soap->recverror) + { + soap->bufidx = soap->buflen = 0; + } + else + { + soap->bufidx = soap->buflen = 0; + err = soap->ffilterrecv(soap, soap->buf, &soap->buflen, sizeof(soap->buf)); + if (err) + { + if (err == SOAP_EOF) + return SOAP_EOF; + return soap->error = err; + } + if (soap->buflen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filtered output continued %lu bytes\n", (unsigned long)soap->buflen)); + return SOAP_OK; + } + soap->recverror = soap_recv_raw(soap); + soap->buflen -= soap->bufidx; /* chunked may set bufidx > 0 to skip hex chunk length */ + } + while (soap->ffilterrecv) + { + err = soap->ffilterrecv(soap, soap->buf + soap->bufidx, &soap->buflen, sizeof(soap->buf) - soap->bufidx); + if (err) + { + if (err == SOAP_EOF) + return SOAP_EOF; + return soap->error = err; + } + if (soap->buflen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Filtered output %lu bytes\n", (unsigned long)soap->buflen)); + soap->buflen += soap->bufidx; + return SOAP_OK; + } + if (soap->recverror) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Returning postponed error %d\n", soap->recverror)); + return soap->recverror; + } + soap->recverror = soap_recv_raw(soap); + soap->buflen -= soap->bufidx; /* chunked may set bufidx > 0 to skip hex chunk length */ + } + } + return soap->recverror = soap_recv_raw(soap); +#else + return soap_recv_raw(soap); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_getchar(struct soap *soap) +{ + soap_wchar c; + c = soap->ahead; + if (c) + { + if ((int)c != EOF) + soap->ahead = 0; + return c; + } + return soap_get1(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +const struct soap_code_map* +SOAP_FMAC2 +soap_code(const struct soap_code_map *code_map, const char *str) +{ + if (code_map && str) + { + while (code_map->string) + { + if (!strcmp(str, code_map->string)) /* case sensitive */ + return code_map; + code_map++; + } + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +LONG64 +SOAP_FMAC2 +soap_code_int(const struct soap_code_map *code_map, const char *str, LONG64 other) +{ + if (code_map) + { + while (code_map->string) + { + if (!soap_tag_cmp(str, code_map->string)) /* case insensitive */ + return code_map->code; + code_map++; + } + } + return other; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_code_str(const struct soap_code_map *code_map, long code) +{ + if (!code_map) + return NULL; + while (code_map->code != code && code_map->string) + code_map++; + return code_map->string; +} + +/******************************************************************************/ + +SOAP_FMAC1 +LONG64 +SOAP_FMAC2 +soap_code_bits(const struct soap_code_map *code_map, const char *str) +{ + LONG64 bits = 0; + if (code_map) + { + while (str && *str) + { + const struct soap_code_map *p; + for (p = code_map; p->string; p++) + { + size_t n = strlen(p->string); + if (!strncmp(p->string, str, n) && soap_coblank((soap_wchar)str[n])) + { + bits |= p->code; + str += n; + while (*str > 0 && *str <= 32) + str++; + break; + } + } + if (!p->string) + return 0; + } + } + return bits; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_code_list(struct soap *soap, const struct soap_code_map *code_map, long code) +{ + char *t = soap->tmpbuf; + if (code_map) + { + while (code_map->string) + { + if ((code_map->code & code)) + { + const char *s = code_map->string; + if (t != soap->tmpbuf) + *t++ = ' '; + while (*s && t < soap->tmpbuf + sizeof(soap->tmpbuf) - 1) + *t++ = *s++; + if (t == soap->tmpbuf + sizeof(soap->tmpbuf) - 1) + break; + } + code_map++; + } + } + *t = '\0'; + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_binary_search_string(const char **a, int n, const char *s) +{ + int min = 0, max = n-1; + while (min <= max) + { + int mid = (min+max)/2; + int r = strcmp(s, a[mid]); + if (r < 0) + max = mid - 1; + else if (r > 0) + min = mid + 1; + else + return mid; + } + return -1; +} + +/******************************************************************************/ + +static soap_wchar +soap_char(struct soap *soap) +{ + char tmp[8]; + int i; + soap_wchar c; + char *s = tmp; + for (i = 0; i < (int)sizeof(tmp)-1; i++) + { + c = soap_get1(soap); + if (c == ';' || (int)c == EOF) + break; + *s++ = (char)c; + } + *s = '\0'; + if (*tmp == '#') + { + if (tmp[1] == 'x' || tmp[1] == 'X') + return (soap_wchar)soap_strtol(tmp + 2, NULL, 16); + return (soap_wchar)soap_strtol(tmp + 1, NULL, 10); + } + if (!strcmp(tmp, "lt")) + return '<'; + if (!strcmp(tmp, "gt")) + return '>'; + if (!strcmp(tmp, "amp")) + return '&'; + if (!strcmp(tmp, "quot")) + return '"'; + if (!strcmp(tmp, "apos")) + return '\''; +#ifndef WITH_LEAN + return (soap_wchar)soap_code_int(html_entity_codes, tmp, (LONG64)SOAP_UNKNOWN_CHAR); +#else + return SOAP_UNKNOWN_CHAR; /* use this to represent unknown code */ +#endif +} + +/******************************************************************************/ + +#ifdef WITH_LEAN +soap_wchar +soap_get0(struct soap *soap) +{ + if (soap->bufidx >= soap->buflen && soap_recv(soap)) + return EOF; + return (unsigned char)soap->buf[soap->bufidx]; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_LEAN +soap_wchar +soap_get1(struct soap *soap) +{ + if (soap->bufidx >= soap->buflen && soap_recv(soap)) + return EOF; + return (unsigned char)soap->buf[soap->bufidx++]; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_get(struct soap *soap) +{ + soap_wchar c; + c = soap->ahead; + if (c) + { + if ((int)c != EOF) + soap->ahead = 0; + } + else + { + c = soap_get1(soap); + } + while ((int)c != EOF) + { + if (soap->cdata) + { + if (c == ']') + { + c = soap_get1(soap); + if (c == ']') + { + c = soap_get0(soap); + if (c == '>') + { + soap->cdata = 0; + c = soap_get1(soap); + c = soap_get1(soap); + } + else + { + soap_unget(soap, ']'); + return ']'; + } + } + else + { + soap_revget1(soap); + return ']'; + } + } + else + { + return c; + } + } + switch (c) + { + case '<': + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); + if (c == '!' || c == '?' || c == '%') + { + int k = 1; + if (c == '!') + { + c = soap_get1(soap); + if (c == '[') + { + do + { + c = soap_get1(soap); + } while ((int)c != EOF && c != '['); + if ((int)c == EOF) + break; + soap->cdata = 1; + c = soap_get1(soap); + continue; + } + if (c == '-' && (c = soap_get1(soap)) == '-') + { + do + { + c = soap_get1(soap); + if (c == '-' && (c = soap_get1(soap)) == '-') + break; + } while ((int)c != EOF); + } + } + else if (c == '?') + { + c = soap_getpi(soap); + } + while ((int)c != EOF) + { + if (c == '<') + { + k++; + } + else if (c == '>') + { + if (--k <= 0) + break; + } + c = soap_get1(soap); + } + if ((int)c == EOF) + break; + c = soap_get1(soap); + continue; + } + if (c == '/') + return SOAP_TT; + soap_revget1(soap); + return SOAP_LT; + case '>': + return SOAP_GT; + case '"': + return SOAP_QT; + case '\'': + return SOAP_AP; + case '&': + return soap_char(soap) | 0x80000000; + } + break; + } + return c; +} + +/******************************************************************************/ + +static soap_wchar +soap_getpi(struct soap *soap) +{ + char buf[64]; + char *s = buf; + size_t i = sizeof(buf); + soap_wchar c; + while ((int)(c = soap_getchar(soap)) != EOF && c != '?') + { + if (i > 1) + { + if (soap_coblank(c)) + c = ' '; + *s++ = (char)c; + i--; + } + } + *s = '\0'; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "XML PI \n", buf)); + if (!strncmp(buf, "xml ", 4)) + { + s = strstr(buf, " encoding="); + if (s && s[10]) + { + if (!soap_tag_cmp(s + 11, "iso-8859-1*") + || !soap_tag_cmp(s + 11, "latin1*")) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Switching to latin1 encoding\n")); + soap->mode |= SOAP_ENC_LATIN; + } + else if (!soap_tag_cmp(s + 11, "utf-8*")) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Switching to utf-8 encoding\n")); + soap->mode &= ~SOAP_ENC_LATIN; + } + } + } + if ((int)c != EOF) + c = soap_getchar(soap); + return c; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_move(struct soap *soap, ULONG64 n) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving " SOAP_ULONG_FORMAT " bytes forward\n", n)); + for (; n; n--) + if ((int)soap_getchar(soap) == EOF) + return SOAP_EOF; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +ULONG64 +SOAP_FMAC2 +soap_tell(struct soap *soap) +{ + return soap->count - soap->buflen + soap->bufidx - (soap->ahead != 0); +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_pututf8(struct soap *soap, unsigned long c) +{ + char tmp[24]; + if ((c < 0x7F && c > 0x1F)) + { + *tmp = (char)c; + return soap_send_raw(soap, tmp, 1); + } +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!(c == 0x09 || c == 0x0A || c == 0x0D || (c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif +#ifndef WITH_LEAN + if (c > 0x9F) + { + char *t = tmp; + if (c < 0x0800) + { + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + } + else + { + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + *t = '\0'; + } + else +#endif + (SOAP_SNPRINTF(tmp, sizeof(tmp), 20), "&#x%lX;", c); + return soap_send(soap, tmp); +} + +/******************************************************************************/ + +SOAP_FMAC1 +soap_wchar +SOAP_FMAC2 +soap_getutf8(struct soap *soap) +{ +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + soap_wchar c, c1, c2, c3; +#else + soap_wchar c, c1, c2, c3, c4; +#endif + c = soap->ahead; + if (c >= 0x80) + soap->ahead = 0; + else + c = (soap_wchar)soap_get(soap); + if (c < 0x80 || c > 0xFF || (soap->mode & SOAP_ENC_LATIN)) + return c; +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + c1 = (soap_wchar)soap_get1(soap); + if (c <= 0xC1 || (c1 & 0xC0) != 0x80) + { + soap_revget1(soap); + return SOAP_UNKNOWN_UNICODE_CHAR; + } + c1 &= 0x3F; + if (c < 0xE0) + return (((c & 0x1F) << 6) | c1); + c2 = (soap_wchar)soap_get1(soap); + if ((c == 0xE0 && c1 < 0x20) || (c2 & 0xC0) != 0x80) + { + soap_revget1(soap); + return SOAP_UNKNOWN_UNICODE_CHAR; + } + c2 &= 0x3F; + if (c < 0xF0) + return (((c & 0x0F) << 12) | (c1 << 6) | c2); + c3 = (soap_wchar)soap_get1(soap); + if ((c == 0xF0 && c1 < 0x10) || (c == 0xF4 && c1 >= 0x10) || c >= 0xF5 || (c3 & 0xC0) != 0x80) + { + soap_revget1(soap); + return SOAP_UNKNOWN_UNICODE_CHAR; + } + return (((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | (c3 & 0x3F)); +#else + c1 = (soap_wchar)soap_get1(soap); + if (c < 0xC0 || (c1 & 0xC0) != 0x80) + { + soap_revget1(soap); + /* doesn't look like this is UTF-8, try continue as if ISO-8859-1 */ + return c; + } + c1 &= 0x3F; + if (c < 0xE0) + return ((soap_wchar)(c & 0x1F) << 6) | c1; + c2 = (soap_wchar)soap_get1(soap) & 0x3F; + if (c < 0xF0) + return ((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2; + c3 = (soap_wchar)soap_get1(soap) & 0x3F; + if (c < 0xF8) + return ((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3; + c4 = (soap_wchar)soap_get1(soap) & 0x3F; + if (c < 0xFC) + return ((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4; + return ((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(soap_get1(soap) & 0x3F); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_utf8len(const char *s) +{ + size_t l = 0; + while (*s) + if ((*s++ & 0xC0) != 0x80) + l++; + return l; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_puthex(struct soap *soap, const unsigned char *s, int n) +{ + char d[2 * SOAP_BINARY_BUFLEN], *p = d; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_s2hex(soap, s, NULL, n); + if (!soap->dom->text) + return soap->error; + return SOAP_OK; + } +#endif + for (; n > 0; n--) + { + int m = *s++; + p[0] = (char)((m >> 4) + (m > 159 ? '7' : '0')); + m &= 0x0F; + p[1] = (char)(m + (m > 9 ? '7' : '0')); + p += 2; + if (p - d == sizeof(d)) + { + if (soap_send_raw(soap, d, sizeof(d))) + return soap->error; + p = d; + } + } + if (p != d && soap_send_raw(soap, d, p - d)) + return soap->error; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned char* +SOAP_FMAC2 +soap_gethex(struct soap *soap, int *n) +{ + size_t l = 0; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_string_in(soap, 0, -1, -1, NULL); + return (unsigned char*)soap_hex2s(soap, soap->dom->text, NULL, 0, n); + } +#endif +#ifdef WITH_FAST + soap->labidx = 0; + for (;;) + { + char *s; + size_t i, k; + if (soap_append_lab(soap, NULL, 0)) + return NULL; + s = soap->labbuf + soap->labidx; + k = soap->lablen - soap->labidx; + soap->labidx = soap->lablen; + for (i = 0; i < k; i++) + { + char d1, d2; + soap_wchar c; + c = soap_get(soap); + if (soap_isxdigit(c)) + { + d1 = (char)c; + c = soap_get(soap); + if (soap_isxdigit(c)) + { + d2 = (char)c; + } + else + { + soap->error = SOAP_TYPE; + return NULL; + } + } + else + { + unsigned char *p = NULL; + l = soap->lablen + i - k; + soap_unget(soap, c); + if (n) + *n = (int)l; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + } + else + { + p = (unsigned char*)soap_malloc(soap, l); + if (p) + (void)soap_memcpy((void*)p, l, (const void*)soap->labbuf, l); + } + return p; + } + *s++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0')); + } + l = soap->lablen; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } +#else + if (soap_alloc_block(soap) == NULL) + return NULL; + for (;;) + { + int i; + char *s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN); + if (!s) + { + soap_end_block(soap, NULL); + return NULL; + } + for (i = 0; i < SOAP_BLKLEN; i++) + { + char d1, d2; + soap_wchar c = soap_get(soap); + if (soap_isxdigit(c)) + { + d1 = (char)c; + c = soap_get(soap); + if (soap_isxdigit(c)) + d2 = (char)c; + else + { + soap_end_block(soap, NULL); + soap->error = SOAP_TYPE; + return NULL; + } + } + else + { + unsigned char *p; + soap_unget(soap, c); + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + if (n) + *n = (int)soap_size_block(soap, NULL, i); + p = (unsigned char*)soap_save_block(soap, NULL, NULL, 0); + return p; + } + *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0'); + l++; + } + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + } +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putbase64(struct soap *soap, const unsigned char *s, int n) +{ + char d[4 * SOAP_BINARY_BUFLEN], *p = d; + if (!s) + return SOAP_OK; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_s2base64(soap, s, NULL, n); + if (!soap->dom->text) + return soap->error; + return SOAP_OK; + } +#endif + for (; n > 2; n -= 3, s += 3) + { + p[0] = soap_base64o[(s[0] & 0xFC) >> 2]; + p[1] = soap_base64o[((s[0] & 0x03) << 4) | ((s[1] & 0xF0) >> 4)]; + p[2] = soap_base64o[((s[1] & 0x0F) << 2) | ((s[2] & 0xC0) >> 6)]; + p[3] = soap_base64o[s[2] & 0x3F]; + p += 4; + if (p - d == sizeof(d)) + { + if (soap_send_raw(soap, d, sizeof(d))) + return soap->error; + p = d; + } + } + if (n == 2) + { + p[0] = soap_base64o[(s[0] & 0xFC) >> 2]; + p[1] = soap_base64o[((s[0] & 0x03) << 4) | ((s[1] & 0xF0) >> 4)]; + p[2] = soap_base64o[(s[1] & 0x0F) << 2]; + p[3] = '='; + p += 4; + } + else if (n == 1) + { + p[0] = soap_base64o[(s[0] & 0xFC) >> 2]; + p[1] = soap_base64o[(s[0] & 0x03) << 4]; + p[2] = '='; + p[3] = '='; + p += 4; + } + if (p != d && soap_send_raw(soap, d, p - d)) + return soap->error; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned char* +SOAP_FMAC2 +soap_getbase64(struct soap *soap, int *n, int malloc_flag) +{ + size_t l = 0; + (void)malloc_flag; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_string_in(soap, 0, -1, -1, NULL); + return (unsigned char*)soap_base642s(soap, soap->dom->text, NULL, 0, n); + } +#endif +#ifdef WITH_FAST + soap->labidx = 0; + for (;;) + { + size_t i, k; + char *s; + if (soap_append_lab(soap, NULL, 2)) + return NULL; + s = soap->labbuf + soap->labidx; + k = soap->lablen - soap->labidx; + soap->labidx = 3 * (soap->lablen / 3); + if (k > 2) + { + for (i = 0; i < k - 2; i += 3) + { + unsigned long m = 0; + int j = 0; + do + { + soap_wchar c = soap_get(soap); + if (c < SOAP_AP) + c &= 0x7FFFFFFF; + if (c == '=' || c < 0) + { + unsigned char *p = NULL; + switch (j) + { + case 2: + *s++ = (char)((m >> 4) & 0xFF); + i++; + break; + case 3: + *s++ = (char)((m >> 10) & 0xFF); + *s++ = (char)((m >> 2) & 0xFF); + i += 2; + } + l = soap->lablen + i - k; + if (n) + *n = (int)l; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + soap->error = SOAP_LENGTH; + else + { + p = (unsigned char*)soap_malloc(soap, l); + if (p) + (void)soap_memcpy((void*)p, l, (const void*)soap->labbuf, l); + } + if (c >= 0) + { + while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT) + continue; + } + soap_unget(soap, c); + return p; + } + c -= '+'; + if (c >= 0 && c <= 79) + { + int b = soap_base64i[c]; + if (b >= 64) + { + soap->error = SOAP_TYPE; + return NULL; + } + m = (m << 6) + b; + j++; + } + else if (!soap_coblank(c + '+')) + { + soap->error = SOAP_TYPE; + return NULL; + } + } while (j < 4); + *s++ = (char)((m >> 16) & 0xFF); + *s++ = (char)((m >> 8) & 0xFF); + *s++ = (char)(m & 0xFF); + } + l = soap->lablen; + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } + } +#else + if (soap_alloc_block(soap) == NULL) + return NULL; + for (;;) + { + int i; + char *s = (char*)soap_push_block(soap, NULL, 3 * SOAP_BLKLEN); /* must be multiple of 3 */ + if (!s) + { + soap_end_block(soap, NULL); + return NULL; + } + for (i = 0; i < SOAP_BLKLEN; i++) + { + unsigned long m = 0; + int j = 0; + do + { + soap_wchar c = soap_get(soap); + if (c < SOAP_AP) + c &= 0x7FFFFFFF; + if (c == '=' || c < 0) + { + unsigned char *p; + i *= 3; + switch (j) + { + case 2: + *s++ = (char)((m >> 4) & 0xFF); + i++; + l++; + break; + case 3: + *s++ = (char)((m >> 10) & 0xFF); + *s++ = (char)((m >> 2) & 0xFF); + l += 2; + i += 2; + } + if (n) + *n = (int)soap_size_block(soap, NULL, i); + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + p = (unsigned char*)soap_save_block(soap, NULL, NULL, 0); + if (c >= 0) + { + while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT) + continue; + } + soap_unget(soap, c); + return p; + } + c -= '+'; + if (c >= 0 && c <= 79) + { + int b = soap_base64i[c]; + if (b >= 64) + { + soap->error = SOAP_TYPE; + return NULL; + } + m = (m << 6) + b; + j++; + } + else if (!soap_coblank(c + '+')) + { + soap->error = SOAP_TYPE; + return NULL; + } + } while (j < 4); + *s++ = (char)((m >> 16) & 0xFF); + *s++ = (char)((m >> 8) & 0xFF); + *s++ = (char)(m & 0xFF); + l += 3; + } + if (soap->maxlength > 0 && l > (size_t)soap->maxlength) + { + soap->error = SOAP_LENGTH; + soap_end_block(soap, NULL); + return NULL; + } + } +#endif +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_xop_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options) +{ + /* Check MTOM xop:Include element (within hex/base64Binary) */ + /* TODO: this code to be obsoleted with new import/xop.h conventions */ + short body = soap->body; /* should save type too? */ + if (!soap_peek_element(soap)) + { + if (!soap_element_begin_in(soap, ":Include", 0, NULL)) + { + if (soap_attachment_forward(soap, ptr, size, id, type, options) + || (soap->body && soap_element_end_in(soap, ":Include"))) + return soap->error; + } + else if (soap->error == SOAP_TAG_MISMATCH) + soap_retry(soap); + else + return soap->error; + } + soap->body = body; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attachment_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options) +{ + struct soap_xlist *xp; + *ptr = NULL; + *size = 0; + *id = NULL; + *type = NULL; + *options = NULL; + if (!*soap->href) + return SOAP_OK; + *id = soap_strdup(soap, soap->href); + xp = (struct soap_xlist*)SOAP_MALLOC(soap, sizeof(struct soap_xlist)); + if (!xp) + return soap->error = SOAP_EOM; + xp->next = soap->xlist; + xp->ptr = ptr; + xp->size = size; + xp->id = *id; + xp->type = type; + xp->options = options; + soap->xlist = xp; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void * +SOAP_FMAC2 +soap_memdup(struct soap *soap, const void *s, size_t n) +{ + void *t = NULL; + if (s) + { + t = soap_malloc(soap, n); + if (t) + (void)soap_memcpy(t, n, s, n); + } + return t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_strdup(struct soap *soap, const char *s) +{ + char *t = NULL; + if (s) + { + size_t n = strlen(s) + 1; + if (n > 0) + { + t = (char*)soap_malloc(soap, n); + if (t) + { + (void)soap_memcpy((void*)t, n, (const void*)s, n); + t[n - 1] = '\0'; + } + } + } + return t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +wchar_t * +SOAP_FMAC2 +soap_wstrdup(struct soap *soap, const wchar_t *s) +{ + wchar_t *t = NULL; + if (s) + { + size_t n = 0, m; + while (s[n]) + n++; + n++; + m = sizeof(wchar_t) * n; + if (n > 0) + { + t = (wchar_t*)soap_malloc(soap, m); + if (t) + { + (void)soap_memcpy((void*)t, m, (const void*)s, m); + t[n - 1] = L'\0'; + } + } + } + return t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_strtrim(struct soap *soap, char *s) +{ + (void)soap; + if (s) + { + char *t; + while ((*s >= 9 && *s <= 13) || *s == 32) + s++; + t = s; + while (*t) + t++; + while (--t > s && ((*t >= 9 && *t <= 13) || *t == 32)) + continue; + t[1] = '\0'; + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +wchar_t * +SOAP_FMAC2 +soap_wstrtrim(struct soap *soap, wchar_t *s) +{ + (void)soap; + if (s) + { + wchar_t *t; + while ((*s >= 9 && *s <= 13) || *s == 32) + s++; + t = s; + while (*t) + t++; + while (--t > s && ((*t >= 9 && *t <= 13) || *t == 32)) + continue; + t[1] = L'\0'; + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_blist* +SOAP_FMAC2 +soap_alloc_block(struct soap *soap) +{ + struct soap_blist *p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New block sequence (prev=%p)\n", (void*)soap->blist)); + p = (struct soap_blist*)SOAP_MALLOC(soap, sizeof(struct soap_blist)); + if (!p) + { + soap->error = SOAP_EOM; + return NULL; + } + p->next = soap->blist; + p->head = NULL; + p->size = 0; + p->item = 0; + soap->blist = p; + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_push_block(struct soap *soap, struct soap_blist *b, size_t n) +{ + struct soap_bhead *p; + if (!b) + b = soap->blist; + if (!b + || b->size + n < b->size + || sizeof(struct soap_bhead) + n < n + || (SOAP_MAXALLOCSIZE > 0 && sizeof(struct soap_bhead) + n > SOAP_MAXALLOCSIZE)) + { + soap->error = SOAP_EOM; + return NULL; + } + p = (struct soap_bhead*)SOAP_MALLOC(soap, sizeof(struct soap_bhead) + n); + if (!p) + { + soap->error = SOAP_EOM; + return NULL; + } + p->next = b->head; + b->head = p; + p->size = n; + b->size += n; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push block %p of %u bytes on %lu previous blocks (%lu bytes total)\n", (void*)p, (unsigned int)n, (unsigned long)b->item, (unsigned long)b->size)); + b->item++; + return (void*)(p + 1); /* skip block header and point to n allocated bytes */ +} + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_push_block_max(struct soap *soap, struct soap_blist *b, size_t n) +{ + if (b && b->item >= soap->maxoccurs) /* restrict block array length */ + { + soap->error = SOAP_OCCURS; + return NULL; + } + return soap_push_block(soap, b, n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_pop_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p; + if (!b) + b = soap->blist; + if (!b || !b->head) + return; + p = b->head; + b->size -= p->size; + b->head = p->next; + b->item--; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop block %p (%lu items of %lu bytes total)\n", (void*)p, (unsigned long)b->item, (unsigned long)b->size)); + SOAP_FREE(soap, p); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_update_pointers(struct soap *soap, const char *dst, const char *src, size_t len) +{ + const void *start = src, *end = src + len; +#ifndef WITH_LEANER + struct soap_xlist *xp; +#endif +#ifndef WITH_NOIDREF + if ((soap->version && !(soap->imode & SOAP_XML_TREE)) || (soap->mode & SOAP_XML_GRAPH)) + { + int i; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update pointers %p (%lu bytes) -> %p\n", (void*)src, (unsigned long)len, (void*)dst)); + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + struct soap_flist *fp; + void *p, **q; + if (ip->shaky) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update shaky id='%s'\n", ip->id)); + if (ip->ptr && ip->ptr >= start && ip->ptr < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update ptr %p -> %p\n", ip->ptr, (void*)((const char*)ip->ptr + (dst-src)))); + ip->ptr = (void*)((const char*)ip->ptr + (dst-src)); + } + for (q = &ip->link; q; q = (void**)p) + { + p = *q; + if (p && p >= start && p < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Link update id='%s' %p -> %p\n", ip->id, p, (void*)((const char*)p + (dst-src)))); + *q = (void*)((const char*)p + (dst-src)); + } + } + for (q = &ip->copy; q; q = (void**)p) + { + p = *q; + if (p && p >= start && p < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy chain update id='%s' %p -> %p\n", ip->id, p, (void*)((const char*)p + (dst-src)))); + *q = (void*)((const char*)p + (dst-src)); + } + } + for (fp = ip->flist; fp; fp = fp->next) + { + if (fp->ptr >= start && fp->ptr < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy list update id='%s' target type=%d %p -> %p\n", ip->id, fp->type, fp->ptr, (void*)((char*)fp->ptr + (dst-src)))); + fp->ptr = (void*)((const char*)fp->ptr + (dst-src)); + } + } + if (ip->smart && ip->smart >= start && ip->smart < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Smart shared pointer update %p -> %p\n", ip->smart, (void*)((const char*)ip->smart + (dst-src)))); + ip->smart = (void*)((const char*)ip->smart + (dst-src)); + } + } + } + } + } +#else + (void)soap; (void)start; (void)end; (void)dst; (void)src; +#endif +#ifndef WITH_LEANER + for (xp = soap->xlist; xp; xp = xp->next) + { + if (xp->ptr && (void*)xp->ptr >= start && (void*)xp->ptr < end) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update attachment id='%s' %p -> %p\n", xp->id ? xp->id : SOAP_STR_EOS, (void*)xp->ptr, (void*)((char*)xp->ptr + (dst-src)))); + xp->ptr = (unsigned char**)((char*)xp->ptr + (dst-src)); + xp->size = (int*)((char*)xp->size + (dst-src)); + xp->type = (char**)((char*)xp->type + (dst-src)); + xp->options = (char**)((char*)xp->options + (dst-src)); + } + } +#endif +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static int +soap_has_copies(struct soap *soap, const char *start, const char *end) +{ + int i; + struct soap_ilist *ip = NULL; + struct soap_flist *fp = NULL; + const char *p; + for (i = 0; i < SOAP_IDHASH; i++) + { + for (ip = soap->iht[i]; ip; ip = ip->next) + { + for (p = (const char*)ip->copy; p; p = *(const char**)p) + if (p >= start && p < end) + return SOAP_ERR; + for (fp = ip->flist; fp; fp = fp->next) + if (fp->type == ip->type && (const char*)fp->ptr >= start && (const char*)fp->ptr < end) + return SOAP_ERR; + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_resolve(struct soap *soap) +{ + int i; + short flag; + const char *id; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded refs\n")); + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + if (ip->ptr) + { + void **q; + struct soap_flist *fp, **fpp = &ip->flist; + if (ip->spine) + ip->spine[0] = ip->ptr; + q = (void**)ip->link; + ip->link = NULL; + DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s' type=%d\n", ip->id, ip->type)); + while (q) + { + void *p = *q; + *q = ip->ptr; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", (void*)q, ip->ptr)); + q = (void**)p; + } + while ((fp = *fpp)) + { + if (fp->level > 0 && fp->finsert) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... insert type=%d link %p -> %p\n", fp->type, fp->ptr, ip->ptr)); + if (ip->spine && fp->level <= SOAP_MAXPTRS) + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->spine[fp->level - 1], &ip->smart); + else if (fp->level == 1) + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->ptr, &ip->smart); + else if (fp->level <= SOAP_MAXPTRS) + { + int i; + ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*)); + if (!ip->spine) + return soap->error = SOAP_EOM; + ip->spine[0] = ip->ptr; + for (i = 1; i < SOAP_MAXPTRS; i++) + ip->spine[i] = &ip->spine[i - 1]; + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, &ip->spine[fp->level - 1], &ip->smart); + } + *fpp = fp->next; + SOAP_FREE(soap, fp); + } + else + fpp = &fp->next; + } + } + else if (*ip->id == '#') + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Missing id='%s'\n", ip->id)); + soap_strcpy(soap->id, sizeof(soap->id), ip->id + 1); + return soap->error = SOAP_MISSING_ID; + } + } + } + do + { + flag = 0; + id = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution phase\n")); + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + if (ip->copy || ip->flist) + { + if (ip->ptr && !soap_has_copies(soap, (const char*)ip->ptr, (const char*)ip->ptr + ip->size)) + { + struct soap_flist *fp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving id='%s' type=%d ptr=%p size=%lu ...\n", ip->id, ip->type, ip->ptr, (unsigned long)ip->size)); + if (ip->copy) + { + void *p, **q = (void**)ip->copy; + DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing copy chain to resolve id='%s'\n", ip->id)); + ip->copy = NULL; + do + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%u bytes)\n", ip->ptr, (void*)q, (unsigned int)ip->size)); + p = *q; + (void)soap_memcpy((void*)q, ip->size, (const void*)ip->ptr, ip->size); + q = (void**)p; + } while (q); + flag = 1; + } + while ((fp = ip->flist)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data type=%d target type=%d location=%p level=%u id='%s'\n", ip->type, fp->type, ip->ptr, fp->level, ip->id)); + if (fp->level == 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%lu bytes)\n", ip->ptr, fp->ptr, (unsigned long)ip->size)); + if (fp->finsert) + fp->finsert(soap, ip->type, fp->type, fp->ptr, fp->index, ip->ptr, &ip->smart); + else + (void)soap_memcpy((void*)fp->ptr, ip->size, (const void*)ip->ptr, ip->size); + } + ip->flist = fp->next; + SOAP_FREE(soap, fp); + flag = 1; + } + } + else if (*ip->id == '#') + id = ip->id; + } + } + } + } while (flag); + if (id) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution error: forwarded data for id='%s' could not be propagated, please report this problem to the gSOAP developers\n", id)); + return soap_id_nullify(soap, id); + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution done\n")); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_size_block(struct soap *soap, struct soap_blist *b, size_t n) +{ + if (!b) + b = soap->blist; + if (b->head) + { + b->size -= b->head->size - n; + b->head->size = n; + } + return b->size; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_first_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p, *q, *r; + if (!b) + b = soap->blist; + p = b->head; + if (!p) + return NULL; + r = NULL; + do + { + q = p->next; + p->next = r; + r = p; + p = q; + } while (p); + b->head = r; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "First block %p\n", (void*)(r + 1))); + return (char*)(r + 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_next_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p; + if (!b) + b = soap->blist; + p = b->head; + if (p) + { + b->head = p->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Next block %p, deleting current block\n", (void*)(b->head ? b->head + 1 : NULL))); + SOAP_FREE(soap, p); + if (b->head) + return (char*)(b->head + 1); + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_block_size(struct soap *soap, struct soap_blist *b) +{ + if (!b) + b = soap->blist; + return b->head->size; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_end_block(struct soap *soap, struct soap_blist *b) +{ + struct soap_bhead *p, *q; + if (!b) + b = soap->blist; + if (b) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of block sequence, free all remaining blocks\n")); + for (p = b->head; p; p = q) + { + q = p->next; + SOAP_FREE(soap, p); + } + if (soap->blist == b) + soap->blist = b->next; + else + { + struct soap_blist *bp; + for (bp = soap->blist; bp; bp = bp->next) + { + if (bp->next == b) + { + bp->next = b->next; + break; + } + } + } + SOAP_FREE(soap, b); + } + DBGLOG(TEST, if (soap->blist) SOAP_MESSAGE(fdebug, "Restored previous block sequence\n")); +#ifndef WITH_NOIDREF + if (!soap->blist && ((soap->version && !(soap->imode & SOAP_XML_TREE)) || (soap->mode & SOAP_XML_GRAPH))) + { + int i; + struct soap_ilist *ip = NULL; + for (i = 0; i < SOAP_IDHASH; i++) + for (ip = soap->iht[i]; ip; ip = ip->next) + ip->shaky = 0; + } +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag) +{ + size_t n; + char *q, *s; + if (!b) + b = soap->blist; + if (b->size) + { + if (!p) + p = (char*)soap_malloc(soap, b->size); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all %lu blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned long)b->item, (unsigned int)b->size, (void*)b->head, (void*)p)); + if (p) + { + s = p; + for (q = soap_first_block(soap, b); q; q = soap_next_block(soap, b)) + { + n = soap_block_size(soap, b); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, (void*)q, (void*)s)); + if (flag) + soap_update_pointers(soap, s, q, n); + (void)soap_memcpy((void*)s, n, (const void*)q, n); + s += n; + } + } + else + soap->error = SOAP_EOM; + } + soap_end_block(soap, b); + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_putsizesoffsets(struct soap *soap, const char *type, const int *size, const int *offset, int dim) +{ + int i; + const char *t = ",%d"; + if (!type) + return NULL; + if (soap->version == 2) + t = " %d"; + if (soap->version != 2 && offset) + { + (SOAP_SNPRINTF(soap->type, sizeof(soap->type) - 1, strlen(type) + 20), "%s[%d", type, size[0] + offset[0]); + for (i = 1; i < dim; i++) + { + size_t l = strlen(soap->type); + (SOAP_SNPRINTF(soap->type + l, sizeof(soap->type) - l - 1, 20), t, size[i] + offset[i]); + } + } + else + { + (SOAP_SNPRINTF(soap->type, sizeof(soap->type) - 1, strlen(type) + 20), "%s[%d", type, size[0]); + for (i = 1; i < dim; i++) + { + size_t l = strlen(soap->type); + (SOAP_SNPRINTF(soap->type + l, sizeof(soap->type) - l - 1, 20), t, size[i]); + } + } + soap_strcat(soap->type, sizeof(soap->type), "]"); + return soap->type; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_putoffsets(struct soap *soap, const int *offset, int dim) +{ + int i; + soap->arrayOffset[0] = '\0'; + if (soap->version == 1) + { + (SOAP_SNPRINTF(soap->arrayOffset, sizeof(soap->arrayOffset) - 1, 20), "[%d", offset[0]); + for (i = 1; i < dim; i++) + { + size_t l = strlen(soap->arrayOffset); + (SOAP_SNPRINTF(soap->arrayOffset + l, sizeof(soap->arrayOffset) - l - 1, 20), ",%d", offset[i]); + } + soap_strcat(soap->arrayOffset, sizeof(soap->arrayOffset), "]"); + } + return soap->arrayOffset; +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_size(const int *size, int dim) +{ + int i; + size_t n = 0; + if (size[0] <= 0) + return 0; + n = (size_t)size[0]; + for (i = 1; i < dim; i++) + { + if (size[i] <= 0) + return 0; + n *= (size_t)size[i]; + } + return (size_t)n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_getsizes(const char *attr, int *size, int dim) +{ + size_t i, k, n; + if (!*attr) + return 0; + i = strlen(attr); + n = 1; + do + { + for (; i > 0; i--) + if (attr[i - 1] == '[' || attr[i - 1] == ',' || attr[i - 1] == ' ') + break; + n *= k = (size_t)soap_strtoul(attr + i, NULL, 10); + size[--dim] = (int)k; + if (n > SOAP_MAXARRAYSIZE) + return 0; + } while (dim > 0 && --i > 0 && attr[i] != '['); + return n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getoffsets(const char *attr, const int *size, int *offset, int dim) +{ + int i, j = 0; + if (offset) + { + for (i = 0; i < dim && attr && *attr; i++) + { + attr++; + j *= size[i]; + j += offset[i] = (int)soap_strtol(attr, NULL, 10); + attr = strchr(attr, ','); + } + } + else + { + for (i = 0; i < dim && attr && *attr; i++) + { + attr++; + j *= size[i]; + j += (int)soap_strtol(attr, NULL, 10); + attr = strchr(attr, ','); + } + } + return j; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getposition(const char *attr, int *pos) +{ + int i, n; + if (!*attr) + return -1; + n = 0; + i = 1; + do + { + pos[n++] = (int)soap_strtol(attr + i, NULL, 10); + while (attr[i] && attr[i] != ',' && attr[i] != ']') + i++; + if (attr[i] == ',') + i++; + } while (n < SOAP_MAXDIMS && attr[i] && attr[i] != ']'); + return n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_nlist * +SOAP_FMAC2 +soap_push_namespace(struct soap *soap, const char *id, const char *ns) +{ + struct soap_nlist *np = NULL; + struct Namespace *p; + short i = -1; + size_t n, k; + n = strlen(id); + k = strlen(ns) + 1; + p = soap->local_namespaces; + if (p) + { + for (i = 0; p->id; p++, i++) + { + if (p->ns && !strcmp(ns, p->ns)) + break; + if (p->out) + { + if (!strcmp(ns, p->out)) + break; + } + else if (p->in) + { + if (!soap_tag_cmp(ns, p->in)) + { + if (SOAP_MAXALLOCSIZE <= 0 || k <= SOAP_MAXALLOCSIZE) + p->out = (char*)SOAP_MALLOC(soap, k); + if (p->out) + soap_strcpy(p->out, k, ns); + break; + } + } + } + if (!p->id) + i = -1; + } + if (i >= 0) + k = 0; + if (sizeof(struct soap_nlist) + n + k > n && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_nlist) + n + k <= SOAP_MAXALLOCSIZE)) + np = (struct soap_nlist*)SOAP_MALLOC(soap, sizeof(struct soap_nlist) + n + k); + if (!np) + { + soap->error = SOAP_EOM; + return NULL; + } + np->next = soap->nlist; + soap->nlist = np; + np->level = soap->level; + np->index = i; + soap_strcpy((char*)np->id, n + 1, id); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u) '%s'='%s'\n", soap->level, id, ns)); + if (i < 0) + { + np->ns = np->id + n + 1; + soap_strcpy((char*)np->ns, k, ns); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push NOT OK: no match found for '%s' in namespace mapping table (added to stack anyway)\n", ns)); + } + else + { + np->ns = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push OK ('%s' matches '%s' in namespace table)\n", id, p->id)); + } + return np; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_pop_namespace(struct soap *soap) +{ + struct soap_nlist *np, *nq; + for (np = soap->nlist; np && np->level >= soap->level; np = nq) + { + nq = np->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop namespace binding (level=%u) '%s' level=%u\n", soap->level, np->id, np->level)); + SOAP_FREE(soap, np); + } + soap->nlist = np; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_namespace(struct soap *soap, const char *id1, const char *id2, size_t n1, size_t n2) +{ + struct soap_nlist *np = soap->nlist; + const char *s; + while (np && (strncmp(np->id, id1, n1) || np->id[n1])) + np = np->next; + if (np) + { + if (!(soap->mode & SOAP_XML_IGNORENS) && (n2 > 0 || !np->ns || *np->ns)) + { + if (np->index < 0 + || ((s = soap->local_namespaces[np->index].id) && (strncmp(s, id2, n2) || (s[n2] && s[n2] != '_')))) + return SOAP_NAMESPACE; + } + return SOAP_OK; + } + if (n1 == 0) + return n2 == 0 || (soap->mode & SOAP_XML_IGNORENS) ? SOAP_OK : SOAP_NAMESPACE; + if ((n1 == 3 && n1 == n2 && !strncmp(id1, "xml", 3) && !strncmp(id1, id2, 3)) + || (soap->mode & SOAP_XML_IGNORENS)) + return SOAP_OK; + return soap->error = SOAP_SYNTAX_ERROR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_current_namespace_tag(struct soap *soap, const char *tag) +{ + struct soap_nlist *np; + const char *s; + if (!tag || !strncmp(tag, "xml", 3)) + return NULL; + np = soap->nlist; + s = strchr(tag, ':'); + if (!s) + { + while (np && *np->id) /* find default namespace, if present */ + np = np->next; + } + else + { + while (np && (strncmp(np->id, tag, s - tag) || np->id[s - tag])) + np = np->next; + if (!np) + soap->error = SOAP_NAMESPACE; + } + if (np) + { + if (np->index >= 0) + return soap->namespaces[np->index].ns; + if (np->ns) + { + s = np->ns; + if (*s) + return soap_strdup(soap, s); + do + np = np->next; + while (np && *np->id); /* find if there is any other default namespace */ + if (np) + return soap_strdup(soap, s); + } + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_current_namespace_att(struct soap *soap, const char *tag) +{ + struct soap_nlist *np; + const char *s; + if (!tag || !strncmp(tag, "xml", 3)) + return NULL; + s = strchr(tag, ':'); + if (!s) + return NULL; + np = soap->nlist; + while (np && (strncmp(np->id, tag, s - tag) || np->id[s - tag])) + np = np->next; + if (!np) + soap->error = SOAP_NAMESPACE; + if (np) + { + if (np->index >= 0) + return soap->namespaces[np->index].ns; + if (np->ns && *np->ns) + return soap_strdup(soap, np->ns); + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_tag_cmp(const char *s, const char *t) +{ + const char *a = NULL; + const char *b = NULL; + for (;;) + { + int c1 = *s; + int c2 = *t; + if (!c1 || c1 == '"') + break; + if (c2 != '-') + { + if (c1 < c2) + { + if (c1 >= 'A' && c1 <= 'Z') + c1 += 'a' - 'A'; + } + else if (c1 > c2) + { + if (c2 >= 'A' && c2 <= 'Z') + c2 += 'a' - 'A'; + } + if (c2 == '*') + { + c2 = *++t; + if (!c2) + return 0; + a = s; + b = t; + continue; + } + if (c1 != c2) + { + if (!a) + return 1; + s = ++a; + t = b; + continue; + } + } + s++; + t++; + } + if (*t == '*' && !t[1]) + return 0; + return *t; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_tag(struct soap *soap, const char *tag1, const char *tag2) +{ + const char *s, *t; + int err; + if (!tag1 || !tag2 || !*tag2) + return SOAP_OK; + s = strchr(tag1, ':'); + t = strchr(tag2, ':'); + if (t) + { + if (s) + { + if (t[1] && SOAP_STRCMP(s + 1, t + 1)) + return SOAP_TAG_MISMATCH; + if (t != tag2 && !(soap->mode & SOAP_XML_IGNORENS)) + { + err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2); + if (err) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2)); + if (err == SOAP_NAMESPACE) + return SOAP_TAG_MISMATCH; + return err; + } + } + } + else if (!t[1]) + { + if ((soap->mode & SOAP_XML_IGNORENS) || soap_match_namespace(soap, tag1, tag2, 0, t - tag2)) + return SOAP_TAG_MISMATCH; + } + else if (SOAP_STRCMP(tag1, t + 1)) + { + return SOAP_TAG_MISMATCH; + } + else if (t != tag2) + { + err = soap_match_namespace(soap, tag1, tag2, 0, t - tag2); + if (err) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2)); + if (err == SOAP_NAMESPACE) + return SOAP_TAG_MISMATCH; + return err; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags and (default) namespaces match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; + } + if (s) + { + if (!(soap->mode & SOAP_XML_IGNORENS) || SOAP_STRCMP(s + 1, tag2)) /* always fails (except when ignoring ns) */ + return SOAP_TAG_MISMATCH; + } + else if (SOAP_STRCMP(tag1, tag2) +#ifndef WITH_NOEMPTYNAMESPACES + || ((soap->mode & SOAP_XML_STRICT) && !(soap->mode & SOAP_XML_IGNORENS) && soap_match_namespace(soap, tag1, tag2, 0, 0)) /* strict checking: default namespace must be null namespace */ +#endif + ) + { + return SOAP_TAG_MISMATCH; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_att(struct soap *soap, const char *tag1, const char *tag2) +{ + const char *s, *t; + int err; + if (!tag1 || !tag2 || !*tag2) + return SOAP_OK; + s = strchr(tag1, ':'); + t = strchr(tag2, ':'); + if (t) + { + if (s) + { + if (t[1] && SOAP_STRCMP(s + 1, t + 1)) + return SOAP_TAG_MISMATCH; + if (t != tag2 && !(soap->mode & SOAP_XML_IGNORENS)) + { + err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2); + if (err) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts '%s' and '%s' match but namespaces differ\n", tag1, tag2)); + if (err == SOAP_NAMESPACE) + return SOAP_TAG_MISMATCH; + return err; + } + } + } + else if (!t[1] || t != tag2 || SOAP_STRCMP(tag1, t + 1)) + return SOAP_TAG_MISMATCH; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts and (default) namespaces match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; + } + if (s) + { + if (!(soap->mode & SOAP_XML_IGNORENS) || SOAP_STRCMP(s + 1, tag2)) /* always fails (except when ignoring ns) */ + return SOAP_TAG_MISMATCH; + } + else if (SOAP_STRCMP(tag1, tag2)) + return SOAP_TAG_MISMATCH; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Atts match: '%s' '%s'\n", tag1, tag2)); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_array(struct soap *soap, const char *type) +{ + if (type && *soap->arrayType) + { + if (soap->version == 1 || !strchr(type, '[')) + { + if (soap_match_tag(soap, soap->arrayType, type) + && soap_match_tag(soap, soap->arrayType, "xsd:anyType") + && soap_match_tag(soap, soap->arrayType, "xsd:ur-type")) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SOAP array type mismatch: '%s' '%s'\n", soap->arrayType, type)); + return SOAP_TAG_MISMATCH; + } + } + } + return SOAP_OK; +} + +/******************************************************************************\ + * + * SSL/TLS + * +\******************************************************************************/ + +#ifdef WITH_OPENSSL +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_rand() +{ + int r; + if (!soap_ssl_init_done) + soap_ssl_init(); +#if OPENSSL_VERSION_NUMBER < 0x10100000L + RAND_pseudo_bytes((unsigned char*)&r, sizeof(int)); +#else + RAND_bytes((unsigned char*)&r, sizeof(int)); +#endif + return r; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +int +SOAP_FMAC2 +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid) +#else +soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid) +#endif +{ + int err; + soap->keyfile = keyfile; +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + soap->keyid = keyid; /* vxWorks compatible */ +#endif + soap->password = password; + soap->cafile = cafile; + soap->capath = capath; +#ifdef WITH_OPENSSL + soap->dhfile = dhfile; + soap->randfile = randfile; + if (!soap->fsslverify) + soap->fsslverify = ssl_verify_callback; +#endif + soap->ssl_flags = flags | (dhfile == NULL ? SOAP_SSL_RSA : 0); +#ifdef WITH_GNUTLS + (void)randfile; (void)sid; + if (dhfile) + { + char *s; + int n = (int)soap_strtoul(dhfile, &s, 10); + if (!soap->dh_params) + gnutls_dh_params_init(&soap->dh_params); + /* if dhfile is numeric, treat it as a key length to generate DH params which can take a while */ + if (n >= 512 && s && *s == '\0') + gnutls_dh_params_generate2(soap->dh_params, (unsigned int)n); + else + { + unsigned int dparams_len; + unsigned char dparams_buf[1024]; + FILE *fd = fopen(dhfile, "r"); + if (!fd) + return soap_set_receiver_error(soap, "SSL/TLS error", "Invalid DH file", SOAP_SSL_ERROR); + dparams_len = (unsigned int)fread(dparams_buf, 1, sizeof(dparams_buf), fd); + fclose(fd); + gnutls_datum_t dparams = { + dparams_buf, dparams_len }; + if (gnutls_dh_params_import_pkcs3(soap->dh_params, &dparams, GNUTLS_X509_FMT_PEM)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Invalid DH file", SOAP_SSL_ERROR); + } + } + else + { +#if GNUTLS_VERSION_NUMBER < 0x030300 + if (!soap->rsa_params) + gnutls_rsa_params_init(&soap->rsa_params); + gnutls_rsa_params_generate2(soap->rsa_params, SOAP_SSL_RSA_BITS); +#endif + } + if (soap->session) + { + gnutls_deinit(soap->session); + soap->session = NULL; + } + if (soap->xcred) + { + gnutls_certificate_free_credentials(soap->xcred); + soap->xcred = NULL; + } +#endif +#ifdef WITH_SYSTEMSSL + (void)randfile; (void)sid; + if (soap->ctx) + gsk_environment_close(&soap->ctx); +#endif + err = soap->fsslauth(soap); +#ifdef WITH_OPENSSL + if (!err) + { + if (sid) + SSL_CTX_set_session_id_context(soap->ctx, (unsigned char*)sid, (unsigned int)strlen(sid)); + else + SSL_CTX_set_session_cache_mode(soap->ctx, SSL_SESS_CACHE_OFF); + } +#endif + return err; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL) +SOAP_FMAC1 +int +SOAP_FMAC2 +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *randfile) +#else +soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *randfile) +#endif +{ + soap->keyfile = keyfile; +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + soap->keyid = keyid; /* vxWorks compatible */ +#endif + soap->password = password; + soap->cafile = cafile; + soap->capath = capath; + soap->ssl_flags = SOAP_SSL_CLIENT | flags; +#ifdef WITH_OPENSSL + soap->dhfile = NULL; + soap->randfile = randfile; + if (!soap->fsslverify) + soap->fsslverify = (flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) == 0 ? ssl_verify_callback : ssl_verify_callback_allow_expired_certificate; +#endif +#ifdef WITH_GNUTLS + (void)randfile; + if (soap->session) + { + gnutls_deinit(soap->session); + soap->session = NULL; + } + if (soap->xcred) + { + gnutls_certificate_free_credentials(soap->xcred); + soap->xcred = NULL; + } +#endif +#ifdef WITH_SYSTEMSSL + (void)randfile; + if (soap->ctx) + gsk_environment_close(&soap->ctx); +#endif + return soap->fsslauth(soap); +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ssl_crl(struct soap *soap, const char *crlfile) +{ +#ifdef WITH_OPENSSL + if (crlfile && soap->ctx) + { +#if OPENSSL_VERSION_NUMBER > 0x00907000L + X509_STORE *store = SSL_CTX_get_cert_store(soap->ctx); + if (*crlfile) + { + int ret; + X509_LOOKUP *lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); + if (!lookup) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't create X509_LOOKUP object", SOAP_SSL_ERROR); + ret = X509_load_crl_file(lookup, crlfile, X509_FILETYPE_PEM); + if (ret <= 0) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL PEM file", SOAP_SSL_ERROR); + } + X509_STORE_set_flags(store, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); +#endif + } + else + soap->crlfile = crlfile; /* activate later when store is available */ +#endif +#ifdef WITH_GNUTLS + if (crlfile && soap->xcred) + { + if (*crlfile) + if (gnutls_certificate_set_x509_crl_file(soap->xcred, crlfile, GNUTLS_X509_FMT_PEM) < 0) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CRL PEM file", SOAP_SSL_ERROR); + } + else + { + soap->crlfile = crlfile; /* activate later when xcred is available */ + } +#endif + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_ssl_init() +{ + /* Note: for multi-threaded applications, the main program should call soap_ssl_init() before any threads are started */ + if (!soap_ssl_init_done) + { + soap_ssl_init_done = 1; +#ifdef WITH_OPENSSL + SSL_library_init(); + OpenSSL_add_all_algorithms(); /* we keep ciphers and digests for the program's lifetime */ +#ifndef WITH_LEAN + SSL_load_error_strings(); +#endif +#if !defined(WIN32) && !defined(CYGWIN) && !defined(__MINGW32__) && !defined(__MINGW64__) + if (!RAND_load_file("/dev/urandom", 1024)) +#else + if (1) +#endif + { + /* if /dev/urandom does not exist we need to do at least some pertubations to seed the OpenSSL PRNG */ + char buf[1024]; + RAND_seed(buf, sizeof(buf)); +#ifdef HAVE_RANDOM + srandom((unsigned long)time(NULL)); +#else + srand((unsigned int)time(NULL)); +#endif + do + { +#ifdef HAVE_RANDOM + long r = random(); /* we actually do no use random() anywhere, except to help seed the OpenSSL PRNG */ + RAND_seed(&r, sizeof(long)); +#else + int r = rand(); /* we actually do no use rand() anywhere, except to help seed the OpenSSL PRNG */ + RAND_seed(&r, sizeof(int)); +#endif + } while (!RAND_status()); + } +#endif +#ifdef WITH_GNUTLS +# if GNUTLS_VERSION_NUMBER < 0x020b00 +# if defined(HAVE_PTHREAD_H) + gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); +# elif defined(HAVE_PTH_H) + gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth); +# endif + gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); + gcry_control(GCRYCTL_DISABLE_SECMEM, 0); + gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); /* libgcrypt init done */ +# endif +# if GNUTLS_VERSION_NUMBER < 0x030300 + gnutls_global_init(); +# endif +#endif + } +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_ssl_noinit() +{ + /* Call this first to bypass SSL init is SSL is already initialized elsewhere */ + soap_ssl_init_done = 1; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_ssl_error(struct soap *soap, int ret, int err) +{ +#ifdef WITH_OPENSSL + const char *msg = soap_code_str(h_ssl_error_codes, err); + if (!msg) + return ERR_error_string(err, soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(msg) + 1), "%s\n", msg); + if (ERR_peek_error()) + { + unsigned long r; + while ((r = ERR_get_error())) + { + size_t l = strlen(soap->msgbuf); + ERR_error_string_n(r, soap->msgbuf + l, sizeof(soap->msgbuf) - l); + l = strlen(soap->msgbuf); + if (l + 1 < sizeof(soap->msgbuf)) + { + soap->msgbuf[l++] = '\n'; + soap->msgbuf[l] = '\0'; + } + if (ERR_GET_REASON(r) == SSL_R_CERTIFICATE_VERIFY_FAILED && l < sizeof(soap->msgbuf)) + { + const char *s = X509_verify_cert_error_string(SSL_get_verify_result(soap->ssl)); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, strlen(s)), "%s", s); + } + } + } + else + { + size_t l = strlen(soap->msgbuf); + switch (ret) + { + case 0: + soap_strcpy(soap->msgbuf + l, sizeof(soap->msgbuf) - l, "EOF was observed that violates the SSL/TLS protocol. The client probably provided invalid authentication information."); + break; + case -1: + { + const char *s = strerror(soap_errno); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, strlen(s) + 42), "Error observed by underlying SSL/TLS BIO: %s", s); + } + break; + } + } + ERR_clear_error(); + return soap->msgbuf; +#endif +#ifdef WITH_GNUTLS + (void)soap; + (void)err; + return gnutls_strerror(ret); +#endif +} +#endif + +/******************************************************************************/ + +#ifdef WITH_SYSTEMSSL +static int +ssl_recv(int sk, void *s, int n, char *user) +{ + (void)user; + return recv(sk, s, n, 0); +} +#endif + +/******************************************************************************/ + +#ifdef WITH_SYSTEMSSL +static int +ssl_send(int sk, void *s, int n, char *user) +{ + (void)user; + return send(sk, s, n, 0); +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL) +static int +ssl_auth_init(struct soap *soap) +{ +#ifdef WITH_OPENSSL +#if OPENSSL_VERSION_NUMBER >= 0x10101000L + int minv = 0, maxv = 0; +#endif + long flags = SSL_OP_ALL; + int mode; +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + EVP_PKEY* pkey; /* vxWorks compatible */ +#endif + if (!soap_ssl_init_done) + soap_ssl_init(); + ERR_clear_error(); + if (!soap->ctx) + { +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + /* TLS_method: a TLS/SSL connection established may understand the SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. */ + soap->ctx = SSL_CTX_new(TLS_method()); +#else + /* SSLv23_method: a TLS/SSL connection established may understand the SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. */ + soap->ctx = SSL_CTX_new(SSLv23_method()); +#endif + if (!soap->ctx) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't setup context", SOAP_SSL_ERROR); + /* The following alters the behavior of SSL read/write: */ +#if 0 + SSL_CTX_set_mode(soap->ctx, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_AUTO_RETRY); +#endif + } + if (soap->randfile) + { + if (!RAND_load_file(soap->randfile, -1)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't load randomness", SOAP_SSL_ERROR); + } + if (soap->cafile || soap->capath) + { + if (!SSL_CTX_load_verify_locations(soap->ctx, soap->cafile, soap->capath)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); + if (soap->cafile && (soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + SSL_CTX_set_client_CA_list(soap->ctx, SSL_load_client_CA_file(soap->cafile)); + } + if (!(soap->ssl_flags & SOAP_SSL_NO_DEFAULT_CA_PATH)) + { + if (!SSL_CTX_set_default_verify_paths(soap->ctx)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read default CA PEM file and/or directory", SOAP_SSL_ERROR); + } + if (soap->crlfile) + { + if (soap_ssl_crl(soap, soap->crlfile)) + return soap->error; + } +/* This code assumes a typical scenario with key and cert in one PEM file, see alternative code below */ +#if 1 + if (soap->keyfile) + { + if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't find or read certificate in private key PEM file", SOAP_SSL_ERROR); + if (soap->password) + { + SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password); + SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password); + } +#ifndef WM_SECURE_KEY_STORAGE + if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); +#endif + } +#else +/* Suggested alternative approach to check the key file for cert only when cafile==NULL */ + if (soap->password) + { + SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password); + SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password); + } + if (!soap->cafile) + { + if (soap->keyfile) + { + if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't find or read certificate in private key PEM file", SOAP_SSL_ERROR); + if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); + } + } + else /* use cafile for (server) cert and keyfile for (server) key */ + { + if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->cafile)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); + if (soap->keyfile) + if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); + } +#endif +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) + /* vxWorks compatible */ + pkey = ipcom_key_db_pkey_get(soap->keyid); + if (!pkey) + return soap_set_receiver_error(soap, "SSL error", "Can't find key", SOAP_SSL_ERROR); + if (!SSL_CTX_use_PrivateKey(soap->ctx, pkey)) + return soap_set_receiver_error(soap, "SSL error", "Can't read key", SOAP_SSL_ERROR); +#endif + if ((soap->ssl_flags & SOAP_SSL_RSA)) + { +#if OPENSSL_VERSION_NUMBER >= 0x10002000L + if (SSL_CTX_need_tmp_RSA(soap->ctx)) + { + unsigned long e = RSA_F4; + BIGNUM *bne = BN_new(); + RSA *rsa = RSA_new(); + if (!bne || !rsa || !BN_set_word(bne, e) || !RSA_generate_key_ex(rsa, SOAP_SSL_RSA_BITS, bne, NULL) || !SSL_CTX_set_tmp_rsa(soap->ctx, rsa)) + { + if (bne) + BN_free(bne); + if (rsa) + RSA_free(rsa); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate RSA key", SOAP_SSL_ERROR); + } + BN_free(bne); + RSA_free(rsa); + } +#else + RSA *rsa = RSA_generate_key(SOAP_SSL_RSA_BITS, RSA_F4, NULL, NULL); + if (!rsa || !SSL_CTX_set_tmp_rsa(soap->ctx, rsa)) + { + if (rsa) + RSA_free(rsa); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate RSA key", SOAP_SSL_ERROR); + } + RSA_free(rsa); +#endif + } + else if (soap->dhfile) + { + DH *dh = NULL; + char *s; + int n = (int)soap_strtoul(soap->dhfile, &s, 10); + /* if dhfile is numeric, treat it as a key length to generate DH params which can take a while */ + if (n >= 512 && s && *s == '\0') + { +#if OPENSSL_VERSION_NUMBER >= 0x10002000L + dh = DH_new(); + if (!DH_generate_parameters_ex(dh, n, 2/*or 5*/, NULL)) + { + DH_free(dh); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't generate DH parameters", SOAP_SSL_ERROR); + } +#elif defined(VXWORKS) + dh = DH_new(); + DH_generate_parameters_ex(dh, n, 2/*or 5*/, NULL); +#else + dh = DH_generate_parameters(n, 2/*or 5*/, NULL, NULL); +#endif + } + else + { + BIO *bio; + bio = BIO_new_file(soap->dhfile, "r"); + if (!bio) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read DH PEM file", SOAP_SSL_ERROR); + dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); + BIO_free(bio); + } + if (!dh || DH_check(dh, &n) != 1 || SSL_CTX_set_tmp_dh(soap->ctx, dh) < 0) + { + if (dh) + DH_free(dh); + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set DH parameters", SOAP_SSL_ERROR); + } + DH_free(dh); + } + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_TLSv1; +#if OPENSSL_VERSION_NUMBER >= 0x10101000L + if ((soap->ssl_flags & SOAP_SSLv3)) + minv = SSL3_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_0)) + minv = TLS1_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_1)) + minv = TLS1_1_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_2)) + minv = TLS1_2_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_3)) + minv = TLS1_3_VERSION; + if ((soap->ssl_flags & SOAP_TLSv1_3) && OpenSSL_version_num() >= 0x10101000L) + maxv = TLS1_3_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_2)) + maxv = TLS1_2_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_1)) + maxv = TLS1_1_VERSION; + else if ((soap->ssl_flags & SOAP_TLSv1_0)) + maxv = TLS1_VERSION; + else + maxv = SSL3_VERSION; + if (!SSL_CTX_set_min_proto_version(soap->ctx, minv) + || !SSL_CTX_set_max_proto_version(soap->ctx, maxv)) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set protocol version", SOAP_SSL_ERROR); +#else + /* disable SSL v2 by default and enable specific protos */ + flags = SSL_OP_NO_SSLv2; + if (!(soap->ssl_flags & SOAP_SSLv3)) + flags |= SSL_OP_NO_SSLv3; +#if OPENSSL_VERSION_NUMBER >= 0x10001000L + if (!(soap->ssl_flags & SOAP_TLSv1_0)) + flags |= SSL_OP_NO_TLSv1; + if (!(soap->ssl_flags & SOAP_TLSv1_1)) + flags |= SSL_OP_NO_TLSv1_1; + if (!(soap->ssl_flags & SOAP_TLSv1_2)) + flags |= SSL_OP_NO_TLSv1_2; +#endif +#endif +#ifdef SSL_OP_NO_TICKET + /* TLS extension is enabled by default in OPENSSL v0.9.8k disable it by */ + flags |= SSL_OP_NO_TICKET; +#endif + SSL_CTX_set_options(soap->ctx, flags); + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + mode = (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT); + else if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION)) + mode = SSL_VERIFY_PEER; + else + mode = SSL_VERIFY_NONE; + SSL_CTX_set_verify(soap->ctx, mode, soap->fsslverify); +#if OPENSSL_VERSION_NUMBER < 0x00905100L + SSL_CTX_set_verify_depth(soap->ctx, 1); +#else + SSL_CTX_set_verify_depth(soap->ctx, 9); +#endif +#endif +#ifdef WITH_GNUTLS + int ret; + char priority[80]; + soap_strcpy(priority, sizeof(priority), "PERFORMANCE"); + if (!soap_ssl_init_done) + soap_ssl_init(); + if (!soap->xcred) + { + if (gnutls_certificate_allocate_credentials(&soap->xcred) != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't allocate credentials or trust", SOAP_SSL_ERROR); +#if GNUTLS_VERSION_NUMBER >= 0x030300 + gnutls_certificate_set_x509_system_trust(soap->xcred); +#endif + if (soap->cafile) + { + if (gnutls_certificate_set_x509_trust_file(soap->xcred, soap->cafile, GNUTLS_X509_FMT_PEM) < 0) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read CA PEM file", SOAP_SSL_ERROR); + } + if (soap->crlfile) + { + if (soap_ssl_crl(soap, soap->crlfile)) + return soap->error; + } + if (soap->keyfile) + { + if (gnutls_certificate_set_x509_key_file2(soap->xcred, soap->keyfile, soap->keyfile, GNUTLS_X509_FMT_PEM, soap->password, GNUTLS_PKCS_PKCS12_3DES | GNUTLS_PKCS_PKCS12_ARCFOUR | GNUTLS_PKCS_PKCS12_RC2_40 | GNUTLS_PKCS_PBES2_AES_128 | GNUTLS_PKCS_PBES2_AES_192 | GNUTLS_PKCS_PBES2_AES_256 | GNUTLS_PKCS_PBES2_DES) < 0) /* Assumes that key and cert(s) are concatenated in the keyfile and the key is encrypted with one of these algorithms */ + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't read private key PEM file", SOAP_SSL_ERROR); + } + } + if ((soap->ssl_flags & SOAP_SSL_CLIENT)) + { + gnutls_init(&soap->session, GNUTLS_CLIENT); + if (soap->cafile || soap->crlfile || soap->keyfile) + { + ret = gnutls_priority_set_direct(soap->session, "PERFORMANCE", NULL); + if (ret != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, soap_ssl_error(soap, ret, 0), "SSL/TLS set priority error", SOAP_SSL_ERROR); + gnutls_credentials_set(soap->session, GNUTLS_CRD_CERTIFICATE, soap->xcred); + } + else + { + if (!soap->acred) + gnutls_anon_allocate_client_credentials(&soap->acred); + ret = gnutls_priority_set_direct(soap->session, "PERFORMANCE:+ANON-DH:!ARCFOUR-128", NULL); + if (ret != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, soap_ssl_error(soap, ret, 0), "SSL/TLS set priority error", SOAP_SSL_ERROR); + gnutls_credentials_set(soap->session, GNUTLS_CRD_ANON, soap->acred); + } + } + else if (!soap->keyfile) + { + return soap_set_receiver_error(soap, "SSL/TLS error", "No key file: anonymous server authentication not supported in this release", SOAP_SSL_ERROR); + } + else + { +#if GNUTLS_VERSION_NUMBER < 0x030300 + int protocol_priority[] = { 0, 0, 0, 0, 0 }; + int *protocol = protocol_priority; + if ((soap->ssl_flags & SOAP_SSL_RSA) && soap->rsa_params) + gnutls_certificate_set_rsa_export_params(soap->xcred, soap->rsa_params); +#endif + if (!(soap->ssl_flags & SOAP_SSL_RSA) && soap->dh_params) + gnutls_certificate_set_dh_params(soap->xcred, soap->dh_params); + if (!soap->cache) + gnutls_priority_init(&soap->cache, "NORMAL", NULL); + gnutls_init(&soap->session, GNUTLS_SERVER); + gnutls_priority_set(soap->session, soap->cache); + gnutls_credentials_set(soap->session, GNUTLS_CRD_CERTIFICATE, soap->xcred); + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + gnutls_certificate_server_set_request(soap->session, GNUTLS_CERT_REQUEST); + gnutls_session_enable_compatibility_mode(soap->session); + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_TLSv1; +#if GNUTLS_VERSION_NUMBER < 0x030300 + if ((soap->ssl_flags & SOAP_SSLv3)) + *protocol++ = GNUTLS_SSL3; + if ((soap->ssl_flags & SOAP_TLSv1_0)) + *protocol++ = GNUTLS_TLS1_0; + if ((soap->ssl_flags & SOAP_TLSv1_1)) + *protocol++ = GNUTLS_TLS1_1; + if ((soap->ssl_flags & SOAP_TLSv1_2)) + *protocol++ = GNUTLS_TLS1_2; + if (gnutls_protocol_set_priority(soap->session, protocol_priority) != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set protocol", SOAP_SSL_ERROR); +#else + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "NORMAL:+VERS-ALL"); + if (!(soap->ssl_flags & SOAP_TLSv1_0)) + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), ":-VERS-TLS1.0"); + if (!(soap->ssl_flags & SOAP_TLSv1_1)) + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), ":-VERS-TLS1.1"); + if (!(soap->ssl_flags & SOAP_TLSv1_2)) + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), ":-VERS-TLS1.2"); + if (gnutls_priority_set_direct(soap->session, soap->tmpbuf, NULL) != GNUTLS_E_SUCCESS) + return soap_set_receiver_error(soap, "SSL/TLS error", "Can't set protocol priority", SOAP_SSL_ERROR); +#endif + } +#endif +#ifdef WITH_SYSTEMSSL + if (!soap->ctx) + { + int err; + err = gsk_environment_open(&soap->ctx); + if (err == GSK_OK) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV2, GSK_PROTOCOL_SSLV2_OFF); + /* enable all TSLv1 protocols and disable SSLv3 by default if no SSL/TLS flags are set */ + if ((soap->ssl_flags & SOAP_SSLv3_TLSv1) == 0) + soap->ssl_flags |= SOAP_TLSv1; + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_SSLv3)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV3, GSK_PROTOCOL_SSLV3_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_SSLV3, GSK_PROTOCOL_SSLV3_OFF); + } + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_TLSv1_0)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_OFF); + } + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_TLSv1_1)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_1_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_1_OFF); + } + if (err == GSK_OK) + { + if ((soap->ssl_flags & SOAP_TLSv1_2)) + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_2_ON); + else + err = gsk_attribute_set_enum(soap->ctx, GSK_PROTOCOL_TLSV1, GSK_PROTOCOL_TLSV1_2_OFF); + } + if (err == GSK_OK) + err = gsk_attribute_set_buffer(soap->ctx, GSK_KEYRING_FILE, soap->keyfile, 0); /* keyfile is a keyring .kdb file */ + if (err == GSK_OK) + err = gsk_attribute_set_buffer(soap->ctx, GSK_KEYRING_PW, soap->password, 0); /* locked by password */ + if (err == GSK_OK) + err = gsk_environment_init(soap->ctx); + if (err != GSK_OK) + return soap_set_receiver_error(soap, gsk_strerror(err), "SYSTEM SSL error in ssl_auth_init()", SOAP_SSL_ERROR); + } +#endif + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_OPENSSL +static int +ssl_password(char *buf, int num, int rwflag, void *userdata) +{ + (void)rwflag; + if (!buf || !userdata) + return 0; + soap_strcpy(buf, (size_t)num, (char*)userdata); + return (int)strlen(buf); +} +#endif + +/******************************************************************************/ + +#ifdef WITH_OPENSSL +static int +ssl_verify_callback(int ok, X509_STORE_CTX *store) +{ + (void)store; +#ifdef SOAP_DEBUG + if (!ok) + { + char buf[1024]; + int err = X509_STORE_CTX_get_error(store); + X509 *cert = X509_STORE_CTX_get_current_cert(store); + fprintf(stderr, "\nDEBUG mode TLS/SSL warnings:\nSSL verify error %d or warning with certificate at depth %d: %s\n", err, X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(err)); + X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf)-1); + fprintf(stderr, " certificate issuer: %s\n", buf); + X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf)-1); + fprintf(stderr, " certificate subject: %s\n", buf); + /* accept self-signed certificates and certificates out of date */ + switch (err) + { + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + case X509_V_ERR_UNABLE_TO_GET_CRL: + case X509_V_ERR_CRL_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + X509_STORE_CTX_set_error(store, X509_V_OK); + ok = 1; + fprintf(stderr, "Initialize soap_ssl_client_context with SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE to allow this verification error to pass without DEBUG mode enabled\n"); + } + } +#endif + /* Note: return 1 to try to continue, but unsafe progress will be terminated by OpenSSL */ + return ok; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_OPENSSL +static int +ssl_verify_callback_allow_expired_certificate(int ok, X509_STORE_CTX *store) +{ + ok = ssl_verify_callback(ok, store); + if (!ok) + { + /* accept self signed certificates, expired certificates, and certficiates w/o CRL */ + switch (X509_STORE_CTX_get_error(store)) + { + case X509_V_ERR_CERT_NOT_YET_VALID: + case X509_V_ERR_CERT_HAS_EXPIRED: + case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: + case X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: + case X509_V_ERR_UNABLE_TO_GET_CRL: + case X509_V_ERR_CRL_NOT_YET_VALID: + case X509_V_ERR_CRL_HAS_EXPIRED: + X509_STORE_CTX_set_error(store, X509_V_OK); + ok = 1; + } + } + /* Note: return 1 to continue, but unsafe progress will be terminated by SSL */ + return ok; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_GNUTLS +static const char * +ssl_verify(struct soap *soap, const char *host) +{ + unsigned int status; + const char *err = NULL; + int r = gnutls_certificate_verify_peers2(soap->session, &status); + if (r < 0) + err = "Certificate verify error"; + else if ((status & GNUTLS_CERT_INVALID)) + err = "The certificate is not trusted"; + else if ((status & GNUTLS_CERT_SIGNER_NOT_FOUND)) + err = "The certificate hasn't got a known issuer"; + else if ((status & GNUTLS_CERT_REVOKED)) + err = "The certificate has been revoked"; + else if (gnutls_certificate_type_get(soap->session) == GNUTLS_CRT_X509) + { + gnutls_x509_crt_t cert; + const gnutls_datum_t *cert_list; + unsigned int cert_list_size; + if (gnutls_x509_crt_init(&cert) < 0) + err = "Could not get X509 certificates"; + else if ((cert_list = gnutls_certificate_get_peers(soap->session, &cert_list_size)) == NULL) + err = "Could not get X509 certificates"; + else if (gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER) < 0) + err = "Error parsing X509 certificate"; + else if (!(soap->ssl_flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) && gnutls_x509_crt_get_expiration_time(cert) < time(NULL)) + err = "The certificate has expired"; + else if (!(soap->ssl_flags & SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE) && gnutls_x509_crt_get_activation_time(cert) > time(NULL)) + err = "The certificate is not yet activated"; + else if (host && !(soap->ssl_flags & SOAP_SSL_SKIP_HOST_CHECK)) + { + if (!gnutls_x509_crt_check_hostname(cert, host)) + err = "Certificate host name mismatch"; + } + gnutls_x509_crt_deinit(cert); + } + return err; +} +#endif + +/******************************************************************************/ + +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) +#ifndef WITH_NOIO +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ssl_accept(struct soap *soap) +{ + SOAP_SOCKET sk = soap->socket; +#ifdef WITH_OPENSSL + BIO *bio; + int err = SSL_ERROR_NONE; + int retries, r, s; + ERR_clear_error(); + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + return soap_closesock(soap); + if (!soap->ssl) + { + soap->ssl = SSL_new(soap->ctx); + if (!soap->ssl) + { + soap_closesock(soap); + return soap_set_receiver_error(soap, "SSL/TLS error", "SSL_new() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + } + } + else + { + SSL_clear(soap->ssl); + } + bio = BIO_new_socket((int)sk, BIO_NOCLOSE); + SSL_set_bio(soap->ssl, bio, bio); + /* Default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + SOAP_SOCKNONBLOCK(sk) + while ((r = SSL_accept(soap->ssl)) <= 0) + { + err = SSL_get_error(soap->ssl, r); + if (err == SSL_ERROR_WANT_ACCEPT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) + { + if (err == SSL_ERROR_WANT_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno(sk); + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r <= 0) + { + soap_set_receiver_error(soap, soap_ssl_error(soap, r, err), "SSL_accept() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + return soap_closesock(soap); + } + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + { + X509 *peer; + int err; + if ((err = SSL_get_verify_result(soap->ssl)) != X509_V_OK) + { + soap_closesock(soap); + return soap_set_sender_error(soap, X509_verify_cert_error_string(err), "SSL certificate presented by peer cannot be verified in soap_ssl_accept()", SOAP_SSL_ERROR); + } + peer = SSL_get_peer_certificate(soap->ssl); + if (!peer) + { + soap_closesock(soap); + return soap_set_sender_error(soap, "SSL/TLS error", "No SSL certificate was presented by the peer in soap_ssl_accept()", SOAP_SSL_ERROR); + } + X509_free(peer); + } +#endif +#ifdef WITH_GNUTLS + int retries, r, s; + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + return soap_closesock(soap); + gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)sk); + /* default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + SOAP_SOCKNONBLOCK(sk) + while ((r = gnutls_handshake(soap->session))) + { + /* GNUTLS repeat handhake when GNUTLS_E_AGAIN */ + if (r == GNUTLS_E_AGAIN || r == GNUTLS_E_INTERRUPTED) + { + if (!gnutls_record_get_direction(soap->session)) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno(sk); + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r) + { + soap_set_receiver_error(soap, soap_ssl_error(soap, r, 0), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + return soap_closesock(soap); + } + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION)) + { + const char *err = ssl_verify(soap, NULL); + if (err) + { + soap_closesock(soap); + return soap_set_receiver_error(soap, "SSL/TLS error", err, SOAP_SSL_ERROR); + } + } +#endif +#ifdef WITH_SYSTEMSSL + gsk_iocallback local_io = { ssl_recv, ssl_send, NULL, NULL, NULL, NULL }; + int retries, r, s; + if (!soap_valid_socket(sk)) + return soap_set_receiver_error(soap, "SSL/TLS error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR); + soap->ssl_flags &= ~SOAP_SSL_CLIENT; + /* default timeout: 10 sec retries, 100 times 0.1 sec */ + retries = 100; + if (soap->recv_timeout || soap->send_timeout) + { + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + } + SOAP_SOCKNONBLOCK(sk) + r = gsk_secure_socket_open(soap->ctx, &soap->ssl); + if (r == GSK_OK) + r = gsk_attribute_set_numeric_value(soap->ssl, GSK_FD, sk); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_KEYRING_LABEL, soap->cafile, 0); + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_SESSION_TYPE, GSK_SERVER_SESSION); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_V3_CIPHER_SPECS_EXPANDED, "0035002F000A", 0); + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_V3_CIPHERS, GSK_V3_CIPHERS_CHAR4); + if (r == GSK_OK) + r = gsk_attribute_set_callback(soap->ssl, GSK_IO_CALLBACK, &local_io); + if (r != GSK_OK) + return soap_set_receiver_error(soap, gsk_strerror(r), "SYSTEM SSL error in soap_ssl_accept()", SOAP_SSL_ERROR); + while ((r = gsk_secure_socket_init(soap->ssl)) != GSK_OK) + { + if (r == GSK_WOULD_BLOCK_READ || r == GSK_WOULD_BLOCK_WRITE) + { + if (r == GSK_WOULD_BLOCK_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + } + else + { + soap->errnum = soap_socket_errno(sk); + break; + } + if (retries-- <= 0) + break; + } + if (!soap->recv_timeout && !soap->send_timeout) + SOAP_SOCKBLOCK(sk) + if (r != GSK_OK) + { + soap_set_receiver_error(soap, gsk_strerror(r), "gsk_secure_socket_init() failed in soap_ssl_accept()", SOAP_SSL_ERROR); + return soap_closesock(soap); + } +#endif + soap->imode |= SOAP_ENC_SSL; + soap->omode |= SOAP_ENC_SSL; + return SOAP_OK; +} +#endif +#endif + +/******************************************************************************\ + * + * TCP/UDP [SSL/TLS] IPv4 and IPv6 + * +\******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_init(struct soap *soap) +{ + soap->errmode = 1; +#ifdef WIN32 + if (tcp_done) + return 0; + else + { + WSADATA w; + if (WSAStartup(MAKEWORD(1, 1), &w)) + return -1; + tcp_done = 1; + } +#endif + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static const char* +tcp_error(struct soap *soap) +{ + const char *msg = NULL; + switch (soap->errmode) + { + case 0: + msg = soap_strerror(soap); + break; + case 1: + msg = "WSAStartup failed"; + break; + case 2: + { +#ifndef WITH_LEAN + msg = soap_code_str(h_error_codes, soap->errnum); + if (!msg) +#endif + { + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), 37), "TCP/UDP IP error %d", soap->errnum); + msg = soap->msgbuf; + } + } + } + return msg; +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_IPV6) || defined(WITH_COOKIES) +#ifndef WITH_NOIO +static int +tcp_gethostbyname(struct soap *soap, const char *addr, struct hostent *hostent, struct in_addr *inaddr) +{ +#if (defined(_AIX43) || defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R) + struct hostent_data ht_data; +#elif (!defined(__GLIBC__) || !defined(_GNU_SOURCE) || (!_GNU_SOURCE && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + int r; + char *tmpbuf = soap->tmpbuf; + size_t tmplen = sizeof(soap->tmpbuf); +#elif defined(HAVE_GETHOSTBYNAME_R) + char *tmpbuf = soap->tmpbuf; + size_t tmplen = sizeof(soap->tmpbuf); +#endif +#ifdef VXWORKS + int hostint; /* vxWorks compatible */ +#endif + if (inaddr) + { + soap_int32 iadd = -1; +#ifdef AS400 + iadd = inet_addr((void*)addr); +#else + iadd = inet_addr((char*)addr); +#endif + if (iadd != -1) + { + if (soap_memcpy((void*)inaddr, sizeof(struct in_addr), (const void*)&iadd, sizeof(iadd))) + return soap->error = SOAP_EOM; + return SOAP_OK; + } + } +#if (defined(_AIX43) || defined(TRU64) || defined(HP_UX)) && defined(HAVE_GETHOSTBYNAME_R) + memset((void*)&ht_data, 0, sizeof(ht_data)); + if (gethostbyname_r(addr, hostent, &ht_data) < 0) + { + hostent = NULL; + soap->errnum = h_errno; + } +#elif (!defined(__GLIBC__) || !defined(_GNU_SOURCE) || (!_GNU_SOURCE && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + while ((r = gethostbyname_r(addr, hostent, tmpbuf, tmplen, &hostent, &soap->errnum)) < 0) + { + if (tmpbuf != soap->tmpbuf) + SOAP_FREE(soap, tmpbuf); + if (r != SOAP_ERANGE) + { + hostent = NULL; + break; + } + tmplen *= 2; + tmpbuf = (char*)SOAP_MALLOC(soap, tmplen); + if (!tmpbuf) + break; + } +#elif defined(HAVE_GETHOSTBYNAME_R) + hostent = gethostbyname_r(addr, hostent, tmpbuf, tmplen, &soap->errnum); +#elif defined(VXWORKS) + /* vxWorks compatible */ + /* If the DNS resolver library resolvLib has been configured in the vxWorks + * image, a query for the host IP address is sent to the DNS server, if the + * name was not found in the local host table. */ + hostint = hostGetByName((char*)addr); + if (hostint == ERROR) + { + hostent = NULL; + soap->errnum = soap_errno; + } +#else +#ifdef AS400 + hostent = gethostbyname((void*)addr); +#else + hostent = gethostbyname((char*)addr); +#endif + if (!hostent) + soap->errnum = h_errno; +#endif + if (!hostent) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Host name not found\n")); + return SOAP_ERR; + } + if (inaddr) + { +#ifdef VXWORKS + inaddr->s_addr = hostint; /* vxWorks compatible */ +#else + if (soap_memcpy((void*)inaddr, sizeof(struct in_addr), (const void*)hostent->h_addr, (size_t)hostent->h_length)) + { +#if (!defined(__GLIBC__) || !defined(_GNU_SOURCE) || (!_GNU_SOURCE && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + if (tmpbuf && tmpbuf != soap->tmpbuf) + SOAP_FREE(soap, tmpbuf); +#endif + return soap->error = SOAP_EOM; + } +#endif + } +#if (!defined(__GLIBC__) || !defined(_GNU_SOURCE) || (!_GNU_SOURCE && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__ANDROID__) || defined(FREEBSD) || defined(__FreeBSD__)) && defined(HAVE_GETHOSTBYNAME_R) + if (tmpbuf && tmpbuf != soap->tmpbuf) + SOAP_FREE(soap, tmpbuf); +#endif + return SOAP_OK; +} +#endif +#endif + +/******************************************************************************/ + +#if !defined(WITH_IPV6) +#ifndef WITH_NOIO +static int +tcp_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr) +{ + struct hostent hostent; + return tcp_gethostbyname(soap, addr, &hostent, inaddr); +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static SOAP_SOCKET +tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port) +{ +#ifdef WITH_IPV6 + struct addrinfo hints, *res, *ressave; +#endif + SOAP_SOCKET sk; + int err = 0; +#ifndef WITH_LEAN + int set = 1; +#endif +#if !defined(WITH_LEAN) || defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL) + int retries; +#endif + soap->errnum = 0; + soap->errmode = 0; + if (soap_valid_socket(soap->socket)) + { + if ((soap->omode & SOAP_IO_UDP) && soap->socket == soap->master) + { +#ifdef IP_MULTICAST_TTL +#ifndef WITH_IPV6 + soap->errmode = 2; + if (soap->fresolve(soap, host, &soap->peer.in.sin_addr)) + { + soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peer.in.sin_port = htons((short)port); + soap->errmode = 0; +#else + if (getaddrinfo(host, soap_int2s(soap, port), &hints, &res) || !res) + { + soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)res->ai_addr, res->ai_addrlen)) + { + soap->error = SOAP_EOM; + soap->fclosesocket(soap, soap->socket); + freeaddrinfo(res); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peerlen = res->ai_addrlen; + freeaddrinfo(res); +#endif + if (soap->ipv4_multicast_ttl) + { + unsigned char ttl = soap->ipv4_multicast_ttl; + if (setsockopt(soap->socket, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + if (soap->ipv4_multicast_if && !soap->ipv6_multicast_if) + { + if (setsockopt(soap->socket, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr))) +#ifndef WINDOWS + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } +#else +#ifndef IP_MULTICAST_IF +#define IP_MULTICAST_IF 2 +#endif + if (setsockopt(soap->socket, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, soap->socket); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + } +#endif + return soap->socket; + } + soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + if (tcp_init(soap)) + { + soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in tcp_connect()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + soap->errmode = 0; +#ifdef WITH_IPV6 + memset((void*)&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + hints.ai_socktype = SOCK_DGRAM; + else +#endif + hints.ai_socktype = SOCK_STREAM; + soap->errmode = 2; + if (soap->proxy_host) + err = getaddrinfo(soap->proxy_host, soap_int2s(soap, soap->proxy_port), &hints, &res); + else + err = getaddrinfo(host, soap_int2s(soap, port), &hints, &res); + if (err || !res) + { + soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in tcp_connect()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + ressave = res; +again: + sk = soap->socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + soap->error = SOAP_OK; + soap->errmode = 0; +#else +#ifndef WITH_LEAN +again: +#endif +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + sk = soap->socket = socket(AF_INET, SOCK_DGRAM, 0); + else +#endif + sk = soap->socket = socket(AF_INET, SOCK_STREAM, 0); +#endif + if (!soap_valid_socket(sk)) + { +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } +#endif + soap->errnum = soap_socket_errno(sk); + soap_set_receiver_error(soap, tcp_error(soap), "socket failed in tcp_connect()", SOAP_TCP_ERROR); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + return SOAP_INVALID_SOCKET; + } +#ifdef WITH_SOCKET_CLOSE_ON_EXIT +#ifdef WIN32 +#ifndef UNDER_CE + SetHandleInformation((HANDLE)sk, HANDLE_FLAG_INHERIT, 0); +#endif +#else + fcntl(sk, F_SETFD, 1); +#endif +#endif +#ifndef WITH_LEAN + if ((soap->connect_flags & SO_LINGER)) + { + struct linger linger; + memset((void*)&linger, 0, sizeof(linger)); + linger.l_onoff = 1; + linger.l_linger = soap->linger_time; + if (setsockopt(sk, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger))) + { + soap->errnum = soap_socket_errno(sk); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } + } + if ((soap->connect_flags & ~SO_LINGER) && setsockopt(sk, SOL_SOCKET, soap->connect_flags & ~SO_LINGER, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#ifndef UNDER_CE + if ((soap->keep_alive || soap->tcp_keep_alive) && setsockopt(sk, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap->sndbuf > 0 && setsockopt(sk, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap->rcvbuf > 0 && setsockopt(sk, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#ifdef TCP_KEEPIDLE + if (soap->tcp_keep_idle && setsockopt(sk, IPPROTO_TCP, TCP_KEEPIDLE, (char*)&(soap->tcp_keep_idle), sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPIDLE failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_KEEPINTVL + if (soap->tcp_keep_intvl && setsockopt(sk, IPPROTO_TCP, TCP_KEEPINTVL, (char*)&(soap->tcp_keep_intvl), sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPINTVL failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_KEEPCNT + if (soap->tcp_keep_cnt && setsockopt(sk, IPPROTO_TCP, TCP_KEEPCNT, (char*)&(soap->tcp_keep_cnt), sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_KEEPCNT failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_NODELAY + if (!(soap->omode & SOAP_IO_UDP) && setsockopt(sk, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef WITH_IPV6 + if ((soap->omode & SOAP_IO_UDP) && soap->ipv6_multicast_if) + { + struct sockaddr_in6 *in6addr = (struct sockaddr_in6*)res->ai_addr; + in6addr->sin6_scope_id = soap->ipv6_multicast_if; + } +#endif +#endif +#ifdef IP_MULTICAST_TTL + if ((soap->omode & SOAP_IO_UDP)) + { + if (soap->ipv4_multicast_ttl) + { + unsigned char ttl = soap->ipv4_multicast_ttl; + if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&ttl, sizeof(ttl))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_TTL failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + if ((soap->omode & SOAP_IO_UDP) && soap->ipv4_multicast_if && !soap->ipv6_multicast_if) + { + if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr))) +#ifndef WINDOWS + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#else +#ifndef IP_MULTICAST_IF +#define IP_MULTICAST_IF 2 +#endif + if (setsockopt(sk, IPPROTO_IP, IP_MULTICAST_IF, (char*)soap->ipv4_multicast_if, sizeof(struct in_addr))) + { + soap->errnum = soap_socket_errno(sk); +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IP_MULTICAST_IF failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + } + } +#endif +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Opening socket=%d to host='%s' port=%d\n", (int)sk, host, port)); +#ifndef WITH_IPV6 + soap->peerlen = sizeof(soap->peer.in); + memset((void*)&soap->peer.in, 0, sizeof(soap->peer.in)); + soap->peer.in.sin_family = AF_INET; +#ifndef WIN32 + if (soap->client_addr) + { + struct sockaddr_in addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + if (soap->client_port >= 0) + addr.sin_port = htons(soap->client_port); + if (inet_pton(AF_INET, soap->client_addr, (void*)&addr.sin_addr) != 1 || bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno(sk); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_addr = NULL; + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_addr = NULL; /* disable bind before connect, so need to set it again before the next connect */ + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } + else +#endif + if (soap->client_port >= 0) + { + struct sockaddr_in addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(soap->client_port); + if (bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno(sk); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } +#ifndef WIN32 + if (soap->client_interface) + { + if (inet_pton(AF_INET, soap->client_interface, &soap->peer.in.sin_addr) != 1) + { + soap->errnum = soap_socket_errno(sk); + soap_set_receiver_error(soap, tcp_error(soap), "inet_pton() failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_interface = NULL; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_interface = NULL; /* disable client interface, so need to set it again before the next connect */ + } +#endif + soap->errmode = 2; + if (soap->proxy_host) + { + if (soap->fresolve(soap, soap->proxy_host, &soap->peer.in.sin_addr)) + { + soap_set_receiver_error(soap, tcp_error(soap), "get proxy host by name failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peer.in.sin_port = htons((short)soap->proxy_port); + } + else + { + if (soap->fresolve(soap, host, &soap->peer.in.sin_addr)) + { + soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->peer.in.sin_port = htons((short)port); + } + soap->errmode = 0; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + return sk; +#endif +#else +#ifndef WIN32 + if (soap->client_addr) + { + struct sockaddr_in6 addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + if ((soap->client_addr_ipv6 && res->ai_family == AF_INET6 && inet_pton(AF_INET6, soap->client_addr_ipv6, (void*)&addr.sin6_addr.s6_addr) == 1) + || (!soap->client_addr_ipv6 && inet_pton(AF_INET6, soap->client_addr, (void*)&addr.sin6_addr.s6_addr) == 1) + ) + { + if (soap->client_port >= 0) + addr.sin6_port = htons(soap->client_port); + if (bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno(sk); + freeaddrinfo(ressave); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_addr = NULL; + soap->client_addr_ipv6 = NULL; + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else /* not an IPv6 address, must be IPv4 */ + { + struct sockaddr_in addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + if (soap->client_port >= 0) + addr.sin_port = htons(soap->client_port); + if (inet_pton(AF_INET, soap->client_addr, (void*)&addr.sin_addr) != 1 || bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno(sk); + freeaddrinfo(ressave); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_addr = NULL; + soap->client_addr_ipv6 = NULL; + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + soap->client_addr = NULL; /* disable bind before connect, so need to set it again before the next connect */ + soap->client_addr_ipv6 = NULL; /* disable bind before connect, so need to set it again before the next connect */ + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } + else +#endif + if (soap->client_port >= 0) + { + struct sockaddr_in6 addr; + memset((void*)&addr, 0, sizeof(addr)); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(soap->client_port); + if (bind(sk, (struct sockaddr*)&addr, sizeof(addr))) + { + soap->errnum = soap_socket_errno(sk); + freeaddrinfo(ressave); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind before connect\n")); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_port = -1; + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->client_port = -1; /* disable bind before connect, so need to set it again before the next connect */ + } +#ifndef WIN32 + if (soap->client_interface) + { + if (inet_pton(AF_INET6, soap->client_interface, res->ai_addr) != 1) + { + if (inet_pton(AF_INET, soap->client_interface, res->ai_addr) != 1) + { + soap->errnum = soap_socket_errno(sk); + freeaddrinfo(ressave); + soap_set_receiver_error(soap, tcp_error(soap), "inet_pton() failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + soap->client_interface = NULL; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + soap->client_interface = NULL; /* disable client interface, so need to set it again before the next connect */ + } +#endif +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + { + if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)res->ai_addr, res->ai_addrlen)) + { + soap->error = SOAP_EOM; + soap->fclosesocket(soap, sk); + soap->socket = sk = SOAP_INVALID_SOCKET; + } + soap->peerlen = res->ai_addrlen; + freeaddrinfo(ressave); + return sk; + } +#endif +#endif +#ifndef WITH_LEAN + if (soap->connect_timeout) + SOAP_SOCKNONBLOCK(sk) + else + SOAP_SOCKBLOCK(sk) + retries = 10; +#endif + for (;;) + { +#ifdef WITH_IPV6 + if (connect(sk, res->ai_addr, (int)res->ai_addrlen)) +#else + if (connect(sk, &soap->peer.addr, sizeof(soap->peer.in))) +#endif + { + err = soap_socket_errno(sk); +#ifdef WITH_IPV6 + if (err == SOAP_ECONNREFUSED && res->ai_next) + { + soap->fclosesocket(soap, sk); + res = res->ai_next; + goto again; + } +#endif +#ifndef WITH_LEAN + if (err == SOAP_EADDRINUSE) + { + soap->fclosesocket(soap, sk); + if (retries-- > 0) + goto again; + } + else if (soap->connect_timeout && (err == SOAP_EINPROGRESS || err == SOAP_EAGAIN || err == SOAP_EWOULDBLOCK)) + { + SOAP_SOCKLEN_T k; + for (;;) + { + int r; +#ifdef WITH_SELF_PIPE + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_PIP, soap->connect_timeout); + if ((r & SOAP_TCP_SELECT_PIP)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection closed by self pipe\n")); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#else + r = tcp_select(soap, sk, SOAP_TCP_SELECT_SND, soap->connect_timeout); +#endif + if (r > 0) + break; + if (!r) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect timeout\n")); + soap_set_receiver_error(soap, "Timeout", "connect failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } + r = soap->errnum = soap_socket_errno(sk); + if (r != SOAP_EINTR) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n")); + soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } + } + k = (SOAP_SOCKLEN_T)sizeof(soap->errnum); + if (!getsockopt(sk, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &k) && !soap->errnum) /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */ + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n")); + if (!soap->errnum) + soap->errnum = soap_socket_errno(sk); + soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + goto again; + } + freeaddrinfo(ressave); +#endif + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif +#ifdef WITH_IPV6 + if (res->ai_next) + { + res = res->ai_next; + soap->fclosesocket(soap, sk); + goto again; + } +#endif + if (err && err != SOAP_EINTR) + { + soap->errnum = err; +#ifdef WITH_IPV6 + freeaddrinfo(ressave); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n")); + soap_set_receiver_error(soap, tcp_error(soap), "connect failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + break; + } + } +#ifdef WITH_IPV6 + soap->peerlen = 0; /* IPv6: already connected so use send() */ + freeaddrinfo(ressave); +#endif + soap->imode &= ~SOAP_ENC_SSL; + soap->omode &= ~SOAP_ENC_SSL; + if (endpoint && !soap_tag_cmp(endpoint, "https:*")) + { +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) || defined(WITH_SYSTEMSSL) +#ifdef WITH_OPENSSL + BIO *bio; +#endif +#ifdef WITH_SYSTEMSSL + gsk_iocallback local_io = { ssl_recv, ssl_send, NULL, NULL, NULL, NULL }; +#endif + int r; + if (soap->proxy_host) + { + soap_mode m = soap->mode; /* preserve settings */ + soap_mode om = soap->omode; /* make sure we only parse HTTP */ + ULONG64 n = soap->count; /* save the content length */ + const char *userid, *passwd; + int status = soap->status; /* save the current status/command */ + int keep_alive = soap->keep_alive; /* save the KA status */ + soap->omode &= ~SOAP_ENC; /* mask IO and ENC */ + soap->omode |= SOAP_IO_BUFFER; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connecting to %s proxy server %s for destination endpoint %s\n", soap->proxy_http_version, soap->proxy_host, endpoint)); +#ifdef WITH_NTLM + if (soap->ntlm_challenge && soap_ntlm_handshake(soap, SOAP_CONNECT, endpoint, host, port)) + { + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + if (soap_init_send(soap)) + { + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->status = SOAP_CONNECT; + if (!soap->keep_alive) + soap->keep_alive = -1; /* must keep alive */ + soap->error = soap->fpost(soap, endpoint, host, port, NULL, NULL, 0); + if (soap->error + || soap_end_send_flush(soap)) + { + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->keep_alive = keep_alive; + soap->omode = om; + om = soap->imode; + soap->imode &= ~SOAP_ENC; /* mask IO and ENC */ + userid = soap->userid; /* preserve */ + passwd = soap->passwd; /* preserve */ + soap->error = soap->fparse(soap); + if (soap->error) + { + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + soap->status = status; /* restore */ + soap->userid = userid; /* restore */ + soap->passwd = passwd; /* restore */ + soap->imode = om; /* restore */ + soap->count = n; /* restore */ + if (soap_init_send(soap)) + { + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (endpoint) + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), endpoint); /* restore */ + soap->mode = m; + } +#ifdef WITH_OPENSSL + ERR_clear_error(); + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n")); + soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } + if (!soap->ssl) + { + soap->ssl = SSL_new(soap->ctx); + if (!soap->ssl) + { + soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + SSL_clear(soap->ssl); + } + if (soap->session) + { + if (!strcmp(soap->session_host, host) && soap->session_port == port) + SSL_set_session(soap->ssl, soap->session); + SSL_SESSION_free(soap->session); + soap->session = NULL; + } +#if OPENSSL_VERSION_NUMBER >= 0x1000000aL + if (!(soap->ssl_flags & SOAP_SSLv3) && !SSL_set_tlsext_host_name(soap->ssl, host)) + { + soap_set_receiver_error(soap, "SSL/TLS error", "SNI failed", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#elif (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && defined(SSL_CTRL_SET_TLSEXT_HOSTNAME) + if (!SSL_ctrl(soap->ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, (void*)host)) + { + soap_set_receiver_error(soap, "SSL/TLS error", "SNI failed", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + bio = BIO_new_socket((int)sk, BIO_NOCLOSE); + SSL_set_bio(soap->ssl, bio, bio); + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + err = SSL_ERROR_NONE; + /* Try connecting until success or timeout */ + do + { + if ((r = SSL_connect(soap->ssl)) <= 0) + { + err = SSL_get_error(soap->ssl, r); + if (err == SSL_ERROR_WANT_CONNECT || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) + { + int s; + if (err == SSL_ERROR_WANT_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + soap_set_receiver_error(soap, "Timeout", "SSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno(sk); + break; + } + } + } while (!SSL_is_init_finished(soap->ssl)); + if (r <= 0) + { + soap_set_sender_error(soap, soap_ssl_error(soap, r, err), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + /* Check server credentials when required */ + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION)) + { + if ((err = SSL_get_verify_result(soap->ssl)) != X509_V_OK) + { + soap_set_sender_error(soap, X509_verify_cert_error_string(err), "SSL/TLS certificate presented by peer cannot be verified in tcp_connect()", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if (!(soap->ssl_flags & SOAP_SSL_SKIP_HOST_CHECK)) + { + X509_NAME *subj; + STACK_OF(CONF_VALUE) *val = NULL; +#if OPENSSL_VERSION_NUMBER >= 0x0090800fL + GENERAL_NAMES *names = NULL; +#else + int ext_count; +#endif + int ok = 0; + X509 *peer = SSL_get_peer_certificate(soap->ssl); + if (!peer) + { + soap_set_sender_error(soap, "SSL/TLS error", "No SSL/TLS certificate was presented by the peer in tcp_connect()", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#if OPENSSL_VERSION_NUMBER < 0x0090800fL + ext_count = X509_get_ext_count(peer); + if (ext_count > 0) + { + int i; + for (i = 0; i < ext_count; i++) + { + X509_EXTENSION *ext = X509_get_ext(peer, i); + const char *ext_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext))); + if (ext_str && !strcmp(ext_str, "subjectAltName")) + { + X509V3_EXT_METHOD *meth = (X509V3_EXT_METHOD*)X509V3_EXT_get(ext); + unsigned char *data; + if (!meth) + break; + data = ext->value->data; + if (data) + { +#if OPENSSL_VERSION_NUMBER > 0x00907000L + void *ext_data; + if (meth->it) + ext_data = ASN1_item_d2i(NULL, &data, ext->value->length, ASN1_ITEM_ptr(meth->it)); + else + { +#if OPENSSL_VERSION_NUMBER > 0x0090800fL + ext_data = meth->d2i(NULL, (const unsigned char **)&data, ext->value->length); +#else + ext_data = meth->d2i(NULL, &data, ext->value->length); +#endif + } + if (ext_data) + val = meth->i2v(meth, ext_data, NULL); + else + val = NULL; + if (meth->it) + ASN1_item_free((ASN1_VALUE*)ext_data, ASN1_ITEM_ptr(meth->it)); + else + meth->ext_free(ext_data); +#else + void *ext_data = meth->d2i(NULL, &data, ext->value->length); + if (ext_data) + val = meth->i2v(meth, ext_data, NULL); + meth->ext_free(ext_data); +#endif + if (val) + { + int j; + for (j = 0; j < sk_CONF_VALUE_num(val); j++) + { + CONF_VALUE *nval = sk_CONF_VALUE_value(val, j); + if (nval && (!strcmp(nval->name, "DNS") || !strcmp(nval->name, "IP Address")) && !soap_tag_cmp(host, nval->value)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate %s %s\n", host, nval->name, nval->value)); + break; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s mismatch with certificate %s %s\n", host, nval->name, nval->value)); + } + } + sk_CONF_VALUE_pop_free(val, X509V3_conf_free); + } + } + } + if (ok) + break; + } + } +#else + names = (GENERAL_NAMES*)X509_get_ext_d2i(peer, NID_subject_alt_name, NULL, NULL); + if (names) + { + val = i2v_GENERAL_NAMES(NULL, names, val); + sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); + } + if (val) + { + int j; + for (j = 0; j < sk_CONF_VALUE_num(val); j++) + { + CONF_VALUE *nval = sk_CONF_VALUE_value(val, j); + if (nval && (!strcmp(nval->name, "DNS") || !strcmp(nval->name, "IP Address")) && !soap_tag_cmp(host, nval->value)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate %s %s\n", host, nval->name, nval->value)); + break; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s mismatch with certificate %s %s\n", host, nval->name, nval->value)); + } + } + sk_CONF_VALUE_pop_free(val, X509V3_conf_free); + } +#endif + if (!ok && (subj = X509_get_subject_name(peer)) != 0) + { + int i = -1; + do + { + ASN1_STRING *name; + i = X509_NAME_get_index_by_NID(subj, NID_commonName, i); + if (i == -1) + break; + name = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subj, i)); + if (name) + { +#if OPENSSL_VERSION_NUMBER < 0x10100000L + const char *tmp = (const char*)ASN1_STRING_data(name); +#else + const char *tmp = (const char*)ASN1_STRING_get0_data(name); +#endif + if (!soap_tag_cmp(host, tmp)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp)); + } + else + { + unsigned char *tmp = NULL; + ASN1_STRING_to_UTF8(&tmp, name); + if (tmp) + { + if (!soap_tag_cmp(host, (const char*)tmp)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp)); + } + else if (tmp[0] == '*') /* wildcard domain */ + { + const char *t = strchr(host, '.'); + if (t && !soap_tag_cmp(t, (const char*)tmp + 1)) + { + ok = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s match with certificate subject %s\n", host, tmp)); + } + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL: host name %s mismatch with certificate %s\n", host, tmp)); + } + OPENSSL_free(tmp); + } + } + } + } while (!ok); + } + X509_free(peer); + if (!ok) + { + soap_set_sender_error(soap, "SSL/TLS error", "SSL/TLS certificate host name mismatch in tcp_connect()", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + } +#endif +#ifdef WITH_GNUTLS + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->session && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + gnutls_transport_set_ptr(soap->session, (gnutls_transport_ptr_t)(long)sk); + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + /* Try connecting until success or timeout */ + while ((r = gnutls_handshake(soap->session))) + { + /* GNUTLS repeat handhake when GNUTLS_E_AGAIN */ + if (r == GNUTLS_E_AGAIN || r == GNUTLS_E_INTERRUPTED) + { + int s; + if (!gnutls_record_get_direction(soap->session)) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + soap_set_receiver_error(soap, "Timeout", "SSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno(sk); + break; + } + } + if (r) + { + soap_set_sender_error(soap, soap_ssl_error(soap, r, 0), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + if ((soap->ssl_flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION)) + { + const char *s = ssl_verify(soap, host); + if (s) + { + soap->fclosesocket(soap, sk); + soap->error = soap_set_sender_error(soap, "SSL/TLS verify error", s, SOAP_SSL_ERROR); + return soap->socket = SOAP_INVALID_SOCKET; + } + } +#endif +#ifdef WITH_SYSTEMSSL + soap->ssl_flags |= SOAP_SSL_CLIENT; + if (!soap->ctx && (soap->error = soap->fsslauth(soap)) != SOAP_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL required, but no ctx set\n")); + soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; + } + if (soap->connect_timeout || soap->recv_timeout || soap->send_timeout) + { + /* Set SSL connect timeout and set SSL sockets to non-blocking */ + int t = soap->recv_timeout > soap->send_timeout ? soap->recv_timeout : soap->send_timeout; + if (soap->connect_timeout > 0 && t < soap->connect_timeout) + t = soap->connect_timeout; + if (t > 0) + retries = 10 * t; + else if (t > -100000) + retries = 1; + else + retries = t/-100000; + SOAP_SOCKNONBLOCK(sk) + } + else + { + /* Set sockets to blocking */ + retries = 1; + SOAP_SOCKBLOCK(sk) + } + r = gsk_secure_socket_open(soap->ctx, &soap->ssl); + if (r == GSK_OK) + r = gsk_attribute_set_numeric_value(soap->ssl, GSK_FD, sk); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_KEYRING_LABEL, soap->cafile, 0); /* Certificate label */ + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_SESSION_TYPE, GSK_CLIENT_SESSION); + if (r == GSK_OK) + r = gsk_attribute_set_buffer(soap->ssl, GSK_V3_CIPHER_SPECS_EXPANDED, "0035002F000A", 0); + if (r == GSK_OK) + r = gsk_attribute_set_enum(soap->ssl, GSK_V3_CIPHERS, GSK_V3_CIPHERS_CHAR4); + if (r == GSK_OK) + r = gsk_attribute_set_callback(soap->ssl, GSK_IO_CALLBACK, &local_io); + if (r != GSK_OK) + { + soap_set_receiver_error(soap, gsk_strerror(r), "SYSTEM SSL error in tcp_connect()", SOAP_SSL_ERROR); + return soap->socket = SOAP_INVALID_SOCKET; + } + /* Try connecting until success or timeout */ + while ((r = gsk_secure_socket_init(soap->ssl)) != GSK_OK) + { + if (r == GSK_WOULD_BLOCK_READ || r == GSK_WOULD_BLOCK_WRITE) + { + int s; + if (r == GSK_WOULD_BLOCK_READ) + s = tcp_select(soap, sk, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, -100000); + else + s = tcp_select(soap, sk, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, -100000); + if (s < 0) + break; + if (s == 0 && retries-- <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL/TLS connect timeout\n")); + soap_set_receiver_error(soap, "Timeout", "SSL_connect() failed in tcp_connect()", SOAP_TCP_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } + } + else + { + soap->errnum = soap_socket_errno(sk); + break; + } + } + if (r != GSK_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "SSL_connect/select error in tcp_connect\n")); + soap_set_receiver_error(soap, gsk_strerror(r), "SSL/TLS handshake failed", SOAP_SSL_ERROR); + soap->fclosesocket(soap, sk); + return soap->socket = SOAP_INVALID_SOCKET; + } +#endif + soap->imode |= SOAP_ENC_SSL; + soap->omode |= SOAP_ENC_SSL; +#else + soap->fclosesocket(soap, sk); + soap->error = SOAP_SSL_ERROR; + return soap->socket = SOAP_INVALID_SOCKET; +#endif + } + if (soap->recv_timeout || soap->send_timeout) + SOAP_SOCKNONBLOCK(sk) + else + SOAP_SOCKBLOCK(sk) + return sk; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_select(struct soap *soap, SOAP_SOCKET sk, int flags, int timeout) +{ + int r; + struct timeval tv; + fd_set fd[3], *rfd, *sfd, *efd; + int retries = 0; + int eintr = SOAP_MAXEINTR; + soap->errnum = 0; + if (!soap_valid_socket(sk)) + { + soap->error = SOAP_EOF; + return -1; + } +#ifndef WIN32 +#if !defined(FD_SETSIZE) || defined(__QNX__) || defined(QNX) + /* no FD_SETSIZE or select() is not MT safe on some QNX: always poll */ + if (1) +#else + /* if fd max set size exceeded, use poll() when available */ + if ((int)sk >= (int)FD_SETSIZE) +#endif +#ifdef HAVE_POLL + { +#ifdef WITH_SELF_PIPE + struct pollfd pollfd[2]; + pollfd[1].fd = soap->pipe_fd[0]; + pollfd[1].events = POLLIN; +#else + struct pollfd pollfd[1]; +#endif + pollfd[0].fd = (int)sk; + pollfd[0].events = 0; + if ((flags & SOAP_TCP_SELECT_RCV)) + pollfd[0].events |= POLLIN; + if ((flags & SOAP_TCP_SELECT_SND)) + pollfd[0].events |= POLLOUT; + if ((flags & SOAP_TCP_SELECT_ERR)) + pollfd[0].events |= POLLERR; + if (timeout <= 0) + timeout /= -1000; /* -usec -> ms */ + else + { + retries = timeout - 1; + timeout = 1000; + } + do + { +#ifdef WITH_SELF_PIPE + r = poll(pollfd, 2, timeout); +#else + r = poll(pollfd, 1, timeout); +#endif + if (r < 0 && (soap->errnum = soap_socket_errno(sk)) == SOAP_EINTR && eintr > 0) + { + eintr--; + r = 0; + } + else if (retries-- <= 0) + { + break; + } + } while (r == 0); + if (r > 0) + { + r = 0; + if ((flags & SOAP_TCP_SELECT_RCV) && (pollfd[0].revents & POLLIN)) + r |= SOAP_TCP_SELECT_RCV; + if ((flags & SOAP_TCP_SELECT_SND) && (pollfd[0].revents & POLLOUT)) + r |= SOAP_TCP_SELECT_SND; + if ((flags & SOAP_TCP_SELECT_ERR) && (pollfd[0].revents & POLLERR)) + r |= SOAP_TCP_SELECT_ERR; +#ifdef WITH_SELF_PIPE + if ((flags & SOAP_TCP_SELECT_PIP) && (pollfd[1].revents & POLLIN)) + { + char ch; + for (;;) + { + if (read(soap->pipe_fd[0], &ch, 1) == -1) + { + if (soap_socket_errno(soap->pipe_fd[0]) == SOAP_EAGAIN) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Self pipe read error\n")); + return -1; + } + } + r |= SOAP_TCP_SELECT_PIP; + } +#endif + } + else if (r == 0) + { + soap->errnum = 0; + } + return r; + } +#else + { + soap->error = SOAP_FD_EXCEEDED; + return -1; + } +#endif +#endif + if (timeout > 0) + retries = timeout - 1; + do + { + rfd = sfd = efd = NULL; +#ifdef WITH_SELF_PIPE + if ((flags & SOAP_TCP_SELECT_PIP) || (flags & SOAP_TCP_SELECT_RCV)) + { + rfd = &fd[0]; + FD_ZERO(rfd); + if ((flags & SOAP_TCP_SELECT_PIP)) + FD_SET(soap->pipe_fd[0], rfd); + if ((flags & SOAP_TCP_SELECT_RCV)) + FD_SET(sk, rfd); + } +#else + if ((flags & SOAP_TCP_SELECT_RCV)) + { + rfd = &fd[0]; + FD_ZERO(rfd); + FD_SET(sk, rfd); + } +#endif + if ((flags & SOAP_TCP_SELECT_SND)) + { + sfd = &fd[1]; + FD_ZERO(sfd); + FD_SET(sk, sfd); + } + if ((flags & SOAP_TCP_SELECT_ERR)) + { + efd = &fd[2]; + FD_ZERO(efd); + FD_SET(sk, efd); + } + if (timeout <= 0) + { + tv.tv_sec = -timeout / 1000000; + tv.tv_usec = -timeout % 1000000; + } + else + { + tv.tv_sec = 1; + tv.tv_usec = 0; + } +#ifdef WITH_SELF_PIPE + r = select((int)(sk > soap->pipe_fd[0] ? sk : soap->pipe_fd[0]) + 1, rfd, sfd, efd, &tv); +#else + r = select((int)sk + 1, rfd, sfd, efd, &tv); +#endif + if (r < 0 && (soap->errnum = soap_socket_errno(sk)) == SOAP_EINTR && eintr > 0) + { + eintr--; + r = 0; + } + else if (retries-- <= 0) + { + break; + } + } while (r == 0); + if (r > 0) + { + r = 0; + if ((flags & SOAP_TCP_SELECT_RCV) && FD_ISSET(sk, rfd)) + r |= SOAP_TCP_SELECT_RCV; + if ((flags & SOAP_TCP_SELECT_SND) && FD_ISSET(sk, sfd)) + r |= SOAP_TCP_SELECT_SND; + if ((flags & SOAP_TCP_SELECT_ERR) && FD_ISSET(sk, efd)) + r |= SOAP_TCP_SELECT_ERR; +#ifdef WITH_SELF_PIPE + if ((flags & SOAP_TCP_SELECT_PIP) && FD_ISSET(soap->pipe_fd[0], rfd)) + { + char ch; + for (;;) + { + if (read(soap->pipe_fd[0], &ch, 1) == -1) + { + if (soap_socket_errno(soap->pipe_fd[0]) == SOAP_EAGAIN) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Self pipe read error\n")); + return -1; + } + } + r |= SOAP_TCP_SELECT_PIP; + } +#endif + } + else if (r == 0) + { + soap->errnum = 0; + } + return r; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static SOAP_SOCKET +tcp_accept(struct soap *soap, SOAP_SOCKET sk, struct sockaddr *addr, int *len) +{ + SOAP_SOCKET s; + (void)soap; + s = accept(sk, addr, (SOAP_SOCKLEN_T*)len); /* portability note: see SOAP_SOCKLEN_T definition in stdsoap2.h */ +#ifdef WITH_SOCKET_CLOSE_ON_EXIT +#ifdef WIN32 +#ifndef UNDER_CE + SetHandleInformation((HANDLE)s, HANDLE_FLAG_INHERIT, 0); +#endif +#else + fcntl(s, F_SETFD, FD_CLOEXEC); +#endif +#endif + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_disconnect(struct soap *soap) +{ +#ifdef WITH_OPENSSL + if (soap->ssl) + { + int r; + if (soap->session) + { + SSL_SESSION_free(soap->session); + soap->session = NULL; + } + if (*soap->host) + { + soap->session = SSL_get1_session(soap->ssl); + if (soap->session) + { + soap_strcpy(soap->session_host, sizeof(soap->session_host), soap->host); + soap->session_port = soap->port; + } + } + r = SSL_shutdown(soap->ssl); + /* SSL shutdown does not work when reads are pending, non-blocking */ + if (r == 0) + { + while (SSL_want_read(soap->ssl)) + { + if (SSL_read(soap->ssl, NULL, 0) + || soap_socket_errno(soap->socket) != SOAP_EAGAIN) + { + r = SSL_shutdown(soap->ssl); + break; + } + } + } + if (r == 0) + { + if (soap_valid_socket(soap->socket)) + { + if (!soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR)) + { +#if !defined(WITH_LEAN) && !defined(WIN32) + /* + wait up to 5 seconds for close_notify to be sent by peer (if peer not + present, this avoids calling SSL_shutdown() which has a lengthy return + timeout) + */ + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, 5); + if (r <= 0) + { + soap->errnum = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connection lost...\n")); + soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + ERR_clear_error(); + SSL_free(soap->ssl); + soap->ssl = NULL; + return SOAP_OK; + } +#else + r = SSL_shutdown(soap->ssl); + if (r <= 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown failed: %d\n", SSL_get_error(soap->ssl, r))); + if (soap_valid_socket(soap->socket) && !(soap->omode & SOAP_IO_UDP)) + { + soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + } +#endif + } + } + } + SSL_free(soap->ssl); + soap->ssl = NULL; + ERR_clear_error(); + } +#endif +#ifdef WITH_GNUTLS + if (soap->session) + { + gnutls_bye(soap->session, GNUTLS_SHUT_RDWR); + gnutls_deinit(soap->session); + soap->session = NULL; + } +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + { + gsk_secure_socket_shutdown(soap->ssl); + gsk_secure_socket_close(&soap->ssl); + } +#endif + if (soap_valid_socket(soap->socket) && !(soap->omode & SOAP_IO_UDP)) + { + soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_RDWR); + soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_closesocket(struct soap *soap, SOAP_SOCKET sk) +{ + (void)soap; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Close socket=%d\n", (int)sk)); + return soap_closesocket(sk); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static int +tcp_shutdownsocket(struct soap *soap, SOAP_SOCKET sk, int how) +{ + (void)soap; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shutdown socket=%d how=%d\n", (int)sk, how)); + return shutdown(sk, how); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +SOAP_SOCKET +SOAP_FMAC2 +soap_bind(struct soap *soap, const char *host, int port, int backlog) +{ +#if defined(WITH_IPV6) + struct addrinfo *addrinfo = NULL; + struct addrinfo hints; + struct addrinfo res; + int err; + int set = 1; + int unset = 0; +#elif !defined(WITH_LEAN) + int set = 1; +#endif + if (soap_valid_socket(soap->master)) + { + soap->fclosesocket(soap, soap->master); + soap->master = SOAP_INVALID_SOCKET; + } + soap->socket = SOAP_INVALID_SOCKET; + soap->errnum = 0; + soap->errmode = 1; + if (tcp_init(soap)) + { + soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifdef WITH_IPV6 + memset((void*)&hints, 0, sizeof(hints)); + hints.ai_family = soap->bind_inet6 ? AF_INET6 : PF_UNSPEC; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + hints.ai_socktype = SOCK_DGRAM; + else +#endif + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + soap->errmode = 2; + err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo); + if (err || !addrinfo) + { + soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in soap_bind()", SOAP_TCP_ERROR); + if (addrinfo) + freeaddrinfo(addrinfo); + return SOAP_INVALID_SOCKET; + } + res = *addrinfo; + if (soap_memcpy((void*)&soap->peer.storage, sizeof(soap->peer.storage), (const void*)addrinfo->ai_addr, addrinfo->ai_addrlen)) + { + freeaddrinfo(addrinfo); + soap->error = SOAP_EOM; + return SOAP_INVALID_SOCKET; + } + soap->peerlen = addrinfo->ai_addrlen; + res.ai_addr = &soap->peer.addr; + res.ai_addrlen = soap->peerlen; + freeaddrinfo(addrinfo); + soap->master = (int)socket(res.ai_family, res.ai_socktype, res.ai_protocol); +#else +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + soap->master = (int)socket(AF_INET, SOCK_DGRAM, 0); + else +#endif + soap->master = (int)socket(AF_INET, SOCK_STREAM, 0); +#endif + soap->errmode = 0; + if (!soap_valid_socket(soap->master)) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "socket failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + soap->port = port; +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + soap->socket = soap->master; +#endif +#ifdef WITH_SOCKET_CLOSE_ON_EXIT +#ifdef WIN32 +#ifndef UNDER_CE + SetHandleInformation((HANDLE)soap->master, HANDLE_FLAG_INHERIT, 0); +#endif +#else + fcntl(soap->master, F_SETFD, 1); +#endif +#endif +#ifndef WITH_LEAN + if (soap->bind_flags && setsockopt(soap->master, SOL_SOCKET, soap->bind_flags, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifndef UNDER_CE + if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && (!((soap->imode | soap->omode) & SOAP_IO_UDP)) && setsockopt(soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + if (soap->sndbuf > 0 && setsockopt(soap->master, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + if (soap->rcvbuf > 0 && setsockopt(soap->master, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifdef TCP_NODELAY + if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#endif +#ifdef TCP_FASTOPEN + if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, IPPROTO_TCP, TCP_FASTOPEN, (char*)&set, sizeof(int))) + { + /* silently ignore */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "setsockopt TCP_FASTOPEN failed in soap_bind()\n")); + } +#endif +#endif +#endif +#ifdef WITH_IPV6 + if (res.ai_family == AF_INET6 && setsockopt(soap->master, IPPROTO_IPV6, IPV6_V6ONLY, soap->bind_v6only ? (char*)&set : (char*)&unset, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->master); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + soap->errmode = 0; + if (bind(soap->master, res.ai_addr, (int)res.ai_addrlen)) + { + soap->errnum = soap_socket_errno(soap->master); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host, bind failed\n")); + soap_closesock(soap); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#else + soap->peerlen = sizeof(soap->peer.in); + memset((void*)&soap->peer.in, 0, sizeof(soap->peer.in)); + soap->peer.in.sin_family = AF_INET; + soap->errmode = 2; + if (host) + { + if (soap->fresolve(soap, host, &soap->peer.in.sin_addr)) + { + soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + } + else + soap->peer.in.sin_addr.s_addr = htonl(INADDR_ANY); + soap->peer.in.sin_port = htons((short)port); + soap->errmode = 0; + if (bind(soap->master, &soap->peer.addr, (int)soap->peerlen)) + { + soap->errnum = soap_socket_errno(soap->master); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host, bind failed\n")); + soap_closesock(soap); + soap_set_receiver_error(soap, tcp_error(soap), "bind failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#endif + if (!(soap->omode & SOAP_IO_UDP) && listen(soap->master, backlog)) + { + soap->errnum = soap_socket_errno(soap->master); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host, listen failed\n")); + soap_closesock(soap); + soap_set_receiver_error(soap, tcp_error(soap), "listen failed in soap_bind()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + return soap->master; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_poll(struct soap *soap) +{ +#ifndef WITH_LEAN + int r; + if (soap_valid_socket(soap->socket)) + { + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_ALL, 0); + if (r > 0 && (r & SOAP_TCP_SELECT_ERR)) + r = -1; + } + else if (soap_valid_socket(soap->master)) + { + r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_SND | SOAP_TCP_SELECT_ERR, 0); + } + else + { + return SOAP_OK; /* OK when no socket! */ + } + if (r > 0) + { + int t; +#ifdef WITH_OPENSSL + if ((soap->imode & SOAP_ENC_SSL) && soap->ssl) + { + if (soap_valid_socket(soap->socket) + && (r & SOAP_TCP_SELECT_SND) + && (!(r & SOAP_TCP_SELECT_RCV) + || SSL_peek(soap->ssl, (char*)&t, 1) > 0)) + return SOAP_OK; + } + else +#endif + { + if (soap_valid_socket(soap->socket) + && (r & SOAP_TCP_SELECT_SND) + && (!(r & SOAP_TCP_SELECT_RCV) + || recv(soap->socket, (char*)&t, 1, MSG_PEEK) > 0)) + return SOAP_OK; + } + } + else if (r < 0) + { + if ((soap_valid_socket(soap->master) && soap_socket_errno(soap->master) != SOAP_EINTR) + || (soap_valid_socket(soap->socket) && soap_socket_errno(soap->socket) != SOAP_EINTR)) + return soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_poll()", SOAP_TCP_ERROR); + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_poll: other end down on socket=%d select=%d\n", (int)soap->socket, r)); + return SOAP_EOF; +#else + (void)soap; + return SOAP_OK; +#endif +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ready(struct soap *soap) +{ +#ifndef WITH_LEAN + int r; + if (!soap_valid_socket(soap->socket)) + return SOAP_OK; /* OK when no socket! */ + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_ERR, 0); + if (r > 0 && (r & SOAP_TCP_SELECT_ERR)) + r = -1; + if (r < 0 && soap_socket_errno(soap->socket) != SOAP_EINTR) + return soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_ready()", SOAP_TCP_ERROR); + if (r > 0) + { + char t; +#ifdef WITH_OPENSSL + if ((soap->imode & SOAP_ENC_SSL) && soap->ssl) + { + if (SSL_peek(soap->ssl, &t, 1) > 0) + return SOAP_OK; + } + else +#endif + { + if (recv(soap->socket, &t, 1, MSG_PEEK) > 0) + return SOAP_OK; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "soap_ready: other end not ready to send on socket=%d select=%d\n", (int)soap->socket, r)); + return SOAP_EOF; +#else + (void)soap; + return SOAP_OK; +#endif +} +#endif +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +SOAP_SOCKET +SOAP_FMAC2 +soap_accept(struct soap *soap) +{ + int n = (int)sizeof(soap->peer); + int err; +#ifndef WITH_LEAN + int set = 1; +#endif + soap->error = SOAP_OK; + memset((void*)&soap->peer, 0, sizeof(soap->peer)); + soap->socket = SOAP_INVALID_SOCKET; + soap->errmode = 0; + soap->errnum = 0; + soap->keep_alive = 0; + if (!soap_valid_socket(soap->master)) + { + soap_set_receiver_error(soap, tcp_error(soap), "no master socket in soap_accept()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } +#ifndef WITH_LEAN + if ((soap->omode & SOAP_IO_UDP)) + return soap->socket = soap->master; +#endif + for (;;) + { + if (soap->accept_timeout) + { + for (;;) + { + int r; + r = tcp_select(soap, soap->master, SOAP_TCP_SELECT_ALL, soap->accept_timeout); + if (r > 0) + break; + if (!r) + { + soap_set_receiver_error(soap, "Timeout", "accept failed in soap_accept()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + if (r < 0) + { + r = soap->errnum; + if (r != SOAP_EINTR) + { + soap_closesock(soap); + soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR); + return SOAP_INVALID_SOCKET; + } + } + } + } + n = (int)sizeof(soap->peer); + soap->socket = soap->faccept(soap, soap->master, &soap->peer.addr, &n); + soap->peerlen = (size_t)n; + if (soap_valid_socket(soap->socket)) + { +#ifdef WITH_IPV6 + char port[16]; + struct addrinfo *res = NULL; + struct addrinfo hints; + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV; + getnameinfo(&soap->peer.addr, n, soap->host, sizeof(soap->host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); + soap->ip = 0; + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0; + soap->ip6[3] = 0; + if (getaddrinfo(soap->host, NULL, &hints, &res) == 0 && res) + { + struct sockaddr_storage result; + (void)soap_memcpy(&result, sizeof(result), res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); + if (result.ss_family == AF_INET6) + { + struct sockaddr_in6 *addr = (struct sockaddr_in6*)&result; + struct in6_addr *inaddr = &addr->sin6_addr; + int i; + for (i = 0; i < 16; i++) + soap->ip6[i/4] = (soap->ip6[i/4] << 8) + inaddr->s6_addr[i]; + } + else if (result.ss_family == AF_INET) + { + struct sockaddr_in *addr = (struct sockaddr_in*)&result; + soap->ip = ntohl(addr->sin_addr.s_addr); + soap->ip6[2] = 0xFFFF; + soap->ip6[3] = soap->ip; + } + } + soap->port = soap_strtol(port, NULL, 10); +#else + soap->ip = ntohl(soap->peer.in.sin_addr.s_addr); + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0xFFFF; + soap->ip6[3] = soap->ip; + (SOAP_SNPRINTF(soap->host, sizeof(soap->host), 80), "%u.%u.%u.%u", (int)(soap->ip>>24)&0xFF, (int)(soap->ip>>16)&0xFF, (int)(soap->ip>>8)&0xFF, (int)soap->ip&0xFF); + soap->port = (int)ntohs(soap->peer.in.sin_port); /* does not return port number on some systems */ +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept socket=%d at port=%d from IP='%s'\n", (int)soap->socket, soap->port, soap->host)); +#ifndef WITH_LEAN + if ((soap->accept_flags & SO_LINGER)) + { + struct linger linger; + memset((void*)&linger, 0, sizeof(linger)); + linger.l_onoff = 1; + linger.l_linger = soap->linger_time; + if (setsockopt(soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + } + if ((soap->accept_flags & ~SO_LINGER) && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags & ~SO_LINGER, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } +#ifndef UNDER_CE + if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + if (soap->sndbuf > 0 && setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&soap->sndbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + if (soap->rcvbuf > 0 && setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&soap->rcvbuf, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } +#ifdef TCP_NODELAY + if (setsockopt(soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int))) + { + soap->errnum = soap_socket_errno(soap->socket); + soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } +#endif +#endif +#endif + soap->keep_alive = -(((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0); + if (soap->send_timeout || soap->recv_timeout) + SOAP_SOCKNONBLOCK(soap->socket) + else + SOAP_SOCKBLOCK(soap->socket) + return soap->socket; + } + err = soap_socket_errno(soap->socket); + if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host)); + soap->errnum = err; + soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR); + soap_closesock(soap); + return SOAP_INVALID_SOCKET; + } + } +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_closesock(struct soap *soap) +{ + int status = soap->error; + int err = SOAP_OK; + soap->part = SOAP_END; +#ifndef WITH_LEANER + if (status && status < 200) /* attachment state is not to be trusted */ + { + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + } +#endif + if (soap->fdisconnect) + err = soap->fdisconnect(soap); + if (err || status == SOAP_EOF || status == SOAP_TCP_ERROR || status == SOAP_SSL_ERROR || !soap->keep_alive) + { + soap->keep_alive = 0; + if (soap->fclose && (soap->error = soap->fclose(soap)) != SOAP_OK) + return soap->error; + if (err) + return soap->error = err; + } +#ifdef WITH_ZLIB + if (!(soap->mode & SOAP_MIME_POSTCHECK)) + { + if (soap->zlib_state == SOAP_ZLIB_DEFLATE) + deflateEnd(soap->d_stream); + else if (soap->zlib_state == SOAP_ZLIB_INFLATE) + inflateEnd(soap->d_stream); + soap->zlib_state = SOAP_ZLIB_NONE; + } +#endif + return soap->error = status; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_force_closesock(struct soap *soap) +{ + soap->keep_alive = 0; + if (soap_valid_socket(soap->socket) && soap->fclosesocket) + { + soap->fclosesocket(soap, soap->socket); + soap->socket = SOAP_INVALID_SOCKET; + } + return soap->error; +} + +/******************************************************************************/ + +#ifdef WITH_SELF_PIPE +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_close_connection(struct soap *soap) +{ + if (soap_valid_socket(soap->socket)) + write(soap->pipe_fd[1], "1", 1); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_cleanup(struct soap *soap) +{ + soap_done(soap); +#ifdef WIN32 + if (!tcp_done) + return; + tcp_done = 0; + WSACleanup(); +#endif +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_done(struct soap *soap) +{ +#ifdef SOAP_DEBUG + int i; +#endif + if (soap_check_state(soap)) + return; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Done with context%s\n", soap->state == SOAP_COPY ? " copy" : "")); + soap_free_temp(soap); + while (soap->clist) + { + struct soap_clist *p = soap->clist->next; + SOAP_FREE(soap, soap->clist); + soap->clist = p; + } + if (soap->state == SOAP_INIT) + soap->omode &= ~SOAP_IO_UDP; /* to force close the socket */ + soap->keep_alive = 0; /* to force close the socket */ + if (soap->master == soap->socket) /* do not close twice */ + soap->master = SOAP_INVALID_SOCKET; + soap_closesock(soap); +#ifdef WITH_COOKIES + soap_free_cookies(soap); +#endif + while (soap->plugins) + { + struct soap_plugin *p = soap->plugins->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Removing plugin '%s'\n", soap->plugins->id)); + if (soap->plugins->fcopy || soap->state == SOAP_INIT) + soap->plugins->fdelete(soap, soap->plugins); + SOAP_FREE(soap, soap->plugins); + soap->plugins = p; + } + soap->fplugin = fplugin; +#ifndef WITH_NOHTTP + soap->fpost = http_post; + soap->fget = http_get; + soap->fput = http_put; + soap->fpatch = http_patch; + soap->fdel = http_del; + soap->fopt = http_200; + soap->fhead = http_200; + soap->fform = NULL; + soap->fposthdr = http_post_header; + soap->fresponse = http_response; + soap->fparse = http_parse; + soap->fparsehdr = http_parse_header; +#endif + soap->fheader = NULL; +#ifndef WITH_NOIO +#ifndef WITH_IPV6 + soap->fresolve = tcp_gethost; +#else + soap->fresolve = NULL; +#endif + soap->faccept = tcp_accept; + soap->fopen = tcp_connect; + soap->fclose = tcp_disconnect; + soap->fclosesocket = tcp_closesocket; + soap->fshutdownsocket = tcp_shutdownsocket; + soap->fsend = fsend; + soap->frecv = frecv; + soap->fpoll = soap_poll; +#else + soap->fopen = NULL; + soap->fclose = NULL; + soap->fpoll = NULL; +#endif +#ifndef WITH_LEANER + soap->fsvalidate = NULL; + soap->fwvalidate = NULL; + soap->feltbegin = NULL; + soap->feltendin = NULL; + soap->feltbegout = NULL; + soap->feltendout = NULL; + soap->fprepareinitsend = NULL; + soap->fprepareinitrecv = NULL; + soap->fpreparesend = NULL; + soap->fpreparerecv = NULL; + soap->fpreparefinalsend = NULL; + soap->fpreparefinalrecv = NULL; + soap->ffiltersend = NULL; + soap->ffilterrecv = NULL; +#endif + soap->fseterror = NULL; + soap->fignore = NULL; + soap->fserveloop = NULL; +#ifdef WITH_OPENSSL + if (soap->session) + { + SSL_SESSION_free(soap->session); + soap->session = NULL; + } +#endif + if (soap->state == SOAP_INIT) + { + if (soap_valid_socket(soap->master)) + { + soap->fclosesocket(soap, soap->master); + soap->master = SOAP_INVALID_SOCKET; + } + } +#ifdef WITH_OPENSSL + if (soap->ssl) + { + SSL_free(soap->ssl); + soap->ssl = NULL; + } + if (soap->state == SOAP_INIT) + { + if (soap->ctx) + { + SSL_CTX_free(soap->ctx); + soap->ctx = NULL; + } + } + ERR_clear_error(); +# if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) + /* OpenSSL libraries handle thread init and deinit */ +# elif OPENSSL_VERSION_NUMBER >= 0x10000000L + ERR_remove_thread_state(NULL); +# else + ERR_remove_state(0); +# endif +#endif +#ifdef WITH_GNUTLS + if (soap->state == SOAP_INIT) + { + if (soap->xcred) + { + gnutls_certificate_free_credentials(soap->xcred); + soap->xcred = NULL; + } + if (soap->acred) + { + gnutls_anon_free_client_credentials(soap->acred); + soap->acred = NULL; + } + if (soap->cache) + { + gnutls_priority_deinit(soap->cache); + soap->cache = NULL; + } + if (soap->dh_params) + { + gnutls_dh_params_deinit(soap->dh_params); + soap->dh_params = NULL; + } +# if GNUTLS_VERSION_NUMBER < 0x030300 + if (soap->rsa_params) + { + gnutls_rsa_params_deinit(soap->rsa_params); + soap->rsa_params = NULL; + } +#endif + } + if (soap->session) + { + gnutls_deinit(soap->session); + soap->session = NULL; + } +#endif +#ifdef WITH_SYSTEMSSL + if (soap->ssl) + gsk_secure_socket_close(&soap->ssl); + if (soap->state == SOAP_INIT) + if (soap->ctx) + gsk_environment_close(&soap->ctx); +#endif +#ifdef WITH_C_LOCALE + SOAP_FREELOCALE(soap); +#endif +#ifdef WITH_ZLIB + if (soap->d_stream) + { + SOAP_FREE(soap, soap->d_stream); + soap->d_stream = NULL; + } + if (soap->z_buf) + { + SOAP_FREE(soap, soap->z_buf); + soap->z_buf = NULL; + } +#endif +#ifdef SOAP_DEBUG + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free logfiles\n")); + for (i = 0; i < SOAP_MAXLOGS; i++) + { + soap_close_logfile(soap, i); + if (soap->logfile[i]) + { + SOAP_FREE_UNMANAGED(soap->logfile[i]); + soap->logfile[i] = NULL; + } + } +#endif +#ifdef WITH_SELF_PIPE + close(soap->pipe_fd[0]); + close(soap->pipe_fd[1]); +#endif +#ifdef SOAP_MEM_DEBUG + soap_free_mht(soap); +#endif + soap->state = SOAP_NONE; +} + +/******************************************************************************\ + * + * HTTP + * +\******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_parse(struct soap *soap) +{ + char header[SOAP_HDRLEN], *s; + int err = SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Waiting for HTTP request/response...\n")); + soap->fform = NULL; + *soap->endpoint = '\0'; + soap->bearer = NULL; +#ifdef WITH_NTLM + if (!soap->ntlm_challenge) +#endif + { + soap->userid = NULL; + soap->passwd = NULL; + soap->authrealm = NULL; + } +#ifdef WITH_NTLM + soap->ntlm_challenge = NULL; +#endif + soap->proxy_from = NULL; + soap->cors_origin = NULL; + soap->cors_method = NULL; + soap->cors_header = NULL; + do + { + soap->length = 0; + soap->http_content = NULL; + soap->action = NULL; + soap->status = 0; + soap->body = 1; + if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf))) + { + if (soap->error == SOAP_EOF) + return SOAP_EOF; + return soap->error = 414; + } + s = strchr(soap->msgbuf, ' '); + if (s) + { + soap->status = (unsigned short)soap_strtoul(s, &s, 10); + if (!soap_coblank((soap_wchar)*s)) + soap->status = 0; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP status: %s\n", soap->msgbuf)); + for (;;) + { + if (soap_getline(soap, header, SOAP_HDRLEN)) + { + if (soap->error == SOAP_EOF) + { + soap->error = SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "EOF in HTTP header, try to continue anyway\n")); + break; + } + return soap->error; + } + if (!*header) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP header: %s\n", header)); + s = strchr(header, ':'); + if (s) + { + char *t; + *s = '\0'; + do + { + s++; + } while (*s && *s <= 32); + if (*s == '"') + s++; + t = s + strlen(s) - 1; + while (t > s && *t <= 32) + t--; + if (t >= s && *t == '"') + t--; + t[1] = '\0'; + soap->error = soap->fparsehdr(soap, header, s); + if (soap->error) + { + if (soap->error < SOAP_STOP) + return soap->error; + err = soap->error; + soap->error = SOAP_OK; + } + } + } + } while (soap->status == 100); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Finished HTTP header parsing, status = %d\n", soap->status)); + s = strstr(soap->msgbuf, "HTTP/"); + if (s && s[5] == '1' && s[6] == '.' && s[7] == '0') + { + soap->keep_alive = 0; /* HTTP 1.0 does not support keep-alive */ + if (soap->status == 0 && (soap->omode & SOAP_IO) == SOAP_IO_CHUNK) /* soap->status == 0 for HTTP request */ + soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE; /* HTTP 1.0 does not support chunked transfers */ + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Keep alive connection = %d\n", soap->keep_alive)); + if (soap->status == 0) + { + size_t l = 0; + if (s) + { + if (!strncmp(soap->msgbuf, "POST ", l = 5)) + soap->status = SOAP_POST; + else if (!strncmp(soap->msgbuf, "GET ", l = 4)) + soap->status = SOAP_GET; + else if (!strncmp(soap->msgbuf, "PUT ", l = 4)) + soap->status = SOAP_PUT; + else if (!strncmp(soap->msgbuf, "PATCH ", l = 4)) + soap->status = SOAP_PATCH; + else if (!strncmp(soap->msgbuf, "DELETE ", l = 7)) + soap->status = SOAP_DEL; + else if (!strncmp(soap->msgbuf, "HEAD ", l = 5)) + soap->status = SOAP_HEAD; + else if (!strncmp(soap->msgbuf, "OPTIONS ", l = 8)) + soap->status = SOAP_OPTIONS; + } + if (s && soap->status) + { + size_t m, n, k; + int r; + while (soap->msgbuf[l] && soap_coblank((soap_wchar)soap->msgbuf[l])) + l++; + m = strlen(soap->endpoint); + n = m + (s - soap->msgbuf) - l - 1; + if (n >= sizeof(soap->endpoint)) + n = sizeof(soap->endpoint) - 1; + if (m > n) + m = n; + k = n - m + 1; + if (k >= sizeof(soap->path)) + k = sizeof(soap->path) - 1; + while (k > 0 && soap_coblank((soap_wchar)soap->msgbuf[l + k - 1])) + k--; + if (soap_strncpy(soap->path, sizeof(soap->path), soap->msgbuf + l, k)) + return soap->error = 414; + if (*soap->path && *soap->path != '/') + r = soap_strncpy(soap->endpoint, sizeof(soap->endpoint), soap->path, k); + else + r = soap_strncat(soap->endpoint, sizeof(soap->endpoint), soap->path, k); + if (r) + return soap->error = 414; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Target endpoint='%s' path='%s'\n", soap->endpoint, soap->path)); + if (err) + return soap->error = err; + } + else if (err) + { + return soap->error = err; + } + else if (s) + { + return soap->error = 405; + } + return SOAP_OK; + } + if ((soap->status >= 200 && soap->status <= 299) /* OK, Accepted, etc */ + || soap->status == 400 /* Bad Request */ + || soap->status == 500) /* Internal Server Error */ + return soap->error = SOAP_OK; + return soap->error = soap->status; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_parse_header(struct soap *soap, const char *key, const char *val) +{ + if (!soap_tag_cmp(key, "Host")) + { +#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS) + if ((soap->imode & SOAP_ENC_SSL)) + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), "https://"); + else +#endif + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), "http://"); + if (soap_strncat(soap->endpoint, sizeof(soap->endpoint), val, sizeof(soap->endpoint) - 9)) + return soap->error = SOAP_HDR; + } +#ifndef WITH_LEANER + else if (!soap_tag_cmp(key, "Content-Type")) + { + const char *action; + soap->http_content = soap_strdup(soap, val); + if (soap_http_header_attribute(soap, val, "application/dime")) + soap->imode |= SOAP_ENC_DIME; + else if (soap_http_header_attribute(soap, val, "multipart/related") + || soap_http_header_attribute(soap, val, "multipart/form-data")) + { + const char *type; + soap->mime.boundary = soap_strdup(soap, soap_http_header_attribute(soap, val, "boundary")); + soap->mime.start = soap_strdup(soap, soap_http_header_attribute(soap, val, "start")); + soap->imode |= SOAP_ENC_MIME; + type = soap_http_header_attribute(soap, val, "type"); + if (type && !strcmp(type, "application/xop+xml")) + soap->imode |= SOAP_ENC_MTOM; + } + action = soap_http_header_attribute(soap, val, "action"); + if (action) + { + if (*action == '"') + { + soap->action = soap_strdup(soap, action + 1); + if (soap->action && *soap->action) + soap->action[strlen(soap->action) - 1] = '\0'; + } + else + soap->action = soap_strdup(soap, action); + } + } +#endif + else if (!soap_tag_cmp(key, "Content-Length")) + { + soap->length = soap_strtoull(val, NULL, 10); + if (soap->length == 0) + soap->body = 0; + } + else if (!soap_tag_cmp(key, "Content-Encoding")) + { + if (!soap_tag_cmp(val, "deflate")) +#ifdef WITH_ZLIB + soap->zlib_in = SOAP_ZLIB_DEFLATE; +#else + return SOAP_ZLIB_ERROR; +#endif + else if (!soap_tag_cmp(val, "gzip")) +#ifdef WITH_GZIP + soap->zlib_in = SOAP_ZLIB_GZIP; +#else + return SOAP_ZLIB_ERROR; +#endif + } +#ifdef WITH_ZLIB + else if (!soap_tag_cmp(key, "Accept-Encoding")) + { +#ifdef WITH_GZIP + if (strchr(val, '*') || soap_http_header_attribute(soap, val, "gzip")) + soap->zlib_out = SOAP_ZLIB_GZIP; + else +#endif + if (strchr(val, '*') || soap_http_header_attribute(soap, val, "deflate")) + soap->zlib_out = SOAP_ZLIB_DEFLATE; + else + soap->zlib_out = SOAP_ZLIB_NONE; + } +#endif + else if (!soap_tag_cmp(key, "Transfer-Encoding")) + { + soap->imode &= ~SOAP_IO; + if (!soap_tag_cmp(val, "chunked")) + soap->imode |= SOAP_IO_CHUNK; + } + else if (!soap_tag_cmp(key, "Connection")) + { + if (!soap_tag_cmp(val, "close")) + soap->keep_alive = 0; + } +#if !defined(WITH_LEAN) || defined(WITH_NTLM) + else if (!soap_tag_cmp(key, "Authorization") || !soap_tag_cmp(key, "Proxy-Authorization")) + { +#ifdef WITH_NTLM + if (!soap_tag_cmp(val, "NTLM*")) + { + soap->ntlm_challenge = soap_strdup(soap, val + 4); + } + else +#endif + if (!soap_tag_cmp(val, "Bearer *")) + { + soap->bearer = soap_strdup(soap, val + 7); + } + else if (!soap_tag_cmp(val, "Basic *")) + { + int n; + char *s; + soap_base642s(soap, val + 6, soap->tmpbuf, sizeof(soap->tmpbuf) - 1, &n); + soap->tmpbuf[n] = '\0'; + s = strchr(soap->tmpbuf, ':'); + if (s) + { + *s = '\0'; + soap->userid = soap_strdup(soap, soap->tmpbuf); + soap->passwd = soap_strdup(soap, s + 1); + } + } + } + else if (!soap_tag_cmp(key, "WWW-Authenticate") || !soap_tag_cmp(key, "Proxy-Authenticate")) + { +#ifdef WITH_NTLM + if (!soap_tag_cmp(val, "NTLM*")) + soap->ntlm_challenge = soap_strdup(soap, val + 4); + else +#endif + soap->authrealm = soap_strdup(soap, soap_http_header_attribute(soap, val + 6, "realm")); + } + else if (!soap_tag_cmp(key, "Expect")) + { + if (!soap_tag_cmp(val, "100-continue")) + { + if ((soap->error = soap->fposthdr(soap, "HTTP/1.1 100 Continue", NULL)) != SOAP_OK + || (soap->error = soap->fposthdr(soap, NULL, NULL)) != SOAP_OK) + return soap->error; + } + } +#endif + else if (!soap_tag_cmp(key, "SOAPAction")) + { + if (*val == '"') + { + soap->action = soap_strdup(soap, val + 1); + if (*soap->action) + soap->action[strlen(soap->action) - 1] = '\0'; + } + else + soap->action = soap_strdup(soap, val); + } + else if (!soap_tag_cmp(key, "Location")) + { + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), val); + } + else if (!soap_tag_cmp(key, "X-Forwarded-For")) + { + soap->proxy_from = soap_strdup(soap, val); + } + else if (!soap_tag_cmp(key, "Origin")) + { + soap->origin = soap_strdup(soap, val); + soap->cors_origin = soap->cors_allow; + } + else if (!soap_tag_cmp(key, "Access-Control-Request-Method")) + { + soap->cors_method = soap_strdup(soap, val); + } + else if (!soap_tag_cmp(key, "Access-Control-Request-Headers")) + { + soap->cors_header = soap_strdup(soap, val); + } +#ifdef WITH_COOKIES + else if (!soap_tag_cmp(key, "Cookie") + || !soap_tag_cmp(key, "Cookie2") + || !soap_tag_cmp(key, "Set-Cookie") + || !soap_tag_cmp(key, "Set-Cookie2")) + { + soap_getcookies(soap, val); + } +#endif + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_http_header_attribute(struct soap *soap, const char *line, const char *key) +{ + const char *s = line; + if (s) + { + while (*s) + { + short flag; + s = soap_decode_key(soap->tmpbuf, sizeof(soap->tmpbuf), s); + flag = soap_tag_cmp(soap->tmpbuf, key); + s = soap_decode_val(soap->tmpbuf, sizeof(soap->tmpbuf), s); + if (!flag) + return soap->tmpbuf; + } + } + return NULL; +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_decode_key(char *buf, size_t len, const char *val) +{ + return soap_decode(buf, len, val, "=,;"); +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_decode_val(char *buf, size_t len, const char *val) +{ + if (*val != '=') + { + *buf = '\0'; + return val; + } + return soap_decode(buf, len, val + 1, ",;"); +} +#endif + +/******************************************************************************/ + +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) +static const char * +soap_decode(char *buf, size_t len, const char *val, const char *sep) +{ + const char *s; + char *t = buf; + size_t i = len; + for (s = val; *s; s++) + if (*s != ' ' && *s != '\t' && !strchr(sep, *s)) + break; + if (len > 0) + { + if (*s == '"') + { + s++; + while (*s && *s != '"' && --i) + *t++ = *s++; + } + else + { + while (*s && !strchr(sep, *s) && --i) + { + if (*s == '%' && s[1] && s[2]) + { + *t++ = ((s[1] >= 'A' ? (s[1] & 0x7) + 9 : s[1] - '0') << 4) + + (s[2] >= 'A' ? (s[2] & 0x7) + 9 : s[2] - '0'); + s += 3; + } + else + *t++ = *s++; + } + } + buf[len - 1] = '\0'; /* appease static checkers that get confused */ + } + *t = '\0'; + while (*s && !strchr(sep, *s)) + s++; + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static const char* +http_error(struct soap *soap, int status) +{ + const char *msg = SOAP_STR_EOS; + (void)soap; + (void)status; +#ifndef WITH_LEAN + msg = soap_code_str(h_http_error_codes, status); + if (!msg) + msg = SOAP_STR_EOS; +#endif + return msg; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_get(struct soap *soap) +{ + (void)soap; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP GET request\n")); + return SOAP_GET_METHOD; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_put(struct soap *soap) +{ + (void)soap; + return SOAP_PUT_METHOD; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_patch(struct soap *soap) +{ + (void)soap; + return SOAP_PATCH_METHOD; +} +#endif +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_del(struct soap *soap) +{ + (void)soap; + return SOAP_DEL_METHOD; +} +#endif +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_200(struct soap *soap) +{ + if (soap->origin && soap->cors_method) /* CORS Origin and Access-Control-Request-Method headers */ + { + soap->cors_origin = soap->cors_allow; /* modify this code or hook your own soap->fopt() callback with logic */ + soap->cors_methods = "GET, PUT, PATCH, POST, HEAD, OPTIONS"; + soap->cors_headers = soap->cors_header; + } + return soap_send_empty_response(soap, 200); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_post(struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, ULONG64 count) +{ + const char *s; + int err; + size_t l; + switch (soap->status) + { + case SOAP_GET: + s = "GET"; + break; + case SOAP_PUT: + s = "PUT"; + break; + case SOAP_PATCH: + s = "PATCH"; + break; + case SOAP_DEL: + s = "DELETE"; + break; + case SOAP_CONNECT: + s = "CONNECT"; + break; + case SOAP_HEAD: + s = "HEAD"; + break; + case SOAP_OPTIONS: + s = "OPTIONS"; + break; + default: + s = "POST"; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP %s to %s\n", s, endpoint ? endpoint : "(null)")); + if (!endpoint || (soap_tag_cmp(endpoint, "http:*") && soap_tag_cmp(endpoint, "https:*") && soap_tag_cmp(endpoint, "httpg:*"))) + return SOAP_OK; + /* set l to prevent overruns ('host' and 'soap->host' are substrings of 'endpoint') */ + l = strlen(endpoint) + strlen(soap->http_version) + 80; + if (l > sizeof(soap->tmpbuf)) + return soap->error = SOAP_EOM; + if (soap->status == SOAP_CONNECT) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s %s:%d HTTP/%s", s, soap->host, soap->port, soap->http_version); + else if (soap->proxy_host && endpoint) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s %s HTTP/%s", s, endpoint, soap->http_version); + else + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s /%s HTTP/%s", s, (*path == '/' ? path + 1 : path), soap->http_version); + err = soap->fposthdr(soap, soap->tmpbuf, NULL); + if (err) + return err; +#ifdef WITH_OPENSSL + if ((soap->ssl && port != 443) || (!soap->ssl && port != 80)) +#else + if (port != 80) +#endif + { +#ifdef WITH_IPV6 + if (*host != '[' && strchr(host, ':')) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "[%s]:%d", host, port); /* RFC 2732 */ + else +#endif + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "%s:%d", host, port); + } + else + { +#ifdef WITH_IPV6 + if (*host != '[' && strchr(host, ':')) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l), "[%s]", host); /* RFC 2732 */ + else +#endif + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), host); + } + err = soap->fposthdr(soap, "Host", soap->tmpbuf); + if (err) + return err; + err = soap->fposthdr(soap, "User-Agent", "gSOAP/2.8"); + if (err) + return err; + if (soap->origin) + { + err = soap->fposthdr(soap, "Origin", soap->origin); + if (err) + return err; + if (soap->status == SOAP_OPTIONS) + { + err = soap->fposthdr(soap, "Access-Control-Request-Method", soap->cors_method ? soap->cors_method : "POST"); + if (err) + return err; + if (soap->cors_header) + { + err = soap->fposthdr(soap, "Access-Control-Request-Headers", soap->cors_header); + if (err) + return err; + } + } + } + err = soap_puthttphdr(soap, SOAP_OK, count); + if (err) + return err; +#ifndef WITH_LEANER + if ((soap->imode & SOAP_ENC_MTOM)) + { + err = soap->fposthdr(soap, "Accept", "multipart/related,application/xop+xml,*/*;q=0.8"); + if (err) + return err; + } +#endif +#ifdef WITH_ZLIB +#ifdef WITH_GZIP + err = soap->fposthdr(soap, "Accept-Encoding", "gzip,deflate"); +#else + err = soap->fposthdr(soap, "Accept-Encoding", "deflate"); +#endif + if (err) + return err; +#endif +#if !defined(WITH_LEAN) || defined(WITH_NTLM) + if (soap->bearer) + { + l = strlen(soap->bearer); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l + 1), "Bearer %s", soap->bearer); + err = soap->fposthdr(soap, "Authorization", soap->tmpbuf); + if (err) + return err; + } +#ifdef WITH_NTLM + if (soap->ntlm_challenge) + { + l = strlen(soap->ntlm_challenge); + if (l) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), l + 5), "NTLM %s", soap->ntlm_challenge); + if (soap->proxy_host) + { + err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf); + if (err) + return err; + } + else + { + err = soap->fposthdr(soap, "Authorization", soap->tmpbuf); + if (err) + return err; + } + } + } + else + { +#endif + if (soap->userid && soap->passwd) + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic "); + (SOAP_SNPRINTF(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, strlen(soap->userid) + strlen(soap->passwd) + 1), "%s:%s", soap->userid, soap->passwd); + soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262)); + err = soap->fposthdr(soap, "Authorization", soap->tmpbuf); + if (err) + return err; + } + if (soap->proxy_userid && soap->proxy_passwd) + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "Basic "); + (SOAP_SNPRINTF(soap->tmpbuf + 262, sizeof(soap->tmpbuf) - 262, strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) + 1), "%s:%s", soap->proxy_userid, soap->proxy_passwd); + soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, (int)strlen(soap->tmpbuf + 262)); + err = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf); + if (err) + return err; + } +#ifdef WITH_NTLM + } +#endif +#endif +#ifdef WITH_COOKIES +#ifdef WITH_OPENSSL + if (soap_putcookies(soap, host, path, soap->ssl != NULL)) + return soap->error; +#else + if (soap_putcookies(soap, host, path, 0)) + return soap->error; +#endif +#endif + if (action && soap->status != SOAP_GET && soap->status != SOAP_DEL) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(action) + 2), "\"%s\"", action); + err = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf); + if (err) + return err; + } + return soap->fposthdr(soap, NULL, NULL); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_send_header(struct soap *soap, const char *s) +{ + const char *t; + do + { + t = strchr(s, '\n'); /* disallow \n in HTTP headers */ + if (!t) + t = s + strlen(s); + if (soap_send_raw(soap, s, t - s)) + return soap->error; + s = t + 1; + } while (*t); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_post_header(struct soap *soap, const char *key, const char *val) +{ + if (key) + { + if (http_send_header(soap, key)) + return soap->error; + if (val && (soap_send_raw(soap, ": ", 2) || http_send_header(soap, val))) + return soap->error; + } + return soap_send_raw(soap, "\r\n", 2); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +static int +http_response(struct soap *soap, int status, ULONG64 count) +{ + int err; + char http[32]; + int code = status; + const char *line; +#ifdef WMW_RPM_IO + if (soap->rpmreqid) + httpOutputEnable(soap->rpmreqid); + if (soap->rpmreqid + || soap_valid_socket(soap->master) + || soap_valid_socket(soap->socket) + || soap->recvfd != 0 + || soap->sendfd != 1 + || soap->os) /* RPM behaves as if standalone */ +#else + if (soap_valid_socket(soap->master) + || soap_valid_socket(soap->socket) +#ifndef UNDER_CE + || soap->recvfd != 0 + || soap->sendfd != 1 +#else + || soap->recvfd != stdin + || soap->sendfd != stdout +#endif + || soap->os) /* standalone server application (over sockets), not CGI (over stdin/out) */ +#endif + (SOAP_SNPRINTF(http, sizeof(http), strlen(soap->http_version) + 5), "HTTP/%s", soap->http_version); + else + soap_strcpy(http, sizeof(http), "Status:"); + if (status >= SOAP_FILE && status < SOAP_FILE + 600) + { + code = status - SOAP_FILE; + if (code == 0) + code = 200; + } + else if (!status || status == SOAP_HTML) + { + if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK)) + code = 200; + else + code = 202; + } + else if (status < 200 || status >= 600) + { + const char *s = *soap_faultcode(soap); + if (status >= SOAP_GET_METHOD && status <= SOAP_HTTP_METHOD) + code = 405; + else if (soap->version == 2 && (!s || !strcmp(s, "SOAP-ENV:Sender"))) + code = 400; + else + code = 500; + } + line = http_error(soap, code); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "HTTP Status = %d %s\n", code, line)); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), sizeof(http) + 22 + strlen(line)), "%s %d %s", http, code, line); + err = soap->fposthdr(soap, soap->tmpbuf, NULL); + if (err) + return err; +#ifndef WITH_LEAN + if (status == 401) + { + (SOAP_SNPRINTF_SAFE(soap->tmpbuf, sizeof(soap->tmpbuf)), "Basic realm=\"%s\"", (soap->authrealm && strlen(soap->authrealm) + 14 < sizeof(soap->tmpbuf)) ? soap->authrealm : "gSOAP Web Service"); + err = soap->fposthdr(soap, "WWW-Authenticate", soap->tmpbuf); + if (err) + return err; + } + else if ((status >= 301 && status <= 303) || status == 307) + { + err = soap->fposthdr(soap, "Location", soap->endpoint); + if (err) + return err; + } +#endif + err = soap->fposthdr(soap, "Server", "gSOAP/2.8"); + if (err) + return err; + if (soap->cors_origin) + { + err = soap->fposthdr(soap, "Access-Control-Allow-Origin", soap->cors_origin); + if (err) + return err; + err = soap->fposthdr(soap, "Access-Control-Allow-Credentials", "true"); + if (err) + return err; + if (soap->cors_methods) + { + err = soap->fposthdr(soap, "Access-Control-Allow-Methods", soap->cors_methods); + if (err) + return err; + if (soap->cors_headers) + { + err = soap->fposthdr(soap, "Access-Control-Allow-Headers", soap->cors_headers); + if (err) + return err; + } + } + } + if (soap->x_frame_options) + { + err = soap->fposthdr(soap, "X-Frame-Options", soap->x_frame_options); + if (err) + return err; + } + soap->cors_origin = NULL; + soap->cors_methods = NULL; + soap->cors_headers = NULL; + err = soap_puthttphdr(soap, status, count); + if (err) + return err; +#ifdef WITH_COOKIES + if (soap_putsetcookies(soap)) + return soap->error; + soap_free_cookies(soap); +#endif + return soap->fposthdr(soap, NULL, NULL); +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_response(struct soap *soap, int status) +{ + ULONG64 count; + if (!(soap->omode & (SOAP_ENC_PLAIN | SOAP_IO_STORE /* this tests for chunking too */)) + && (status == SOAP_HTML || (status >= SOAP_FILE && status < SOAP_FILE + 600))) + soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE; + soap->status = status; + count = soap_count_attachments(soap); + if (soap_init_send(soap)) + return soap->error; +#ifndef WITH_NOHTTP + if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_PLAIN)) + { + int k = soap->mode; + soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB); + if ((k & SOAP_IO) != SOAP_IO_FLUSH) + soap->mode |= SOAP_IO_BUFFER; + soap->error = soap->fresponse(soap, status, count); + if (soap->error) + return soap->error; +#ifndef WITH_LEANER + if ((k & SOAP_IO) == SOAP_IO_CHUNK) + { + if (soap_flush(soap)) + return soap->error; + } +#endif + soap->mode = k; + } +#endif +#ifndef WITH_LEANER + if (soap_begin_attachments(soap)) + return soap->error; +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_extend_url(struct soap *soap, const char *s, const char *t) +{ + if (s) + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), s); + else + *soap->msgbuf = '\0'; + if (t && (*t == '/' || *t == '?')) + { + char *r = strchr(soap->msgbuf, '?'); + if (r) + { + if (*t == '?') + { + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "&"); + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), t + 1); + } + else /* *t == '/' */ + { + size_t l = r - soap->msgbuf; + *r = '\0'; + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), t); + if (s) + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), s + l); + } + } + else + { + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), t); + } + } + return soap->msgbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_extend_url_query(struct soap *soap, const char *s, const char *t) +{ + (void)soap_extend_url(soap, s, t); /* fills and returns soap->msgbuf */ + if (strchr(soap->msgbuf, '?')) + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "&"); + else + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "?"); + return soap->msgbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_url_query(struct soap *soap, const char *s, const char *t) +{ + size_t n = strlen(s); + if (n) + { + char *r = soap->msgbuf; + size_t k = n - (s[n-1] == '='); + while ((r = strchr(r, '{')) != NULL) + if (!strncmp(++r, s, k) && r[k] == '}') + break; + if (r) + { + size_t m = t ? strlen(t) : 0; + (void)soap_memmove(r + m - 1, soap->msgbuf + sizeof(soap->msgbuf) - (r + n + 1), r + k + 1, strlen(r + k + 1) + 1); + if (m) + (void)soap_memmove(r - 1, soap->msgbuf + sizeof(soap->msgbuf) - (r - 1), t, m); + } + else + { + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), s); + if (t) + { + int m = (int)strlen(soap->msgbuf); /* msgbuf length is max SOAP_TMPLEN or just 1024 bytes */ + (void)soap_encode_url(t, soap->msgbuf + m, (int)sizeof(soap->msgbuf) - m); + } + soap_strcat(soap->msgbuf, sizeof(soap->msgbuf), "&"); + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_encode_url(const char *s, char *t, int len) +{ + int c; + int n = len; + if (s && n > 0) + { + while ((c = *s++) && --n > 0) + { + if (c == '-' + || c == '.' + || (c >= '0' && c <= '9') + || (c >= 'A' && c <= 'Z') + || c == '_' + || (c >= 'a' && c <= 'z') + || c == '~') + { + *t++ = c; + } + else if (n > 2) + { + *t++ = '%'; + *t++ = (c >> 4) + (c > 159 ? '7' : '0'); + c &= 0xF; + *t++ = c + (c > 9 ? '7' : '0'); + n -= 2; + } + else + { + break; + } + } + *t = '\0'; + } + return len - n; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_encode_url_string(struct soap *soap, const char *s) +{ + if (s) + { + int n = 3 * (int)strlen(s) + 1; + char *t = (char*)soap_malloc(soap, n); + if (t) + { + (void)soap_encode_url(s, t, n); + return t; + } + } + return SOAP_STR_EOS; +} + +/******************************************************************************\ + * + * HTTP Cookies RFC 6265 + * +\******************************************************************************/ + +#ifdef WITH_COOKIES + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_cookie(struct soap *soap, const char *name, const char *domain, const char *path) +{ + return soap_cookie_env(soap, name, domain, path, 0); +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_cookie_env(struct soap *soap, const char *name, const char *domain, const char *path, short env) +{ + struct soap_cookie *p; + if (!domain && !env) + domain = soap->cookie_domain; + if (!path) + path = soap->cookie_path; + if (!path) + path = SOAP_STR_EOS; + else if (*path == '/') + path++; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Search cookie='%s' domain='%s' path='%s' env=%hd\n", name, domain ? domain : "(null)", path ? path : "(null)", env)); + for (p = soap->cookies; p; p = p->next) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie in database: %s='%s' domain='%s' path='%s' env=%hd\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->env)); + if ((!env || p->env) + && !strcmp(p->name, name) + && (!domain || (domain && p->domain && !strcmp(p->domain, domain))) + && (!path || (path && p->path && !strncmp(p->path, path, strlen(p->path))))) + break; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_set_cookie(struct soap *soap, const char *name, const char *value, const char *domain, const char *path) +{ + struct soap_cookie **p, *q; + int n; + if (!domain) + domain = soap->cookie_domain; + if (!path) + path = soap->cookie_path; + if (!path) + path = SOAP_STR_EOS; + else if (*path == '/') + path++; + q = soap_cookie(soap, name, domain, path); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set %scookie: %s='%s' domain='%s' path='%s'\n", q ? SOAP_STR_EOS : "new ", name, value ? value : "(null)", domain ? domain : "(null)", path ? path : "(null)")); + if (!q) + { + q = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie)); + if (q) + { + size_t l = strlen(name) + 1; + q->name = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->name = (char*)SOAP_MALLOC(soap, l); + if (q->name) + (void)soap_memcpy(q->name, l, name, l); + q->value = NULL; + q->domain = NULL; + q->path = NULL; + q->expire = 0; + q->maxage = -1; + q->version = 1; + q->secure = 0; + q->modified = 0; + for (p = &soap->cookies, n = soap->cookie_max; *p && n; p = &(*p)->next, n--) + if (!strcmp((*p)->name, name) && (*p)->path && path && strcmp((*p)->path, path) < 0) + break; + if (n) + { + q->next = *p; + *p = q; + } + else + { + SOAP_FREE(soap, q->name); + SOAP_FREE(soap, q); + q = NULL; + } + } + } + else + { + q->modified = 1; + } + if (q) + { + if (q->value) + { + if (!value || strcmp(value, q->value)) + { + SOAP_FREE(soap, q->value); + q->value = NULL; + } + } + if (value && *value && !q->value) + { + size_t l = strlen(value) + 1; + q->value = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->value = (char*)SOAP_MALLOC(soap, l); + if (q->value) + soap_strcpy(q->value, l, value); + } + if (q->domain) + { + if (!domain || strcmp(domain, q->domain)) + { + SOAP_FREE(soap, q->domain); + q->domain = NULL; + } + } + if (domain && !q->domain) + { + size_t l = strlen(domain) + 1; + q->domain = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->domain = (char*)SOAP_MALLOC(soap, l); + if (q->domain) + soap_strcpy(q->domain, l, domain); + } + if (q->path) + { + if (!path || strncmp(path, q->path, strlen(q->path))) + { + SOAP_FREE(soap, q->path); + q->path = NULL; + } + } + if (path && !q->path) + { + size_t l = strlen(path) + 1; + q->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + q->path = (char*)SOAP_MALLOC(soap, l); + if (q->path) + soap_strcpy(q->path, l, path); + } + q->session = 1; + q->env = 0; + } + return q; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_cookie(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie **p, *q; + if (!domain) + domain = soap->cookie_domain; + if (!domain) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error in clear cookie='%s': cookie domain not set\n", name ? name : "(null)")); + return; + } + if (!path) + path = soap->cookie_path; + if (!path) + path = SOAP_STR_EOS; + else if (*path == '/') + path++; + for (p = &soap->cookies, q = *p; q; q = *p) + { + if (!strcmp(q->name, name) && (!q->domain || !strcmp(q->domain, domain)) && (!q->path || !strncmp(q->path, path, strlen(q->path)))) + { + SOAP_FREE(soap, q->name); + if (q->value) + SOAP_FREE(soap, q->value); + if (q->domain) + SOAP_FREE(soap, q->domain); + if (q->path) + SOAP_FREE(soap, q->path); + *p = q->next; + SOAP_FREE(soap, q); + } + else + p = &q->next; + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + return p->value; + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_env_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p && p->env) + return p->value; + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +time_t +SOAP_FMAC2 +soap_cookie_expire(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + return (time_t)p->expire; + return -1; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_cookie_expire(struct soap *soap, const char *name, long maxage, const char *domain, const char *path) +{ + struct soap_cookie *p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie expiration max-age=%ld: cookie='%s' domain='%s' path='%s'\n", maxage, name, domain ? domain : "(null)", path ? path : "(null)")); + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->maxage = maxage; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_cookie_secure(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie secure: cookie='%s' domain='%s' path='%s'\n", name, domain ? domain : "(null)", path ? path : "(null)")); + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->secure = 1; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->session = 1; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_clr_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path) +{ + struct soap_cookie *p; + p = soap_cookie(soap, name, domain, path); + if (p) + { + p->session = 0; + p->modified = 1; + return SOAP_OK; + } + return SOAP_ERR; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putsetcookies(struct soap *soap) +{ + struct soap_cookie *p; + char *s, tmp[4096]; + const char *t; + for (p = soap->cookies; p; p = p->next) + { + if ((p->modified +#ifdef WITH_OPENSSL + || (!p->env && !soap->ssl == !p->secure) +#endif + ) && p->name && p->value && *p->name && *p->value) + { + s = tmp; + s += soap_encode_url(p->name, s, 3967); + *s++ = '='; + s += soap_encode_url(p->value, s, 3968 - (int)(s-tmp)); + t = p->domain ? p->domain : soap->cookie_domain; + if (t && (int)strlen(t) < 3968 - (int)(s-tmp)) + { + soap_strcpy(s, 4096 - (s-tmp), ";Domain="); + s += 8; + soap_strcpy(s, 4096 - (s-tmp), t); + s += strlen(s); + } + t = p->path ? p->path : soap->cookie_path; + if (t && (int)strlen(t) < 3976 - (int)(s-tmp)) + { + soap_strcpy(s, 4096 - (s-tmp), ";Path=/"); + s += 7; + if (*t == '/') + t++; + if (strchr(t, '%')) /* already URL encoded? */ + { + soap_strcpy(s, 4096 - (s-tmp), t); + s += strlen(s); + } + else + { + s += soap_encode_url(t, s, 4096 - (int)(s-tmp)); + } + } + if (p->version > 0 && s-tmp < 3983) + { + (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), ";Version=%u", p->version); + s += strlen(s); + } + if (p->maxage >= 0 && s-tmp < 4012) + { + (SOAP_SNPRINTF(s, 4096 - (s-tmp), 29), ";Max-Age=%ld", p->maxage); + s += strlen(s); + } +#if !defined(WITH_LEAN) +#if defined(HAVE_GMTIME_R) || defined(HAVE_GMTIME) + if (p->maxage >= 0 && s-tmp < 4041) + { + time_t n = time(NULL) + p->maxage; + struct tm T, *pT = &T; + size_t l = 0; + /* format is Wed, 09 Jun 2021 10:18:14 GMT */ +#if defined(HAVE_GMTIME_R) + if (gmtime_r(&n, pT) != SOAP_FUNC_R_ERR) + l = strftime(s, 4096 - (s-tmp), ";Expires=%a, %d %b %Y %H:%M:%S GMT", pT); +#else + pT = gmtime(&n); + if (pT) + l = strftime(s, 4096 - (s-tmp), ";Expires=%a, %d %b %Y %H:%M:%S GMT", pT); +#endif + s += l; + } +#endif +#endif + if (s-tmp < 4079 + && (p->secure +#ifdef WITH_OPENSSL + || soap->ssl +#endif + )) + { + soap_strcpy(s, 4096 - (s-tmp), ";Secure"); + s += strlen(s); + } + if (s-tmp < 4086) + soap_strcpy(s, 4096 - (s-tmp), ";HttpOnly"); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set-Cookie: %s\n", tmp)); + soap->error = soap->fposthdr(soap, "Set-Cookie", tmp); + if (soap->error) + return soap->error; + } + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putcookies(struct soap *soap, const char *domain, const char *path, int secure) +{ + struct soap_cookie **p, *q; + char *s, tmp[4096]; + unsigned int version = 0; + time_t now = time(NULL); + if (!domain || !path) + return SOAP_OK; + s = tmp; + p = &soap->cookies; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending cookies for domain='%s' path='%s'\n", domain, path)); + if (*path == '/') + path++; + while ((q = *p)) + { + if (q->expire && now >= (time_t)q->expire) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie %s expired\n", q->name)); + SOAP_FREE(soap, q->name); + if (q->value) + SOAP_FREE(soap, q->value); + if (q->domain) + SOAP_FREE(soap, q->domain); + if (q->path) + SOAP_FREE(soap, q->path); + *p = q->next; + SOAP_FREE(soap, q); + } + else + { + int flag; + char *t = q->domain; + size_t n = 0; + if (!t) + flag = 1; + else + { + const char *r = strchr(t, ':'); + if (r) + n = r - t; + else + n = strlen(t); + flag = !strncmp(t, domain, n); + } + /* domain-level cookies, cannot compile when WITH_NOIO set */ +#ifndef WITH_NOIO + if (!flag) + { + struct hostent hostent; + if (!tcp_gethostbyname(soap, (char*)domain, &hostent, NULL)) + { + const char *r = hostent.h_name; + if (*t == '.') + { + size_t k = strlen(hostent.h_name); + if (k >= n) + r = hostent.h_name + k - n; + } + flag = !strncmp(t, r, n); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Domain cookie %s host %s (match=%d)\n", t, r, flag)); + } + } +#endif + if (flag + && (!q->path || !strncmp(q->path, path, strlen(q->path))) +#ifndef WITH_INSECURE_COOKIES + && (!q->secure || secure) +#endif + ) + { + size_t n = 12; + if (q->name) + n += 3*strlen(q->name); + if (q->value && *q->value) + n += 3*strlen(q->value) + 1; + if (q->path && *q->path) + n += strlen(q->path) + 9; + if (q->domain) + n += strlen(q->domain) + 11; + if (s + n >= tmp + sizeof(tmp)) + { + if (s == tmp) + return SOAP_OK; /* header too big, cannot split */ + /* split up HTTP header */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie: %s\n", tmp)); + soap->error = soap->fposthdr(soap, "Cookie", tmp); + if (soap->error) + return soap->error; + s = tmp; + } + else if (s != tmp) + { + *s++ = ';'; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending cookie %s=%s path=\"/%s\" domain=\"%s\"\n", q->name ? q->name : "(null)", q->value ? q->value : "(null)", q->path ? q->path : "(null)", q->domain ? q->domain : "(null)")); + if (q->version != version && (s-tmp) + (size_t)36 < sizeof(tmp)) + { + (SOAP_SNPRINTF_SAFE(s, sizeof(tmp) - (s-tmp)), "$Version=%u;", q->version); + version = q->version; + s += strlen(s); + } + if (q->name && (s-tmp) + strlen(q->name) + (size_t)15 < sizeof(tmp)) + { + s += soap_encode_url(q->name, s, (int)(tmp+sizeof(tmp)-s)-15); + } + if (q->value && *q->value && (s-tmp) + strlen(q->value) + (size_t)16 < sizeof(tmp)) + { + *s++ = '='; + s += soap_encode_url(q->value, s, (int)(tmp+sizeof(tmp)-s)-16); + } + if (q->path && (s-tmp) + strlen(q->path) + (size_t)36 < sizeof(tmp)) + { + (SOAP_SNPRINTF_SAFE(s, sizeof(tmp) - (s-tmp)), ";$Path=\"/%s\"", (*q->path == '/' ? q->path + 1 : q->path)); + s += strlen(s); + } + if (q->domain && (s-tmp) + strlen(q->domain) + (size_t)36 < sizeof(tmp)) + { + (SOAP_SNPRINTF_SAFE(s, sizeof(tmp) - (s-tmp)), ";$Domain=\"%s\"", q->domain); + s += strlen(s); + } + } + p = &q->next; + } + } + if (s != tmp) + { + soap->error = soap->fposthdr(soap, "Cookie", tmp); + if (soap->error) + return soap->error; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_getcookies(struct soap *soap, const char *val) +{ + struct soap_cookie *p = NULL, *q; + const char *s; + char *t, tmp[4096]; /* cookie size is up to 4096 bytes [RFC2109] */ + char *domain = NULL; + char *path = NULL; + unsigned int version = 0; + time_t now = time(NULL); + if (!val) + return; + s = val; + while (*s) + { + s = soap_decode_key(tmp, sizeof(tmp), s); + if (!soap_tag_cmp(tmp, "$Version")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + if (s) + { + if (p) + p->version = (int)soap_strtol(tmp, NULL, 10); + else + version = (int)soap_strtol(tmp, NULL, 10); + } + } + else if (!soap_tag_cmp(tmp, "$Path")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + t = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + t = (char*)SOAP_MALLOC(soap, l); + if (t) + (void)soap_memcpy((void*)t, l, (const void*)tmp, l); + } + else + { + t = NULL; + } + if (p) + { + if (p->path) + SOAP_FREE(soap, p->path); + p->path = t; + } + else + { + if (path) + SOAP_FREE(soap, path); + path = t; + } + } + else if (!soap_tag_cmp(tmp, "$Domain")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + t = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + t = (char*)SOAP_MALLOC(soap, l); + if (t) + (void)soap_memcpy((void*)t, l, (const void*)tmp, l); + } + else + { + t = NULL; + } + if (p) + { + if (p->domain) + SOAP_FREE(soap, p->domain); + p->domain = t; + } + else + { + if (domain) + SOAP_FREE(soap, domain); + domain = t; + } + } + else if (p && !soap_tag_cmp(tmp, "Path")) + { + if (p->path) + SOAP_FREE(soap, p->path); + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + p->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->path = (char*)SOAP_MALLOC(soap, l); + if (p->path) + (void)soap_memcpy((void*)p->path, l, (const void*)tmp, l); + } + else + { + p->path = NULL; + } + } + else if (p && !soap_tag_cmp(tmp, "Domain")) + { + if (p->domain) + SOAP_FREE(soap, p->domain); + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + size_t l = strlen(tmp) + 1; + p->domain = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->domain = (char*)SOAP_MALLOC(soap, l); + if (p->domain) + (void)soap_memcpy((void*)p->domain, l, (const void*)tmp, l); + } + else + { + p->domain = NULL; + } + } + else if (p && !soap_tag_cmp(tmp, "Version")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + p->version = (unsigned int)soap_strtoul(tmp, NULL, 10); + } + else if (p && !soap_tag_cmp(tmp, "Max-Age")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + p->expire = (ULONG64)(now + soap_strtol(tmp, NULL, 10)); + } + else if (p && !soap_tag_cmp(tmp, "Expires")) + { + if (*s == '=') + { + s = soap_decode(tmp, sizeof(tmp), s + 1, ";"); + if (!p->expire && strlen(tmp) >= 23) + { + char a[3]; + struct tm T; + static const char mns[] = "anebarprayunulugepctovec"; + const char *t = strchr(tmp, ' '); + if (t) + { + a[2] = '\0'; + memset((void*)&T, 0, sizeof(T)); + if (t[1] >= 'A') + { + /* format is Sun Nov 6 08:49:37 94 */ + a[0] = t[2]; + a[1] = t[3]; + T.tm_mon = (int)(strstr(mns, a) - mns) / 2; + a[0] = t[5]; + a[1] = t[6]; + T.tm_mday = (int)soap_strtol(a, NULL, 10); + if (t[17] && t[18] && t[19] != ' ') + t += 2; /* format is Sun Nov 6 08:49:37 2017 - ANSI-C */ + a[0] = t[17]; + a[1] = t[18]; + T.tm_year = 100 + (int)soap_strtol(a, NULL, 10); + t += 6; + } + else + { + /* format is Sunday, 06-Nov-17 08:49:37 GMT - RFC 850 */ + a[0] = t[1]; + a[1] = t[2]; + T.tm_mday = (int)soap_strtol(a, NULL, 10); + a[0] = t[5]; + a[1] = t[6]; + T.tm_mon = (int)(strstr(mns, a) - mns) / 2; + if (t[10] != ' ') + t += 2; /* format is Wed, 09 Jun 2021 10:18:14 GMT - RFC 822 */ + a[0] = t[8]; + a[1] = t[9]; + T.tm_year = 100 + (int)soap_strtol(a, NULL, 10); + t += 11; + } + a[0] = t[0]; + a[1] = t[1]; + T.tm_hour = (int)soap_strtol(a, NULL, 10); + a[0] = t[3]; + a[1] = t[4]; + T.tm_min = (int)soap_strtol(a, NULL, 10); + a[0] = t[6]; + a[1] = t[7]; + T.tm_sec = (int)soap_strtol(a, NULL, 10); + p->expire = (ULONG64)soap_timegm(&T); + } + } + } + } + else if (p && !soap_tag_cmp(tmp, "Secure")) + { + p->secure = 1; + s = soap_decode_val(tmp, sizeof(tmp), s); + } + else if (p && !soap_tag_cmp(tmp, "HttpOnly")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + } + else if (p && !soap_tag_cmp(tmp, "Comment")) + { + s = soap_decode_val(tmp, sizeof(tmp), s); + } + else if (*tmp) + { + if (p) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie='%s' value='%s' domain='%s' path='%s' expire=" SOAP_ULONG_FORMAT " secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure)); + q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path); + if (q) + { + q->version = p->version; + q->expire = p->expire; + q->secure = p->secure; + q->env = 1; + } + if (p->name) + SOAP_FREE(soap, p->name); + if (p->value) + SOAP_FREE(soap, p->value); + if (p->domain) + SOAP_FREE(soap, p->domain); + if (p->path) + SOAP_FREE(soap, p->path); + SOAP_FREE(soap, p); + } + p = (struct soap_cookie*)SOAP_MALLOC(soap, sizeof(struct soap_cookie)); + if (p) + { + size_t l = strlen(tmp) + 1; + p->name = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->name = (char*)SOAP_MALLOC(soap, l); + if (p->name) + (void)soap_memcpy(p->name, l, tmp, l); + s = soap_decode_val(tmp, sizeof(tmp), s); + if (*tmp) + { + l = strlen(tmp) + 1; + p->value = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->value = (char*)SOAP_MALLOC(soap, l); + if (p->value) + (void)soap_memcpy((void*)p->value, l, (const void*)tmp, l); + } + else + { + p->value = NULL; + } + if (domain) + { + p->domain = domain; + } + else + { + p->domain = NULL; + } + if (path) + { + p->path = path; + } + else if (*soap->path) + { + l = strlen(soap->path) + 1; + p->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + p->path = (char*)SOAP_MALLOC(soap, l); + if (p->path) + (void)soap_memcpy((void*)p->path, l, (const void*)soap->path, l); + } + else + { + p->path = (char*)SOAP_MALLOC(soap, 2); + if (p->path) + (void)soap_memcpy((void*)p->path, 2, (const void*)"/", 2); + } + p->expire = 0; + p->secure = 0; + p->version = version; + } + } + } + if (p) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie='%s' value='%s' domain='%s' path='%s' expire=" SOAP_ULONG_FORMAT " secure=%d\n", p->name, p->value ? p->value : "(null)", p->domain ? p->domain : "(null)", p->path ? p->path : "(null)", p->expire, p->secure)); + q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path); + if (q) + { + q->version = p->version; + q->expire = p->expire; + q->secure = p->secure; + q->env = 1; + } + if (p->name) + SOAP_FREE(soap, p->name); + if (p->value) + SOAP_FREE(soap, p->value); + if (p->domain) + SOAP_FREE(soap, p->domain); + if (p->path) + SOAP_FREE(soap, p->path); + SOAP_FREE(soap, p); + } + if (domain) + SOAP_FREE(soap, domain); + if (path) + SOAP_FREE(soap, path); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getenv_cookies(struct soap *soap) +{ + struct soap_cookie *p; + const char *s; + char key[4096], val[4096]; /* cookie size is up to 4096 bytes [RFC2109] */ + s = getenv("HTTP_COOKIE"); + if (!s) + return SOAP_ERR; + do + { + s = soap_decode_key(key, sizeof(key), s); + s = soap_decode_val(val, sizeof(val), s); + p = soap_set_cookie(soap, key, val, NULL, NULL); + if (p) + p->env = 1; + } while (*s); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_cookie* +SOAP_FMAC2 +soap_copy_cookies(struct soap *copy, const struct soap *soap) +{ + struct soap_cookie *p, **q, *r; + (void)copy; + q = &r; + for (p = soap->cookies; p; p = p->next) + { + *q = (struct soap_cookie*)SOAP_MALLOC(copy, sizeof(struct soap_cookie)); + if (!*q) + return r; + **q = *p; + if (p->name) + { + size_t l = strlen(p->name) + 1; + (*q)->name = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->name = (char*)SOAP_MALLOC(copy, l); + if ((*q)->name) + (void)soap_memcpy((*q)->name, l, p->name, l); + } + if (p->value) + { + size_t l = strlen(p->value) + 1; + (*q)->value = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->value = (char*)SOAP_MALLOC(copy, l); + if ((*q)->value) + (void)soap_memcpy((*q)->value, l, p->value, l); + } + if (p->domain) + { + size_t l = strlen(p->domain) + 1; + (*q)->domain = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->domain = (char*)SOAP_MALLOC(copy, l); + if ((*q)->domain) + (void)soap_memcpy((*q)->domain, l, p->domain, l); + } + if (p->path) + { + size_t l = strlen(p->path) + 1; + (*q)->path = NULL; + if (SOAP_MAXALLOCSIZE <= 0 || l <= SOAP_MAXALLOCSIZE) + (*q)->path = (char*)SOAP_MALLOC(copy, l); + if ((*q)->path) + (void)soap_memcpy((*q)->path, l, p->path, l); + } + q = &(*q)->next; + } + *q = NULL; + return r; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free_cookies(struct soap *soap) +{ + struct soap_cookie *p; + for (p = soap->cookies; p; p = soap->cookies) + { + soap->cookies = p->next; + SOAP_FREE(soap, p->name); + if (p->value) + SOAP_FREE(soap, p->value); + if (p->domain) + SOAP_FREE(soap, p->domain); + if (p->path) + SOAP_FREE(soap, p->path); + SOAP_FREE(soap, p); + } +} + +/******************************************************************************/ + +#endif /* WITH_COOKIES */ + +/******************************************************************************/ + +SOAP_FMAC1 +size_t +SOAP_FMAC2 +soap_hash(const char *s) +{ + size_t h = 0; + while (*s) + h = 65599*h + *s++; + return h % SOAP_IDHASH; +} + +/******************************************************************************/ + +static void +soap_init_pht(struct soap *soap) +{ + int i; + soap->pblk = NULL; + soap->pidx = 0; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + soap->pht[i] = NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap* +SOAP_FMAC2 +soap_versioning(soap_new)(soap_mode imode, soap_mode omode) +{ + struct soap *soap; +#ifdef __cplusplus + soap = SOAP_NEW_UNMANAGED(struct soap); +#else + soap = (struct soap*)SOAP_MALLOC_UNMANAGED(sizeof(struct soap)); +#endif + if (soap) + soap_versioning(soap_init)(soap, imode, omode); + return soap; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free(struct soap *soap) +{ + soap_done(soap); +#ifdef __cplusplus + SOAP_DELETE_UNMANAGED(soap); +#else + SOAP_FREE_UNMANAGED(soap); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_del(struct soap *soap) +{ + free(soap); +} + +/******************************************************************************/ + +static void +soap_free_pht(struct soap *soap) +{ + struct soap_pblk *pb, *next; + int i; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free pointer hashtable\n")); + for (pb = soap->pblk; pb; pb = next) + { + next = pb->next; + SOAP_FREE(soap, pb); + } + soap->pblk = NULL; + soap->pidx = 0; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + soap->pht[i] = NULL; +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_embed(struct soap *soap, const void *p, const void *a, int n, int t) +{ + int id; + struct soap_plist *pp; + if (soap->version == 2) + soap->encoding = 1; + if (!p || (!soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH)) || (soap->mode & SOAP_XML_TREE)) + return 0; + if (a) + id = soap_array_pointer_lookup(soap, p, a, n, t, &pp); + else + id = soap_pointer_lookup(soap, p, t, &pp); + if (id) + { + if (soap_is_embedded(soap, pp) + || soap_is_single(soap, pp)) + return 0; + soap_set_embedded(soap, pp); + } + return id; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp) +{ + struct soap_plist *pp; + *ppp = NULL; + if (p) + { + for (pp = soap->pht[soap_hash_ptr(p)]; pp; pp = pp->next) + { + if (pp->ptr == p && pp->type == type) + { + *ppp = pp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d id=%d\n", p, type, pp->id)); + return pp->id; + } + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d: not found\n", p, type)); + return 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_pointer_enter(struct soap *soap, const void *p, const void *a, int n, int type, struct soap_plist **ppp) +{ + size_t h; + struct soap_plist *pp; + (void)n; + if (!soap->pblk || soap->pidx >= SOAP_PTRBLK) + { + struct soap_pblk *pb = (struct soap_pblk*)SOAP_MALLOC(soap, sizeof(struct soap_pblk)); + if (!pb) + { + soap->error = SOAP_EOM; + return 0; + } + pb->next = soap->pblk; + soap->pblk = pb; + soap->pidx = 0; + } + *ppp = pp = &soap->pblk->plist[soap->pidx++]; + if (a) + h = soap_hash_ptr(a); + else + h = soap_hash_ptr(p); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%lu type=%d id=%d\n", p, a, (unsigned long)n, type, soap->idnum+1)); + pp->next = soap->pht[h]; + pp->type = type; + pp->mark1 = 0; + pp->mark2 = 0; + pp->ptr = p; + pp->dup = NULL; + pp->array = a; + pp->size = n; + soap->pht[h] = pp; + pp->id = ++soap->idnum; + return pp->id; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_array_pointer_lookup(struct soap *soap, const void *p, const void *a, int n, int type, struct soap_plist **ppp) +{ + struct soap_plist *pp; + *ppp = NULL; + if (!p || !a) + return 0; + for (pp = soap->pht[soap_hash_ptr(a)]; pp; pp = pp->next) + { + if (pp->type == type && pp->array == a && pp->size == n) + { + *ppp = pp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a, type, pp->id)); + return pp->id; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a, type)); + return 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_count(struct soap *soap) +{ + soap_free_ns(soap); + soap->error = SOAP_OK; +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_DIME) || (soap->omode & SOAP_ENC_DIME)) + { + soap->mode = soap->omode | SOAP_IO_LENGTH | SOAP_ENC_DIME; + } + else +#endif + { + soap->mode = soap->omode; + if ((soap->mode & SOAP_IO_UDP)) + { + soap->mode &= SOAP_IO; + soap->mode |= SOAP_IO_BUFFER | SOAP_ENC_PLAIN; + } + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE + || (((soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_ENC_PLAIN)) +#ifndef WITH_LEANER + && !soap->fpreparesend +#endif + )) + soap->mode &= ~SOAP_IO_LENGTH; + else + soap->mode |= SOAP_IO_LENGTH; + } +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH) + { + if (!(soap->mode & SOAP_ENC_DIME)) + soap->mode &= ~SOAP_IO_LENGTH; + if ((soap->mode & SOAP_ENC_PLAIN)) + soap->mode |= SOAP_IO_BUFFER; + else + soap->mode |= SOAP_IO_STORE; + } +#endif +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME)) + soap->mode |= SOAP_ENC_MIME; + else if (!(soap->mode & SOAP_ENC_MIME)) + soap->mode &= ~SOAP_ENC_MTOM; + if ((soap->mode & SOAP_ENC_MIME)) + soap_select_mime_boundary(soap); + soap->dime.list = soap->dime.last; /* keep track of last DIME attachment */ +#endif + soap->count = 0; + soap->ns = 0; + soap->null = 0; + soap->position = 0; + soap->mustUnderstand = 0; + soap->encoding = 0; + soap->part = SOAP_BEGIN_SEND; + soap->event = 0; + soap->evlev = 0; + soap->idnum = 0; + soap->body = 1; + soap->level = 0; + soap_clr_attr(soap); + soap_set_local_namespaces(soap); +#ifndef WITH_LEANER + soap->dime.size = 0; /* accumulate total size of attachments */ + if (soap->fprepareinitsend && (soap->mode & SOAP_IO) != SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)) != SOAP_OK) + return soap->error; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=0x%x count=" SOAP_ULONG_FORMAT ")\n", (int)soap->socket, (unsigned int)soap->mode, soap->count)); +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO_LENGTH)) + return soap_begin_attachments(soap); +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_count(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of count phase\n")); +#ifndef WITH_LEANER + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (soap_end_attachments(soap)) + return soap->error; + if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)) != SOAP_OK) + return soap->error; + } +#else + (void)soap; +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +static int +soap_init_send(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for output to socket=%d/fd=%d\n", (int)soap->socket, soap->sendfd)); + *soap->tag = '\0'; + soap_free_ns(soap); + soap->error = SOAP_OK; + soap->mode = soap->omode | (soap->mode & (SOAP_IO_LENGTH | SOAP_ENC_DIME)); +#ifndef WITH_LEAN + if ((soap->mode & SOAP_IO_UDP)) + { + soap->mode &= ~SOAP_IO; + soap->mode |= SOAP_IO_BUFFER | SOAP_ENC_PLAIN; + if ((soap->mode & SOAP_IO_LENGTH) && soap->count > sizeof(soap->buf)) + return soap->error = SOAP_UDP_ERROR; + } +#endif +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH) + { + if ((soap->mode & SOAP_ENC_PLAIN)) + soap->mode |= SOAP_IO_BUFFER; + else + soap->mode |= SOAP_IO_STORE; + } +#endif +#if !defined(__cplusplus) || defined(WITH_COMPAT) + if (soap->os) + { + *soap->os = NULL; + soap->mode = (soap->mode & ~SOAP_IO) | SOAP_IO_STORE; + } + else +#endif + if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH && soap_valid_socket(soap->socket)) + { + if ((soap->mode & SOAP_IO_LENGTH) || (soap->mode & SOAP_ENC_PLAIN)) + soap->mode |= SOAP_IO_BUFFER; + else + soap->mode |= SOAP_IO_STORE; + } + soap->mode &= ~SOAP_IO_LENGTH; + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE && soap_alloc_block(soap) == NULL) + return soap->error; + if (!(soap->mode & SOAP_IO_KEEPALIVE)) + soap->keep_alive = 0; +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME)) + { + soap->mode |= SOAP_ENC_MIME; + soap->mode &= ~SOAP_ENC_DIME; + } + else if (!(soap->mode & SOAP_ENC_MIME)) + { + soap->mode &= ~SOAP_ENC_MTOM; + } + if ((soap->mode & SOAP_ENC_MIME)) + soap_select_mime_boundary(soap); +#ifdef WIN32 +#ifndef UNDER_CE +#ifndef WITH_FASTCGI + if (!soap_valid_socket(soap->socket) && !soap->os && soap->sendfd >= 0) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */ +#ifdef __BORLANDC__ + setmode(soap->sendfd, _O_BINARY); +#else + _setmode(soap->sendfd, _O_BINARY); +#endif +#endif +#endif +#endif +#endif + if ((soap->mode & SOAP_IO)) + soap->buflen = soap->bufidx = 0; + soap->chunksize = 0; + soap->ns = 0; + soap->null = 0; + soap->position = 0; + soap->mustUnderstand = 0; + soap->encoding = 0; + soap->event = 0; + soap->evlev = 0; + soap->idnum = 0; + soap->body = 1; + soap->level = 0; + soap_clr_attr(soap); + soap_set_local_namespaces(soap); +#ifdef WITH_ZLIB + soap->z_ratio_out = 1.0; + if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state != SOAP_ZLIB_DEFLATE) + { + if (!soap->d_stream) + { + soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream)); + if (!soap->d_stream) + return soap->error = SOAP_EOM; + soap->d_stream->zalloc = Z_NULL; + soap->d_stream->zfree = Z_NULL; + soap->d_stream->opaque = Z_NULL; + soap->d_stream->next_in = Z_NULL; + } + if (!soap->z_buf) + soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf)); + if (!soap->z_buf) + return soap->error = SOAP_EOM; + soap->d_stream->next_out = (Byte*)soap->z_buf; + soap->d_stream->avail_out = sizeof(soap->buf); +#ifdef WITH_GZIP + if (soap->zlib_out != SOAP_ZLIB_DEFLATE) + { + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)"\37\213\10\0\0\0\0\0\0\377", 10); + soap->d_stream->next_out = (Byte*)soap->z_buf + 10; + soap->d_stream->avail_out = sizeof(soap->buf) - 10; + soap->z_crc = crc32(0L, NULL, 0); + soap->zlib_out = SOAP_ZLIB_GZIP; + if (soap->z_dict) + *((Byte*)soap->z_buf + 2) = 0xff; + if (deflateInit2(soap->d_stream, soap->z_level, Z_DEFLATED, -MAX_WBITS, 8, Z_DEFAULT_STRATEGY) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + else +#endif + if (deflateInit(soap->d_stream, soap->z_level) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + if (soap->z_dict) + { + if (deflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflate initialized\n")); + soap->zlib_state = SOAP_ZLIB_DEFLATE; + } +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + ERR_clear_error(); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=0x%x count=" SOAP_ULONG_FORMAT ")\n", (int)soap->socket, soap->mode, soap->count)); + soap->part = SOAP_BEGIN_SEND; +#ifndef WITH_LEANER + if (soap->fprepareinitsend && (soap->mode & SOAP_IO) == SOAP_IO_STORE && (soap->error = soap->fprepareinitsend(soap)) != SOAP_OK) + return soap->error; +#endif +#ifndef WITH_LEAN + soap->start = (ULONG64)time(NULL); +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_send(struct soap *soap) +{ +#ifndef WITH_LEANER + if (soap_init_send(soap)) + return soap->error; + return soap_begin_attachments(soap); +#else + return soap_init_send(soap); +#endif +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_embedded(struct soap *soap, const void *p, int t) +{ + struct soap_plist *pp; + if (soap_pointer_lookup(soap, p, t, &pp)) + { + pp->mark1 = 1; + pp->mark2 = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded %p type=%d mark set to 1\n", p, t)); + } +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_reference(struct soap *soap, const void *p, int t) +{ + struct soap_plist *pp; + if (!p || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME | SOAP_ENC_MIME | SOAP_ENC_MTOM | SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE)) + return 1; + if (soap_pointer_lookup(soap, p, t, &pp)) + { + if (pp->mark1 == 0) + { + pp->mark1 = 2; + pp->mark2 = 2; + } + } + else if (!soap_pointer_enter(soap, p, NULL, 0, t, &pp)) + { + return 1; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reference %p type=%d (%d %d)\n", p, t, (int)pp->mark1, (int)pp->mark2)); + return pp->mark1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_array_reference(struct soap *soap, const void *p, const void *a, int n, int t) +{ + struct soap_plist *pp; + if (!p || !a || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE)) + return 1; + if (soap_array_pointer_lookup(soap, p, a, n, t, &pp)) + { + if (pp->mark1 == 0) + { + pp->mark1 = 2; + pp->mark2 = 2; + } + } + else if (!soap_pointer_enter(soap, p, a, n, t, &pp)) + { + return 1; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p n=%lu t=%d (%d %d)\n", p, a, (unsigned long)n, t, (int)pp->mark1, (int)pp->mark2)); + return pp->mark1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attachment_reference(struct soap *soap, const void *p, const void *a, int n, int t, const char *id, const char *type) +{ + struct soap_plist *pp; + if (!p || !a || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH) && !id && !type) || (soap->omode & SOAP_XML_TREE)) + return 1; + if (soap_array_pointer_lookup(soap, p, a, n, t, &pp)) + { + if (pp->mark1 == 0) + { + pp->mark1 = 2; + pp->mark2 = 2; + } + } + else if (!soap_pointer_enter(soap, p, a, n, t, &pp)) + { + return 1; + } + if (id || type) + soap->mode |= SOAP_ENC_DIME; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment reference %p ptr=%p n=%lu t=%d (%d %d)\n", p, a, (unsigned long)n, t, (int)pp->mark1, (int)pp->mark2)); + return pp->mark1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_embedded_id(struct soap *soap, int id, const void *p, int t) +{ + struct soap_plist *pp = NULL; + if (id >= 0 || (!soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH)) || (soap->omode & SOAP_XML_TREE)) + return id; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id %p type=%d id=%d\n", p, t, id)); + if (id < -1) + return soap_embed(soap, p, NULL, 0, t); + if (id < 0) + { + id = soap_pointer_lookup(soap, p, t, &pp); + if (soap->version == 1 && soap->part != SOAP_IN_HEADER) + { + if (id) + { + if ((soap->mode & SOAP_IO_LENGTH)) + pp->mark1 = 2; + else + pp->mark2 = 2; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id multiref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2)); + } + return -1; + } + else if (id) + { + if ((soap->mode & SOAP_IO_LENGTH)) + pp->mark1 = 1; + else + pp->mark2 = 1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id embedded ref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2)); + } + } + return id; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_is_embedded(struct soap *soap, struct soap_plist *pp) +{ + if (!pp) + return 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Is embedded? %d %d\n", (int)pp->mark1, (int)pp->mark2)); + if (soap->version == 1 && soap->encodingStyle && !(soap->omode & SOAP_XML_GRAPH) && soap->part != SOAP_IN_HEADER) + { + if ((soap->mode & SOAP_IO_LENGTH)) + return pp->mark1 != 0; + return pp->mark2 != 0; + } + if ((soap->mode & SOAP_IO_LENGTH)) + return pp->mark1 == 1; + return pp->mark2 == 1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_is_single(struct soap *soap, struct soap_plist *pp) +{ + if (soap->part == SOAP_IN_HEADER) + return 1; + if (!pp) + return 0; + if ((soap->mode & SOAP_IO_LENGTH)) + return pp->mark1 == 0; + return pp->mark2 == 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_embedded(struct soap *soap, struct soap_plist *pp) +{ + if (!pp) + return; + if ((soap->mode & SOAP_IO_LENGTH)) + pp->mark1 = 1; + else + pp->mark2 = 1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attachment(struct soap *soap, const char *tag, int id, const void *p, const void *a, int n, const char *aid, const char *atype, const char *aoptions, const char *type, int t) +{ + struct soap_plist *pp; + int i; + if (!p || !a || (!aid && !atype) || (!soap->encodingStyle && !(soap->omode & (SOAP_ENC_DIME | SOAP_ENC_MIME | SOAP_ENC_MTOM | SOAP_XML_GRAPH))) || (soap->omode & SOAP_XML_TREE)) + return soap_element_id(soap, tag, id, p, a, n, type, t, NULL); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid ? aid : SOAP_STR_EOS, id, atype ? atype : SOAP_STR_EOS)); + i = soap_array_pointer_lookup(soap, p, a, n, t, &pp); + if (!i) + { + i = soap_pointer_enter(soap, p, a, n, t, &pp); + if (!i) + { + soap->error = SOAP_EOM; + return -1; + } + } + if (id <= 0) + id = i; + if (!aid) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(soap->dime_id_format) + 20), soap->dime_id_format, id); + aid = soap_strdup(soap, soap->tmpbuf); + if (!aid) + return -1; + } + /* Add MTOM xop:Include element when necessary */ + /* TODO: this code to be obsoleted with new import/xop.h conventions */ + if ((soap->omode & SOAP_ENC_MTOM) && strcmp(tag, "xop:Include")) + { + if (soap_element_begin_out(soap, tag, 0, type) + || soap_element_href(soap, "xop:Include", 0, "xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href", aid) + || soap_element_end_out(soap, tag)) + return soap->error; + } + else if (soap_element_href(soap, tag, 0, "href", aid)) + { + return soap->error; + } + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (pp->mark1 != 3) + { + struct soap_multipart *content; + if ((soap->omode & SOAP_ENC_MTOM)) + content = soap_alloc_multipart(soap, &soap->mime.first, &soap->mime.last, (const char*)a, n); + else + content = soap_alloc_multipart(soap, &soap->dime.first, &soap->dime.last, (const char*)a, n); + if (!content) + { + soap->error = SOAP_EOM; + return -1; + } + if (!strncmp(aid, "cid:", 4)) /* RFC 2111 */ + { + if ((soap->omode & SOAP_ENC_MTOM)) + { + size_t l = strlen(aid) - 1; + char *s = (char*)soap_malloc(soap, l); + if (s) + { + s[0] = '<'; + (void)soap_strncpy(s + 1, l - 1, aid + 4, l - 3); + s[l - 2] = '>'; + s[l - 1] = '\0'; + content->id = s; + } + } + else + { + content->id = aid + 4; + } + } + else + { + content->id = aid; + } + content->type = atype; + content->options = aoptions; + content->encoding = SOAP_MIME_BINARY; + pp->mark1 = 3; + } + } + else + { + pp->mark2 = 3; + } + return -1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static void +soap_init_iht(struct soap *soap) +{ + int i; + for (i = 0; i < SOAP_IDHASH; i++) + soap->iht[i] = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static void +soap_free_iht(struct soap *soap) +{ + int i; + struct soap_ilist *ip = NULL, *p = NULL; + struct soap_flist *fp = NULL, *fq = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free ID hashtable\n")); + for (i = 0; i < SOAP_IDHASH; i++) + { + for (ip = soap->iht[i]; ip; ip = p) + { + for (fp = ip->flist; fp; fp = fq) + { + fq = fp->next; + SOAP_FREE(soap, fp); + } + p = ip->next; + SOAP_FREE(soap, ip); + } + soap->iht[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +struct soap_ilist * +SOAP_FMAC2 +soap_lookup(struct soap *soap, const char *id) +{ + struct soap_ilist *ip = NULL; + for (ip = soap->iht[soap_hash(id)]; ip; ip = ip->next) + if (!strcmp(ip->id, id)) + return ip; + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +struct soap_ilist * +SOAP_FMAC2 +soap_enter(struct soap *soap, const char *id, int t, size_t n) +{ + size_t h; + struct soap_ilist *ip = NULL; + size_t l = strlen(id); + if (sizeof(struct soap_ilist) + l > l && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_ilist) + l <= SOAP_MAXALLOCSIZE)) + ip = (struct soap_ilist*)SOAP_MALLOC(soap, sizeof(struct soap_ilist) + l); + if (ip) + { + ip->type = t; + ip->size = n; + ip->ptr = NULL; + ip->spine = NULL; + ip->link = NULL; + ip->copy = NULL; + ip->flist = NULL; + ip->smart = NULL; + ip->shaky = 0; + (void)soap_memcpy((char*)ip->id, l + 1, id, l + 1); + h = soap_hash(id); /* h = (HASH(id) % SOAP_IDHASH) so soap->iht[h] is safe */ + ip->next = soap->iht[h]; + soap->iht[h] = ip; + } + return ip; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_malloc(struct soap *soap, size_t n) +{ + char *p; + size_t k = n; + if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE) + { + soap->error = SOAP_EOM; + return NULL; + } + if (!soap) + return SOAP_MALLOC(soap, n); + n += sizeof(short); + n += (~n+1) & (sizeof(void*)-1); /* align at 4-, 8- or 16-byte boundary by rounding up */ + if (n + sizeof(void*) + sizeof(size_t) < k) + { + soap->error = SOAP_EOM; + return NULL; + } + p = (char*)SOAP_MALLOC(soap, n + sizeof(void*) + sizeof(size_t)); + if (!p) + { + soap->error = SOAP_EOM; + return NULL; + } + /* set a canary word to detect memory overruns and data corruption */ + *(unsigned short*)(p + n - sizeof(unsigned short)) = (unsigned short)SOAP_CANARY; + /* keep chain of alloced cells for destruction */ + *(void**)(p + n) = soap->alist; + *(size_t*)(p + n + sizeof(void*)) = n; + soap->alist = p + n; + return p; +} + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +static void +soap_init_mht(struct soap *soap) +{ + int i; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + soap->mht[i] = NULL; +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +static void +soap_free_mht(struct soap *soap) +{ + int i; + struct soap_mlist *mp, *mq; + for (i = 0; i < (int)SOAP_PTRHASH; i++) + { + for (mp = soap->mht[i]; mp; mp = mq) + { + mq = mp->next; + if (mp->live) + fprintf(stderr, "%s(%d): malloc() = %p not freed (memory leak or forgot to call soap_end()?)\n", mp->file, mp->line, mp->ptr); + free(mp); + } + soap->mht[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_track_malloc(struct soap *soap, const char *file, int line, size_t size) +{ + void *p = malloc(size); + if (soap) + { + size_t h = soap_hash_ptr(p); + struct soap_mlist *mp = (struct soap_mlist*)malloc(sizeof(struct soap_mlist)); + if (soap->fdebug[SOAP_INDEX_TEST]) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): malloc(%lu) = %p\n", file, line, (unsigned long)size, p)); + } + mp->next = soap->mht[h]; + mp->ptr = p; + mp->file = file; + mp->line = line; + mp->live = 1; + soap->mht[h] = mp; + } + return p; +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_track_free(struct soap *soap, const char *file, int line, void *p) +{ + if (!soap) + { + free(p); + } + else + { + size_t h = soap_hash_ptr(p); + struct soap_mlist *mp; + for (mp = soap->mht[h]; mp; mp = mp->next) + if (mp->ptr == p) + break; + if (mp) + { + if (mp->live) + { + if (soap->fdebug[SOAP_INDEX_TEST]) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): free(%p)\n", file, line, p)); + } + free(p); + mp->live = 0; + } + else + { + fprintf(stderr, "%s(%d): free(%p) double free of pointer malloced at %s(%d)\n", file, line, p, mp->file, mp->line); + } + } + else + { + fprintf(stderr, "%s(%d): free(%p) pointer not malloced\n", file, line, p); + } + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_MEM_DEBUG +static void +soap_track_unlink(struct soap *soap, const void *p) +{ + size_t h = soap_hash_ptr(p); + struct soap_mlist *mp; + for (mp = soap->mht[h]; mp; mp = mp->next) + if (mp->ptr == p) + break; + if (mp) + mp->live = 0; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_dealloc(struct soap *soap, void *p) +{ + if (soap_check_state(soap)) + return; + if (p) + { + char **q; + for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q) + { + if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY) + { +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n"); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n")); + DBGHEX(TEST, *q - 200, 200); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n")); + soap->error = SOAP_MOE; + return; + } + if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*)))) + { + *q = **(char***)q; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Freed data at %p\n", p)); + SOAP_FREE(soap, p); + return; + } + } + soap_delete(soap, p); + } + else + { + char *q; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free all soap_malloc() data\n")); + while (soap->alist) + { + q = (char*)soap->alist; + if (*(unsigned short*)(char*)(q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY) + { +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n"); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n")); + DBGHEX(TEST, q - 200, 200); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n")); + soap->error = SOAP_MOE; + return; + } + soap->alist = *(void**)q; + q -= *(size_t*)(q + sizeof(void*)); + SOAP_FREE(soap, q); + } + /* assume these were deallocated: */ + soap->http_content = NULL; + soap->action = NULL; + soap->fault = NULL; + soap->header = NULL; + soap->bearer = NULL; + soap->userid = NULL; + soap->passwd = NULL; + soap->authrealm = NULL; +#ifdef WITH_NTLM + soap->ntlm_challenge = NULL; +#endif +#ifndef WITH_LEANER + soap_clr_mime(soap); +#endif + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_delete(struct soap *soap, void *p) +{ + struct soap_clist **cp; + if (soap_check_state(soap)) + return; + cp = &soap->clist; + if (p) + { + while (*cp) + { + if (p == (*cp)->ptr) + { + struct soap_clist *q = *cp; + *cp = q->next; + if (q->fdelete(soap, q)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type=%d\n", q->ptr, q->type)); +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "new(object type=%d) = %p not freed: deletion callback failed\n", q->type, q->ptr); +#endif + } + SOAP_FREE(soap, q); + return; + } + cp = &(*cp)->next; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: address not in list\n", p)); + } + else + { + while (*cp) + { + struct soap_clist *q = *cp; + *cp = q->next; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Delete %p type=%d (cp=%p)\n", q->ptr, q->type, (void*)q)); + if (q->fdelete(soap, q)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type=%d\n", q->ptr, q->type)); +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "new(object type=%d) = %p not freed: deletion callback failed\n", q->type, q->ptr); +#endif + } + SOAP_FREE(soap, q); + } + } + soap->fault = NULL; /* assume this was deallocated */ + soap->header = NULL; /* assume this was deallocated */ +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_delegate_deletion(struct soap *soap, struct soap *soap_to) +{ + struct soap_clist *cp; + char **q; +#ifdef SOAP_MEM_DEBUG + void *p; + struct soap_mlist **mp, *mq; + size_t h; +#endif + for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q) + { + if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY) + { +#ifdef SOAP_MEM_DEBUG + fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n"); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n")); + DBGHEX(TEST, *q - 200, 200); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n")); + soap->error = SOAP_MOE; + return; + } +#ifdef SOAP_MEM_DEBUG + p = (void*)(*q - *(size_t*)(*q + sizeof(void*))); + h = soap_hash_ptr(p); + for (mp = &soap->mht[h]; *mp; mp = &(*mp)->next) + { + if ((*mp)->ptr == p) + { + mq = *mp; + *mp = mq->next; + mq->next = soap_to->mht[h]; + soap_to->mht[h] = mq; + break; + } + } +#endif + } + *q = (char*)soap_to->alist; + soap_to->alist = soap->alist; + soap->alist = NULL; +#ifdef SOAP_MEM_DEBUG + cp = soap->clist; + while (cp) + { + h = soap_hash_ptr(cp); + for (mp = &soap->mht[h]; *mp; mp = &(*mp)->next) + { + if ((*mp)->ptr == cp) + { + mq = *mp; + *mp = mq->next; + mq->next = soap_to->mht[h]; + soap_to->mht[h] = mq; + break; + } + } + cp = cp->next; + } +#endif + cp = soap_to->clist; + if (cp) + { + while (cp->next) + cp = cp->next; + cp->next = soap->clist; + } + else + { + soap_to->clist = soap->clist; + } + soap->clist = NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_clist * +SOAP_FMAC2 +soap_link(struct soap *soap, int t, int n, int (*fdelete)(struct soap*, struct soap_clist*)) +{ + struct soap_clist *cp = NULL; + if (soap) + { + if (n != SOAP_NO_LINK_TO_DELETE) + { + cp = (struct soap_clist*)SOAP_MALLOC(soap, sizeof(struct soap_clist)); + if (!cp) + { + soap->error = SOAP_EOM; + } + else + { + cp->next = soap->clist; + cp->type = t; + cp->size = n; + cp->ptr = NULL; + cp->fdelete = fdelete; + soap->clist = cp; + } + } + soap->alloced = t; + } + return cp; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_unlink(struct soap *soap, const void *p) +{ + char **q; + struct soap_clist **cp; + if (soap && p) + { + for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q) + { + if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*)))) + { + *q = **(char***)q; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p)); +#ifdef SOAP_MEM_DEBUG + soap_track_unlink(soap, p); +#endif + return SOAP_OK; /* found and removed from dealloc chain */ + } + } + for (cp = &soap->clist; *cp; cp = &(*cp)->next) + { + if (p == (*cp)->ptr) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked class instance %p\n", p)); + q = (char**)*cp; + *cp = (*cp)->next; + SOAP_FREE(soap, q); + return SOAP_OK; /* found and removed from dealloc chain */ + } + } + } + return SOAP_ERR; +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_lookup_type(struct soap *soap, const char *id) +{ + struct soap_ilist *ip; + if (id && *id) + { + ip = soap_lookup(soap, id); + if (ip) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup id='%s' type=%d\n", id, ip->type)); + return ip->type; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "lookup type id='%s' NOT FOUND! Need to get it from xsi:type\n", id)); + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +short +SOAP_FMAC2 +soap_begin_shaky(struct soap *soap) +{ + short f = soap->shaky; + soap->shaky = 1; + return f; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_end_shaky(struct soap *soap, short f) +{ + soap->shaky = f; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static int +soap_is_shaky(struct soap *soap, void *p) +{ + (void)p; + if (!soap->blist && !soap->shaky) + return 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Shaky %p\n", p)); + return 1; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k, int (*fbase)(int, int)) +{ + struct soap_ilist *ip; + if (!p || !id || !*id) + return p; + ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */ + if (!ip) + { + ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, (void*)p, (unsigned int)n, k)); + *p = NULL; + if (k) + { + int i; + if (k > SOAP_MAXPTRS) + return NULL; + ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*)); + if (!ip->spine) + return NULL; + ip->spine[0] = NULL; + for (i = 1; i < SOAP_MAXPTRS; i++) + ip->spine[i] = &ip->spine[i - 1]; + *p = &ip->spine[k - 1]; + } + else + { + ip->link = p; + ip->shaky = soap_is_shaky(soap, (void*)p); + } + } + else if (ip->type != t && (!fbase || !fbase(ip->type, t)) && (!fbase || !fbase(t, ip->type) || soap_type_punned(soap, ip))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup type incompatibility: ref='%s' id-type=%d ref-type=%d\n", id, ip->type, t)); + (void)soap_id_nullify(soap, id); + return NULL; + } + else if (k == 0 && ip->ptr && !ip->shaky) /* when block lists are in use, ip->ptr will change */ + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolved href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, ip->ptr, (unsigned int)n, k)); + *p = ip->ptr; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarded href='%s' type=%d location=%p (%u bytes) level=%u\n", id, t, (void*)p, (unsigned int)n, k)); + if (fbase && fbase(t, ip->type) && !soap_type_punned(soap, ip)) + { + ip->type = t; + ip->size = n; + } + *p = NULL; + if (k) + { + if (!ip->spine) + { + int i; + if (k > SOAP_MAXPTRS) + return NULL; + ip->spine = (void**)soap_malloc(soap, SOAP_MAXPTRS * sizeof(void*)); + if (!ip->spine) + return NULL; + ip->spine[0] = NULL; + for (i = 1; i < SOAP_MAXPTRS; i++) + ip->spine[i] = &ip->spine[i - 1]; + } + *p = &ip->spine[k - 1]; + if (ip->ptr && !ip->shaky) + ip->spine[0] = ip->ptr; + } + else + { + void *q = ip->link; + ip->link = p; + ip->shaky = soap_is_shaky(soap, (void*)p); + *p = q; + } + } + return p; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_id_forward(struct soap *soap, const char *href, void *p, size_t i, int t, int tt, size_t n, unsigned int k, void (*finsert)(struct soap*, int, int, void*, size_t, const void*, void**), int (*fbase)(int, int)) +{ + struct soap_ilist *ip; + if (!p || !href || !*href) + return p; + ip = soap_lookup(soap, href); /* lookup pointer to hash table entry for string id */ + if (!ip) + { + ip = soap_enter(soap, href, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry href='%s' type=%d size=%lu level=%d location=%p\n", href, t, (unsigned long)n, k, p)); + } + else if ((ip->type != t || ip->size != n) && k == 0) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forward type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n)); + (void)soap_id_nullify(soap, href); + return NULL; + } + if (finsert || n < sizeof(void*)) + { + struct soap_flist *fp = (struct soap_flist*)SOAP_MALLOC(soap, sizeof(struct soap_flist)); + if (!fp) + { + soap->error = SOAP_EOM; + return NULL; + } + if (fbase && fbase(t, ip->type) && !soap_type_punned(soap, ip)) + { + ip->type = t; + ip->size = n; + } + if ((ip->type != t || ip->size != n) && (!fbase || !fbase(ip->type, t))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forward type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n)); + SOAP_FREE(soap, fp); + (void)soap_id_nullify(soap, href); + return NULL; + } + fp->next = ip->flist; + fp->type = tt; + fp->ptr = p; + fp->level = k; + fp->index = i; + fp->finsert = finsert; + ip->flist = fp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding type=%d (target type=%d) size=%lu location=%p level=%u index=%lu href='%s'\n", t, tt, (unsigned long)n, p, k, (unsigned long)i, href)); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type=%d href='%s'\n", p, t, href)); + *(void**)p = ip->copy; + ip->copy = p; + } + ip->shaky = soap_is_shaky(soap, p); + return p; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void* +SOAP_FMAC2 +soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*), int (*fbase)(int, int)) +{ +#ifndef WITH_NOIDREF + struct soap_ilist *ip; +#endif + (void)id; (void)fbase; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter id='%s' type=%d location=%p size=%lu\n", id, t, p, (unsigned long)n)); + soap->alloced = 0; + if (!p) + { + if (finstantiate) + { + p = finstantiate(soap, t, type, arrayType, &n); /* soap->alloced is set in soap_link() */ + t = soap->alloced; + } + else + { + p = soap_malloc(soap, n); + soap->alloced = t; + } + } +#ifndef WITH_NOIDREF + if (!id || !*id) +#endif + return p; +#ifndef WITH_NOIDREF + ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup entry id='%s' for location=%p type=%d\n", id, p, t)); + if (!ip) + { + ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + ip->ptr = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry id='%s' type=%d size=%lu location=%p\n", id, t, (unsigned long)n, p)); + if (!soap->alloced) + ip->shaky = soap_is_shaky(soap, p); + } + else if (ip->ptr) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Multiply defined id='%s'\n", id)); + soap_strcpy(soap->id, sizeof(soap->id), id); + soap->error = SOAP_DUPLICATE_ID; + return NULL; + } + else if ((ip->type != t && (!fbase || !fbase(t, ip->type) || soap_type_punned(soap, ip))) + || (ip->type == t && ip->size != n && soap_type_punned(soap, ip))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter type incompatibility id='%s' expect type=%d size=%lu got type=%d size=%lu\n", id, ip->type, (unsigned long)ip->size, t, (unsigned long)n)); + (void)soap_id_nullify(soap, id); + return NULL; + } + else + { + ip->type = t; + ip->size = n; + ip->ptr = p; + if (!soap->alloced) + ip->shaky = soap_is_shaky(soap, p); + if (soap->alloced || !ip->shaky) + { + void **q; /* ptr will not change later, so resolve links now */ + if (ip->spine) + ip->spine[0] = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s' type=%d\n", ip->id, ip->type)); + q = (void**)ip->link; + while (q) + { + void *r = *q; + *q = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", (void*)q, p)); + q = (void**)r; + } + ip->link = NULL; + } + } + return ip->ptr; +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void** +SOAP_FMAC2 +soap_id_smart(struct soap *soap, const char *id, int t, size_t n) +{ + (void)soap; (void)id; (void)t; (void)n; +#ifndef WITH_NOIDREF + if (id && *id) + { + struct soap_ilist *ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */ + if (!ip) + { + ip = soap_enter(soap, id, t, n); /* new hash table entry for string id */ + if (!ip) + return NULL; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New smart shared pointer entry id='%s' type=%d size=%lu smart=%p\n", id, t, (unsigned long)n, ip->smart)); + return &ip->smart; + } +#endif + return NULL; +} + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +static int +soap_type_punned(struct soap *soap, const struct soap_ilist *ip) +{ + const struct soap_flist *fp; + (void)soap; + if (ip->ptr || ip->copy) + return 1; + for (fp = ip->flist; fp; fp = fp->next) + if (fp->level == 0) + return 1; + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIDREF +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_id_nullify(struct soap *soap, const char *id) +{ + int i; + for (i = 0; i < SOAP_IDHASH; i++) + { + struct soap_ilist *ip; + for (ip = soap->iht[i]; ip; ip = ip->next) + { + void *p, *q; + for (p = ip->link; p; p = q) + { + q = *(void**)p; + *(void**)p = NULL; + } + ip->link = NULL; + } + } + soap_strcpy(soap->id, sizeof(soap->id), id); + return soap->error = SOAP_HREF; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_send(struct soap *soap) +{ +#ifndef WITH_LEANER + int err; + err = soap_end_attachments(soap); + if (soap->dime.list) + { + /* SOAP body referenced attachments must appear first */ + soap->dime.last->next = soap->dime.first; + soap->dime.first = soap->dime.list->next; + soap->dime.list->next = NULL; + soap->dime.last = soap->dime.list; + } + if (!err) + err = soap_putdime(soap); + if (!err) + err = soap_putmime(soap); + soap->mime.list = NULL; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->dime.list = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + if (err) + return err; +#endif + return soap_end_send_flush(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_send_flush(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End send mode=0x%x\n", soap->mode)); + if ((soap->mode & SOAP_IO)) /* need to flush the remaining data in buffer */ + { + if (soap_flush(soap)) +#ifdef WITH_ZLIB + { + if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state == SOAP_ZLIB_DEFLATE) + { + soap->zlib_state = SOAP_ZLIB_NONE; + deflateEnd(soap->d_stream); + } + return soap->error; + } +#else + return soap->error; +#endif +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + int r; + soap->d_stream->avail_in = 0; + do + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating remainder\n")); + r = deflate(soap->d_stream, Z_FINISH); + if (soap->d_stream->avail_out != sizeof(soap->buf)) + { + if (soap_flush_raw(soap, soap->z_buf, sizeof(soap->buf) - soap->d_stream->avail_out)) + { + soap->zlib_state = SOAP_ZLIB_NONE; + deflateEnd(soap->d_stream); + return soap->error; + } + soap->d_stream->next_out = (Byte*)soap->z_buf; + soap->d_stream->avail_out = sizeof(soap->buf); + } + } while (r == Z_OK); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out)); + soap->z_ratio_out = (float)soap->d_stream->total_out / (float)soap->d_stream->total_in; + soap->mode &= ~SOAP_ENC_ZLIB; + soap->zlib_state = SOAP_ZLIB_NONE; + if (deflateEnd(soap->d_stream) != Z_OK || r != Z_STREAM_END) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to end deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS)); + return soap->error = SOAP_ZLIB_ERROR; + } +#ifdef WITH_GZIP + if (soap->zlib_out != SOAP_ZLIB_DEFLATE) + { + soap->z_buf[0] = soap->z_crc & 0xFF; + soap->z_buf[1] = (soap->z_crc >> 8) & 0xFF; + soap->z_buf[2] = (soap->z_crc >> 16) & 0xFF; + soap->z_buf[3] = (soap->z_crc >> 24) & 0xFF; + soap->z_buf[4] = soap->d_stream->total_in & 0xFF; + soap->z_buf[5] = (soap->d_stream->total_in >> 8) & 0xFF; + soap->z_buf[6] = (soap->d_stream->total_in >> 16) & 0xFF; + soap->z_buf[7] = (soap->d_stream->total_in >> 24) & 0xFF; + if (soap_flush_raw(soap, soap->z_buf, 8)) + return soap->error; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip crc32=%lu\n", (unsigned long)soap->z_crc)); + } +#endif + } +#endif + if ((soap->mode & SOAP_IO) == SOAP_IO_STORE) + { +#if !defined(__cplusplus) || defined(WITH_COMPAT) + if (soap->os) + { + char *b = (char*)soap_push_block(soap, NULL, 1); + if (b) + { + *b = '\0'; + *soap->os = soap_save_block(soap, NULL, NULL, 0); + } + } + else +#endif + { + char *p; +#ifndef WITH_NOHTTP + if (!(soap->mode & SOAP_ENC_PLAIN)) + { + soap->mode--; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending buffered message of length %u\n", (unsigned int)soap->blist->size)); + if (soap->status >= SOAP_POST) + soap->error = soap->fpost(soap, soap->endpoint, soap->host, soap->port, soap->path, soap->action, soap->blist->size); + else if (soap->status != SOAP_STOP) + soap->error = soap->fresponse(soap, soap->status, soap->blist->size); + if (soap->error || soap_flush(soap)) + return soap->error; + soap->mode++; + } +#endif + for (p = soap_first_block(soap, NULL); p; p = soap_next_block(soap, NULL)) + { + DBGMSG(SENT, p, soap_block_size(soap, NULL)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send %u bytes to socket=%d/fd=%d\n", (unsigned int)soap_block_size(soap, NULL), (int)soap->socket, soap->sendfd)); + soap->error = soap->fsend(soap, p, soap_block_size(soap, NULL)); + if (soap->error) + { + soap_end_block(soap, NULL); + return soap->error; + } + } + soap_end_block(soap, NULL); + } +#ifndef WITH_LEANER + if (soap->fpreparefinalsend && (soap->error = soap->fpreparefinalsend(soap)) != SOAP_OK) + return soap->error; +#endif + if ((soap->omode & SOAP_IO) == SOAP_IO_STORE && (soap->imode & SOAP_IO) != SOAP_IO_STORE) + soap->omode = (soap->omode & ~SOAP_IO) | (soap->imode & SOAP_IO); + } +#ifndef WITH_LEANER + else if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + { + DBGMSG(SENT, "\r\n0\r\n\r\n", 7); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Send 7 bytes to socket=%d/fd=%d\n", (int)soap->socket, soap->sendfd)); + soap->error = soap->fsend(soap, "\r\n0\r\n\r\n", 7); + if (soap->error) + return soap->error; + } +#endif + } +#ifdef WITH_TCPFIN +#if defined(WITH_OPENSSL) || defined(WITH_SYSTEMSSL) + if (!soap->ssl) +#endif + if (soap_valid_socket(soap->socket) && !soap->keep_alive && !(soap->omode & SOAP_IO_UDP)) + soap->fshutdownsocket(soap, soap->socket, SOAP_SHUT_WR); /* Send TCP FIN */ +#endif +#if defined(__cplusplus) && !defined(WITH_COMPAT) + if (soap->os) + soap->os->flush(); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of send phase\n")); + soap->omode &= ~SOAP_SEC_WSUID; + soap->count = 0; + soap->part = SOAP_END; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_end_recv(struct soap *soap) +{ + soap->part = SOAP_END; +#ifndef WITH_LEAN + soap->wsuid = NULL; /* reset before next send */ + soap->c14nexclude = NULL; /* reset before next send */ + soap->c14ninclude = NULL; /* reset before next send */ +#endif +#ifndef WITH_LEANER + soap->ffilterrecv = NULL; + if ((soap->mode & SOAP_ENC_DIME) && soap_getdime(soap)) + { + soap->dime.first = NULL; + soap->dime.last = NULL; + return soap->error; + } + soap->dime.list = soap->dime.first; + soap->dime.first = NULL; + soap->dime.last = NULL; + /* Check if MIME attachments and mime-post-check flag is set, if so call soap_resolve() and return */ + if ((soap->mode & SOAP_ENC_MIME)) + { + if ((soap->mode & SOAP_MIME_POSTCHECK)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Post checking MIME attachments\n")); + if (!soap->keep_alive) + soap->keep_alive = -2; /* special case to keep alive */ +#ifndef WITH_NOIDREF + soap_resolve(soap); +#endif + return SOAP_OK; + } + if (soap_getmime(soap)) + return soap->error; + } + soap->mime.list = soap->mime.first; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + if (soap->xlist) + { + struct soap_multipart *content; + for (content = soap->mime.list; content; content = content->next) + soap_resolve_attachment(soap, content); + } +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of receive message ok\n")); +#ifdef WITH_ZLIB + if ((soap->mode & SOAP_ENC_ZLIB) && soap->d_stream) + { + /* Make sure end of compressed content is reached */ + while (soap->d_stream->next_out != Z_NULL) + if ((int)soap_get1(soap) == EOF) + break; + soap->mode &= ~SOAP_ENC_ZLIB; + (void)soap_memcpy((void*)soap->buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf)); + soap->bufidx = (char*)soap->d_stream->next_in - soap->z_buf; + soap->buflen = soap->z_buflen; + soap->zlib_state = SOAP_ZLIB_NONE; + if (inflateEnd(soap->d_stream) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate end ok\n")); +#ifdef WITH_GZIP + if (soap->zlib_in == SOAP_ZLIB_GZIP) + { + soap_wchar c; + short i; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate gzip crc check\n")); + for (i = 0; i < 8; i++) + { + if ((int)(c = soap_get1(soap)) == EOF) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip error: unable to read crc value\n")); + return soap->error = SOAP_ZLIB_ERROR; + } + soap->z_buf[i] = (char)c; + } + if (soap->z_crc != ((uLong)(unsigned char)soap->z_buf[0] | ((uLong)(unsigned char)soap->z_buf[1] << 8) | ((uLong)(unsigned char)soap->z_buf[2] << 16) | ((uLong)(unsigned char)soap->z_buf[3] << 24))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip inflate error: crc check failed, message corrupted? (crc32=%lu)\n", (unsigned long)soap->z_crc)); + return soap->error = SOAP_ZLIB_ERROR; + } + if (soap->d_stream->total_out != ((uLong)(unsigned char)soap->z_buf[4] | ((uLong)(unsigned char)soap->z_buf[5] << 8) | ((uLong)(unsigned char)soap->z_buf[6] << 16) | ((uLong)(unsigned char)soap->z_buf[7] << 24))) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip inflate error: incorrect message length\n")); + return soap->error = SOAP_ZLIB_ERROR; + } + } + soap->zlib_in = SOAP_ZLIB_NONE; +#endif + } +#endif + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + while ((int)soap->ahead != EOF && !soap_recv_raw(soap)) + continue; +#ifndef WITH_NOIDREF + if (soap_resolve(soap)) + return soap->error; +#endif +#ifndef WITH_LEANER + if (soap->xlist) + { + if ((soap->mode & SOAP_ENC_MTOM)) + return soap->error = SOAP_MIME_HREF; + return soap->error = SOAP_DIME_HREF; + } +#endif + soap_free_ns(soap); +#ifndef WITH_LEANER + if (soap->fpreparefinalrecv) + return soap->error = soap->fpreparefinalrecv(soap); +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free_temp(struct soap *soap) +{ + struct soap_attribute *tp, *tq; + struct Namespace *ns; + soap_free_ns(soap); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free any remaining temp blocks\n")); + while (soap->blist) + soap_end_block(soap, NULL); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute storage\n")); + for (tp = soap->attributes; tp; tp = tq) + { + tq = tp->next; + if (tp->value) + SOAP_FREE(soap, tp->value); + SOAP_FREE(soap, tp); + } + soap->attributes = NULL; +#ifdef WITH_FAST + if (soap->labbuf) + SOAP_FREE(soap, soap->labbuf); + soap->labbuf = NULL; + soap->lablen = 0; + soap->labidx = 0; +#endif + ns = soap->local_namespaces; + if (ns) + { + for (; ns->id; ns++) + { + if (ns->out) + { + SOAP_FREE(soap, ns->out); + ns->out = NULL; + } + } + SOAP_FREE(soap, soap->local_namespaces); + soap->local_namespaces = NULL; + } +#ifndef WITH_LEANER + while (soap->xlist) + { + struct soap_xlist *xp = soap->xlist->next; + SOAP_FREE(soap, soap->xlist); + soap->xlist = xp; + } +#endif +#ifndef WITH_NOIDREF + soap_free_iht(soap); +#endif + soap_free_pht(soap); +} + +/******************************************************************************/ + +static void +soap_free_ns(struct soap *soap) +{ + struct soap_nlist *np, *nq; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free namespace stack\n")); + for (np = soap->nlist; np; np = nq) + { + nq = np->next; + SOAP_FREE(soap, np); + } + soap->nlist = NULL; +} + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +static void +soap_init_logs(struct soap *soap) +{ + int i; + for (i = 0; i < SOAP_MAXLOGS; i++) + { + soap->logfile[i] = NULL; + soap->fdebug[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_open_logfile(struct soap *soap, int i) +{ + if (soap->logfile[i]) + soap->fdebug[i] = fopen(soap->logfile[i], i < 2 ? "ab" : "a"); +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +static void +soap_close_logfile(struct soap *soap, int i) +{ + if (soap->fdebug[i]) + { + fclose(soap->fdebug[i]); + soap->fdebug[i] = NULL; + } +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_close_logfiles(struct soap *soap) +{ + int i; + for (i = 0; i < SOAP_MAXLOGS; i++) + soap_close_logfile(soap, i); +} +#endif + +/******************************************************************************/ + +#ifdef SOAP_DEBUG +static void +soap_set_logfile(struct soap *soap, int i, const char *logfile) +{ + const char *s; + char *t = NULL; + soap_close_logfile(soap, i); + s = soap->logfile[i]; + if (s) + SOAP_FREE_UNMANAGED(s); + if (logfile) + { + size_t l = strlen(logfile) + 1; + t = (char*)SOAP_MALLOC_UNMANAGED(l); + if (t) + (void)soap_memcpy((void*)t, l, (const void*)logfile, l); + } + soap->logfile[i] = t; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_recv_logfile(struct soap *soap, const char *logfile) +{ + (void)soap; (void)logfile; +#ifdef SOAP_DEBUG + soap_set_logfile(soap, SOAP_INDEX_RECV, logfile); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_sent_logfile(struct soap *soap, const char *logfile) +{ + (void)soap; (void)logfile; +#ifdef SOAP_DEBUG + soap_set_logfile(soap, SOAP_INDEX_SENT, logfile); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_test_logfile(struct soap *soap, const char *logfile) +{ + (void)soap; (void)logfile; +#ifdef SOAP_DEBUG + soap_set_logfile(soap, SOAP_INDEX_TEST, logfile); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap* +SOAP_FMAC2 +soap_copy(const struct soap *soap) +{ + struct soap *copy = soap_versioning(soap_new)(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); + soap_done(copy); + if (soap_copy_context(copy, soap) != NULL) + return copy; + soap_free(copy); + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap* +SOAP_FMAC2 +soap_copy_context(struct soap *copy, const struct soap *soap) +{ + if (copy == soap) + return copy; + if (soap_check_state(soap)) + return NULL; + if (copy) + { + struct soap_plugin *p = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying context\n")); + (void)soap_memcpy((void*)copy, sizeof(struct soap), (const void*)soap, sizeof(struct soap)); + copy->state = SOAP_COPY; + copy->error = SOAP_OK; + copy->bearer = NULL; + copy->userid = NULL; + copy->passwd = NULL; +#ifdef WITH_NTLM + copy->ntlm_challenge = NULL; +#endif + copy->nlist = NULL; + copy->blist = NULL; + copy->clist = NULL; + copy->alist = NULL; + copy->attributes = NULL; + copy->labbuf = NULL; + copy->lablen = 0; + copy->labidx = 0; +#ifdef SOAP_MEM_DEBUG + soap_init_mht(copy); +#endif +#ifdef SOAP_DEBUG + soap_init_logs(copy); + soap_set_test_logfile(copy, soap->logfile[SOAP_INDEX_TEST]); + soap_set_sent_logfile(copy, soap->logfile[SOAP_INDEX_SENT]); + soap_set_recv_logfile(copy, soap->logfile[SOAP_INDEX_RECV]); +#endif + copy->namespaces = soap->local_namespaces; + copy->local_namespaces = NULL; + soap_set_local_namespaces(copy); /* copy content of soap->local_namespaces */ + copy->namespaces = soap->namespaces; /* point to shared read-only namespaces table */ + copy->c_locale = NULL; +#ifdef WITH_OPENSSL + copy->bio = NULL; + copy->ssl = NULL; + copy->session = NULL; + copy->session_host[0] = '\0'; + copy->session_port = 443; +#endif +#ifdef WITH_GNUTLS + copy->session = NULL; +#endif +#ifdef WITH_ZLIB + copy->d_stream = NULL; + copy->z_buf = NULL; +#endif +#ifndef WITH_NOIDREF + soap_init_iht(copy); +#endif + soap_init_pht(copy); + copy->header = NULL; + copy->fault = NULL; + copy->action = NULL; +#ifndef WITH_LEAN +#ifdef WITH_COOKIES + copy->cookies = soap_copy_cookies(copy, soap); +#else + copy->cookies = NULL; +#endif +#endif + copy->plugins = NULL; + for (p = soap->plugins; p; p = p->next) + { + struct soap_plugin *q = (struct soap_plugin*)SOAP_MALLOC(copy, sizeof(struct soap_plugin)); + if (!q) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not allocate plugin '%s'\n", p->id)); + soap_end(copy); + soap_done(copy); + return NULL; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying plugin '%s'\n", p->id)); + *q = *p; + if (p->fcopy && (copy->error = p->fcopy(copy, q, p)) != SOAP_OK) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not copy plugin '%s' error = %d\n", p->id, copy->error)); + SOAP_FREE(copy, q); + soap_end(copy); + soap_done(copy); + return NULL; + } + q->next = copy->plugins; + copy->plugins = q; + } + } +#ifdef WITH_SELF_PIPE + pipe(copy->pipe_fd); + SOAP_SOCKNONBLOCK(copy->pipe_fd[0]) + SOAP_SOCKNONBLOCK(copy->pipe_fd[1]) +#endif + return copy; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_copy_stream(struct soap *copy, struct soap *soap) +{ + struct soap_attribute *tp = NULL, *tq; + if (copy == soap) + return; + copy->header = soap->header; + copy->mode = soap->mode; + copy->imode = soap->imode; + copy->omode = soap->omode; + copy->socket = soap->socket; + copy->sendsk = soap->sendsk; + copy->recvsk = soap->recvsk; + copy->transfer_timeout = soap->transfer_timeout; + copy->recv_maxlength = soap->recv_maxlength; + copy->recv_timeout = soap->recv_timeout; + copy->send_timeout = soap->send_timeout; + copy->connect_timeout = soap->connect_timeout; + copy->accept_timeout = soap->accept_timeout; + copy->socket_flags = soap->socket_flags; + copy->connect_flags = soap->connect_flags; + copy->connect_retry = soap->connect_retry; + copy->bind_flags = soap->bind_flags; + copy->bind_inet6 = soap->bind_inet6; + copy->bind_v6only = soap->bind_v6only; + copy->accept_flags = soap->accept_flags; + copy->sndbuf = soap->sndbuf; + copy->rcvbuf = soap->rcvbuf; + copy->linger_time = soap->linger_time; + copy->maxlevel = soap->maxlevel; + copy->maxlength = soap->maxlength; + copy->maxoccurs = soap->maxoccurs; + copy->os = soap->os; + copy->is = soap->is; + copy->sendfd = soap->sendfd; + copy->recvfd = soap->recvfd; + copy->bufidx = soap->bufidx; + copy->buflen = soap->buflen; + copy->ahead = soap->ahead; + copy->cdata = soap->cdata; + copy->chunksize = soap->chunksize; + copy->chunkbuflen = soap->chunkbuflen; + copy->keep_alive = soap->keep_alive; + copy->tcp_keep_alive = soap->tcp_keep_alive; + copy->tcp_keep_idle = soap->tcp_keep_idle; + copy->tcp_keep_intvl = soap->tcp_keep_intvl; + copy->tcp_keep_cnt = soap->tcp_keep_cnt; + copy->max_keep_alive = soap->max_keep_alive; +#ifndef WITH_NOIO + copy->peer = soap->peer; + copy->peerlen = soap->peerlen; + copy->ip = soap->ip; + copy->ip6[0] = soap->ip6[0]; + copy->ip6[1] = soap->ip6[1]; + copy->ip6[2] = soap->ip6[2]; + copy->ip6[3] = soap->ip6[3]; + copy->port = soap->port; + (void)soap_memcpy((void*)copy->host, sizeof(copy->host), (const void*)soap->host, sizeof(soap->host)); + (void)soap_memcpy((void*)copy->endpoint, sizeof(copy->endpoint), (const void*)soap->endpoint, sizeof(soap->endpoint)); +#endif +#ifdef WITH_OPENSSL + copy->bio = soap->bio; + copy->ctx = soap->ctx; + copy->ssl = soap->ssl; +#endif +#ifdef WITH_GNUTLS + copy->session = soap->session; +#endif +#ifdef WITH_SYSTEMSSL + copy->ctx = soap->ctx; + copy->ssl = soap->ssl; +#endif +#ifdef WITH_ZLIB + copy->zlib_state = soap->zlib_state; + copy->zlib_in = soap->zlib_in; + copy->zlib_out = soap->zlib_out; + if (soap->d_stream && soap->zlib_state != SOAP_ZLIB_NONE) + { + if (!copy->d_stream) + copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream)); + if (copy->d_stream) + (void)soap_memcpy((void*)copy->d_stream, sizeof(z_stream), (const void*)soap->d_stream, sizeof(z_stream)); + } + copy->z_crc = soap->z_crc; + copy->z_ratio_in = soap->z_ratio_in; + copy->z_ratio_out = soap->z_ratio_out; + copy->z_buf = NULL; + copy->z_buflen = soap->z_buflen; + copy->z_level = soap->z_level; + if (soap->z_buf && soap->zlib_state != SOAP_ZLIB_NONE) + { + copy->z_buf = (char*)SOAP_MALLOC(copy, sizeof(soap->buf)); + if (copy->z_buf) + (void)soap_memcpy((void*)copy->z_buf, sizeof(soap->buf), (const void*)soap->z_buf, sizeof(soap->buf)); + } + copy->z_dict = soap->z_dict; + copy->z_dict_len = soap->z_dict_len; +#endif + (void)soap_memcpy((void*)copy->buf, sizeof(copy->buf), (const void*)soap->buf, sizeof(soap->buf)); + /* copy XML parser state */ + soap_free_ns(copy); + soap_set_local_namespaces(copy); + copy->version = soap->version; + if (soap->nlist && soap->local_namespaces) + { + struct soap_nlist *np = NULL, *nq; + /* copy reversed nlist */ + for (nq = soap->nlist; nq; nq = nq->next) + { + struct soap_nlist *nr = np; + size_t n = sizeof(struct soap_nlist) + strlen(nq->id); + np = (struct soap_nlist*)SOAP_MALLOC(copy, n); + if (!np) + { + np = nr; + break; + } + (void)soap_memcpy((void*)np, n, (const void*)nq, n); + np->next = nr; + } + while (np) + { + const char *s = np->ns; + copy->level = np->level; /* preserve element nesting level */ + if (!s && np->index >= 0) + { + s = soap->local_namespaces[np->index].out; + if (!s) + s = soap->local_namespaces[np->index].ns; + } + if (s) + (void)soap_push_namespace(copy, np->id, s); + nq = np; + np = np->next; + SOAP_FREE(copy, nq); + } + } + (void)soap_memcpy((void*)copy->tag, sizeof(copy->tag), (const void*)soap->tag, sizeof(soap->tag)); + (void)soap_memcpy((void*)copy->id, sizeof(copy->id), (const void*)soap->id, sizeof(soap->id)); + (void)soap_memcpy((void*)copy->href, sizeof(copy->href), (const void*)soap->href, sizeof(soap->href)); + (void)soap_memcpy((void*)copy->type, sizeof(copy->type), (const void*)soap->type, sizeof(soap->type)); + copy->other = soap->other; + copy->root = soap->root; + copy->null = soap->null; + copy->body = soap->body; + copy->part = soap->part; + copy->mustUnderstand = soap->mustUnderstand; + copy->level = soap->level; + copy->peeked = soap->peeked; + /* copy attributes */ + for (tq = soap->attributes; tq; tq = tq->next) + { + struct soap_attribute *tr = tp; + size_t n = sizeof(struct soap_attribute) + strlen(tq->name); + tp = (struct soap_attribute*)SOAP_MALLOC(copy, n); + (void)soap_memcpy((void*)tp, n, (const void*)tq, n); + if (tp->size) + { + tp->value = (char*)SOAP_MALLOC(copy, tp->size); + if (tp->value) + (void)soap_memcpy((void*)tp->value, tp->size, (const void*)tq->value, tp->size); + } + tp->ns = NULL; + tp->next = tr; + } + copy->attributes = tp; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_free_stream(struct soap *soap) +{ + soap->socket = SOAP_INVALID_SOCKET; + soap->sendsk = SOAP_INVALID_SOCKET; + soap->recvsk = SOAP_INVALID_SOCKET; +#ifdef WITH_OPENSSL + soap->bio = NULL; + soap->ctx = NULL; + soap->ssl = NULL; +#endif +#ifdef WITH_GNUTLS + soap->xcred = NULL; + soap->acred = NULL; + soap->cache = NULL; + soap->session = NULL; + soap->dh_params = NULL; + soap->rsa_params = NULL; +#endif +#ifdef WITH_SYSTEMSSL + soap->ctx = (gsk_handle)NULL; + soap->ssl = (gsk_handle)NULL; +#endif +#ifdef WITH_ZLIB + if (soap->z_buf) + SOAP_FREE(soap, soap->z_buf); + soap->z_buf = NULL; +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_initialize(struct soap *soap) +{ + soap_versioning(soap_init)(soap, SOAP_IO_DEFAULT, SOAP_IO_DEFAULT); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_versioning(soap_init)(struct soap *soap, soap_mode imode, soap_mode omode) +{ + size_t i; + soap->state = SOAP_INIT; +#ifdef SOAP_MEM_DEBUG + soap_init_mht(soap); +#endif +#ifdef SOAP_DEBUG + soap_init_logs(soap); +#endif +#ifdef TANDEM_NONSTOP + soap_set_test_logfile(soap, "TESTLOG"); + soap_set_sent_logfile(soap, "SENTLOG"); + soap_set_recv_logfile(soap, "RECVLOG"); +#else + soap_set_test_logfile(soap, "TEST.log"); + soap_set_sent_logfile(soap, "SENT.log"); + soap_set_recv_logfile(soap, "RECV.log"); +#endif +#ifdef WITH_SELF_PIPE + pipe(soap->pipe_fd); + SOAP_SOCKNONBLOCK(soap->pipe_fd[0]) + SOAP_SOCKNONBLOCK(soap->pipe_fd[1]) +#endif + soap->version = 0; + soap->imode = imode; + soap->omode = omode; + soap->mode = imode; + soap->plugins = NULL; + soap->user = NULL; + for (i = 0; i < sizeof(soap->data)/sizeof(*soap->data); i++) + soap->data[i] = NULL; + soap->bearer = NULL; + soap->userid = NULL; + soap->passwd = NULL; + soap->authrealm = NULL; +#ifdef WITH_NTLM + soap->ntlm_challenge = NULL; +#endif +#ifndef WITH_NOHTTP + soap->fpost = http_post; + soap->fget = http_get; + soap->fput = http_put; + soap->fpatch = http_patch; + soap->fdel = http_del; + soap->fopt = http_200; + soap->fhead = http_200; + soap->fform = NULL; + soap->fposthdr = http_post_header; + soap->fresponse = http_response; + soap->fparse = http_parse; + soap->fparsehdr = http_parse_header; +#endif + soap->fheader = NULL; + soap->fconnect = NULL; + soap->fdisconnect = NULL; +#ifndef WITH_NOIO + soap->ipv6_multicast_if = 0; /* in_addr_t value */ + soap->ipv4_multicast_if = NULL; /* points to struct in_addr or in_addr_t */ + soap->ipv4_multicast_ttl = 0; /* 0: use default */ + soap->client_addr = NULL; /* client address (IPv4 or IPv6 or host name) to bind before connect, NULL for none */ + soap->client_addr_ipv6 = NULL; /* client address IPv6 or host name to bind before connect, NULL for none */ + soap->client_port = -1; /* client port to bind before connect, -1 for none */ + soap->client_interface = NULL; /* client interface address, NULL for none */ +#ifndef WITH_IPV6 + soap->fresolve = tcp_gethost; +#else + soap->fresolve = NULL; +#endif + soap->faccept = tcp_accept; + soap->fopen = tcp_connect; + soap->fclose = tcp_disconnect; + soap->fclosesocket = tcp_closesocket; + soap->fshutdownsocket = tcp_shutdownsocket; + soap->fsend = fsend; + soap->frecv = frecv; + soap->fpoll = soap_poll; +#else + soap->fopen = NULL; + soap->fclose = NULL; + soap->fpoll = NULL; +#endif + soap->fseterror = NULL; + soap->fignore = NULL; + soap->fserveloop = NULL; + soap->fplugin = fplugin; +#ifndef WITH_LEANER + soap->fsvalidate = NULL; + soap->fwvalidate = NULL; + soap->feltbegin = NULL; + soap->feltendin = NULL; + soap->feltbegout = NULL; + soap->feltendout = NULL; + soap->fprepareinitsend = NULL; + soap->fprepareinitrecv = NULL; + soap->fpreparesend = NULL; + soap->fpreparerecv = NULL; + soap->fpreparefinalsend = NULL; + soap->fpreparefinalrecv = NULL; + soap->ffiltersend = NULL; + soap->ffilterrecv = NULL; + soap->fdimereadopen = NULL; + soap->fdimewriteopen = NULL; + soap->fdimereadclose = NULL; + soap->fdimewriteclose = NULL; + soap->fdimeread = NULL; + soap->fdimewrite = NULL; + soap->fmimereadopen = NULL; + soap->fmimewriteopen = NULL; + soap->fmimereadclose = NULL; + soap->fmimewriteclose = NULL; + soap->fmimeread = NULL; + soap->fmimewrite = NULL; +#endif + soap->float_format = "%.9G"; /* Alternative: use "%G" */ + soap->double_format = "%.17lG"; /* Alternative: use "%lG" */ + soap->long_double_format = NULL; /* Defined in custom serializer custom/long_double.c */ + soap->dime_id_format = "cid:id%d"; /* default DIME id format for int id index */ + soap->recv_maxlength = 0x7FFFFFFF; /* default max length of messages received (2GB) */ + soap->recv_timeout = 0; + soap->send_timeout = 0; + soap->transfer_timeout = 0; + soap->connect_timeout = 0; + soap->accept_timeout = 0; + soap->socket_flags = 0; + soap->connect_flags = 0; + soap->connect_retry = 0; + soap->bind_flags = 0; +#ifdef WITH_IPV6_V6ONLY + soap->bind_inet6 = 1; + soap->bind_v6only = 1; +#else + soap->bind_inet6 = 0; + soap->bind_v6only = 0; +#endif + soap->accept_flags = 0; +#ifdef WIN32 + soap->sndbuf = SOAP_BUFLEN + 1; /* this size speeds up windows xfer */ + soap->rcvbuf = SOAP_BUFLEN + 1; +#else + soap->sndbuf = SOAP_BUFLEN; + soap->rcvbuf = SOAP_BUFLEN; +#endif + soap->linger_time = 0; + soap->maxlevel = SOAP_MAXLEVEL; + soap->maxlength = SOAP_MAXLENGTH; + soap->maxoccurs = SOAP_MAXOCCURS; + soap->http_version = "1.1"; + soap->proxy_http_version = "1.0"; + soap->http_content = NULL; + soap->http_extra_header = NULL; + soap->actor = NULL; + soap->lang = "en"; + soap->keep_alive = 0; + soap->tcp_keep_alive = 0; + soap->tcp_keep_idle = 0; + soap->tcp_keep_intvl = 0; + soap->tcp_keep_cnt = 0; + soap->max_keep_alive = SOAP_MAXKEEPALIVE; + soap->ip = 0; + soap->ip6[0] = 0; + soap->ip6[1] = 0; + soap->ip6[2] = 0; + soap->ip6[3] = 0; + soap->labbuf = NULL; + soap->lablen = 0; + soap->labidx = 0; + soap->encodingStyle = NULL; +#ifndef WITH_NONAMESPACES + soap->namespaces = namespaces; +#else + soap->namespaces = NULL; +#endif + soap->local_namespaces = NULL; + soap->nlist = NULL; + soap->blist = NULL; + soap->clist = NULL; + soap->alist = NULL; + soap->shaky = 0; + soap->attributes = NULL; + soap->header = NULL; + soap->fault = NULL; + soap->master = SOAP_INVALID_SOCKET; + soap->socket = SOAP_INVALID_SOCKET; + soap->sendsk = SOAP_INVALID_SOCKET; + soap->recvsk = SOAP_INVALID_SOCKET; + soap->os = NULL; + soap->is = NULL; +#ifndef WITH_LEANER + soap->dom = NULL; + soap->dime.list = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + soap->mime.list = NULL; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + soap->mime.start = NULL; + soap->xlist = NULL; +#endif +#ifndef UNDER_CE + soap->recvfd = 0; + soap->sendfd = 1; +#else + soap->recvfd = stdin; + soap->sendfd = stdout; +#endif + soap->tag[0] = '\0'; + soap->id[0] = '\0'; + soap->href[0] = '\0'; + soap->type[0] = '\0'; + soap->arrayType[0] = '\0'; + soap->arraySize[0] = '\0'; + soap->arrayOffset[0] = '\0'; + soap->endpoint[0] = '\0'; + soap->host[0] = '\0'; + soap->path[0] = '\0'; + soap->port = 0; + soap->override_host = NULL; + soap->override_port = 0; + soap->action = NULL; + soap->proxy_host = NULL; + soap->proxy_port = 8080; + soap->proxy_userid = NULL; + soap->proxy_passwd = NULL; + soap->proxy_from = NULL; + soap->origin = NULL; + soap->cors_origin = NULL; + soap->cors_allow = "*"; + soap->cors_method = NULL; + soap->cors_header = NULL; + soap->cors_methods = NULL; + soap->cors_headers = NULL; + soap->x_frame_options = "SAMEORIGIN"; + soap->prolog = "\n"; + soap->zlib_state = SOAP_ZLIB_NONE; + soap->zlib_in = SOAP_ZLIB_NONE; + soap->zlib_out = SOAP_ZLIB_NONE; + soap->d_stream = NULL; + soap->z_buf = NULL; + soap->z_level = 6; + soap->z_dict = NULL; + soap->z_dict_len = 0; +#ifndef WITH_LEAN + soap->wsuid = NULL; + soap->c14nexclude = NULL; + soap->c14ninclude = NULL; + soap->cookies = NULL; + soap->cookie_domain = NULL; + soap->cookie_path = NULL; + soap->cookie_max = 32; +#endif +#ifdef WMW_RPM_IO + soap->rpmreqid = NULL; +#endif +#ifndef WITH_NOIDREF + soap_init_iht(soap); +#endif + soap_init_pht(soap); +#ifdef WITH_OPENSSL + if (!soap_ssl_init_done) + soap_ssl_init(); + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->bio = NULL; + soap->ssl = NULL; + soap->ctx = NULL; + soap->session = NULL; + soap->session_host[0] = '\0'; + soap->session_port = 443; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; + soap->dhfile = NULL; + soap->randfile = NULL; +#endif +#ifdef WITH_GNUTLS + if (!soap_ssl_init_done) + soap_ssl_init(); + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->xcred = NULL; + soap->acred = NULL; + soap->cache = NULL; + soap->session = NULL; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; + soap->dh_params = NULL; + soap->rsa_params = NULL; +#endif +#ifdef WITH_SYSTEMSSL + soap->fsslauth = ssl_auth_init; + soap->fsslverify = NULL; + soap->bio = NULL; + soap->ssl = (gsk_handle)NULL; + soap->ctx = (gsk_handle)NULL; + soap->session = NULL; + soap->ssl_flags = SOAP_SSL_DEFAULT; + soap->keyfile = NULL; + soap->keyid = NULL; + soap->password = NULL; + soap->cafile = NULL; + soap->capath = NULL; + soap->crlfile = NULL; + soap->dhfile = NULL; + soap->randfile = NULL; +#endif + soap->c_locale = NULL; + soap->buflen = 0; + soap->bufidx = 0; +#ifndef WITH_LEANER + soap->dime.chunksize = 0; + soap->dime.buflen = 0; +#endif + soap->other = 0; + soap->root = -1; + soap->null = 0; + soap->position = 0; + soap->encoding = 0; + soap->mustUnderstand = 0; + soap->ns = 0; + soap->part = SOAP_END; + soap->event = 0; + soap->evlev = 0; + soap->alloced = 0; + soap->count = 0; + soap->length = 0; + soap->cdata = 0; + soap->peeked = 0; + soap->ahead = 0; + soap->idnum = 0; + soap->level = 0; + soap->status = 0; + soap->error = SOAP_OK; + soap->errmode = 0; + soap->errnum = 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_begin(struct soap *soap) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Clean up for input/output\n")); + soap->error = SOAP_OK; + if (!soap->keep_alive) + { + soap->buflen = 0; + soap->bufidx = 0; + } + soap->encoding = 0; + soap->mode = 0; + soap->part = SOAP_END; + soap->peeked = 0; + soap->ahead = 0; + soap->level = 0; + *soap->endpoint = '\0'; + soap->encodingStyle = SOAP_STR_EOS; + soap_free_temp(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_end(struct soap *soap) +{ + if (soap_check_state(soap)) + return; + soap_free_temp(soap); + soap_dealloc(soap, NULL); + while (soap->clist) + { + struct soap_clist *cp = soap->clist->next; + SOAP_FREE(soap, soap->clist); + soap->clist = cp; + } + soap_closesock(soap); +#ifdef SOAP_DEBUG + soap_close_logfiles(soap); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_version(struct soap *soap, short version) +{ + soap_set_local_namespaces(soap); + if (soap->version != version && soap->local_namespaces && soap->local_namespaces[0].id && soap->local_namespaces[1].id) + { + if (version == 1) + { + soap->local_namespaces[0].ns = soap_env1; + soap->local_namespaces[1].ns = soap_enc1; + } + else if (version == 2) + { + soap->local_namespaces[0].ns = soap_env2; + soap->local_namespaces[1].ns = soap_enc2; + } + soap->version = version; + } + if (version == 0) + soap->encodingStyle = SOAP_STR_EOS; + else + soap->encodingStyle = NULL; +} + +/******************************************************************************/ + +static void +soap_version(struct soap *soap) +{ + struct Namespace *p = soap->local_namespaces; + if (p) + { + const char *ns = p[0].out; + if (!ns) + ns = p[0].ns; + if (ns) + { + if (!strcmp(ns, soap_env1)) + { + soap->version = 1; /* make sure we use SOAP 1.1 */ + if (p[1].out) + SOAP_FREE(soap, p[1].out); + p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc1)); + if (p[1].out) + (void)soap_memcpy(p[1].out, sizeof(soap_enc1), soap_enc1, sizeof(soap_enc1)); + } + else if (!strcmp(ns, soap_env2)) + { + soap->version = 2; /* make sure we use SOAP 1.2 */ + if (p[1].out) + SOAP_FREE(soap, p[1].out); + p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc2)); + if (p[1].out) + (void)soap_memcpy(p[1].out, sizeof(soap_enc2), soap_enc2, sizeof(soap_enc2)); + } + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_namespaces(struct soap *soap, const struct Namespace *p) +{ + struct Namespace *ns = soap->local_namespaces; + struct soap_nlist *np, *nq, *nr; + unsigned int level = soap->level; + soap->namespaces = p; + soap->local_namespaces = NULL; + soap_set_local_namespaces(soap); + /* reverse the namespace list */ + np = soap->nlist; + soap->nlist = NULL; + if (np) + { + nq = np->next; + np->next = NULL; + while (nq) + { + nr = nq->next; + nq->next = np; + np = nq; + nq = nr; + } + } + /* then push on new stack */ + while (np) + { + const char *s; + soap->level = np->level; /* preserve element nesting level */ + s = np->ns; + if (!s && np->index >= 0 && ns) + { + s = ns[np->index].out; + if (!s) + s = ns[np->index].ns; + } + if (s) + (void)soap_push_namespace(soap, np->id, s); + nq = np; + np = np->next; + SOAP_FREE(soap, nq); + } + if (ns) + { + int i; + for (i = 0; ns[i].id; i++) + { + if (ns[i].out) + { + SOAP_FREE(soap, ns[i].out); + ns[i].out = NULL; + } + } + SOAP_FREE(soap, ns); + } + soap->level = level; /* restore level */ + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_local_namespaces(struct soap *soap) +{ + if (soap->namespaces && !soap->local_namespaces) + { + const struct Namespace *ns1; + struct Namespace *ns2; + size_t n = 1; + for (ns1 = soap->namespaces; ns1->id; ns1++) + n++; + n *= sizeof(struct Namespace); + ns2 = (struct Namespace*)SOAP_MALLOC(soap, n); + if (ns2) + { + (void)soap_memcpy((void*)ns2, n, (const void*)soap->namespaces, n); + if (ns2[0].ns) + { + if (!strcmp(ns2[0].ns, soap_env1)) + soap->version = 1; + else if (!strcmp(ns2[0].ns, soap_env2)) + soap->version = 2; + } + soap->local_namespaces = ns2; + for (; ns2->id; ns2++) + ns2->out = NULL; + } + } +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_tagsearch(const char *big, const char *little) +{ + if (big && little) + { + size_t n = strlen(little); + const char *s = big; + while (s) + { + const char *t = s; + size_t i; + for (i = 0; i < n; i++, t++) + { + if (*t != little[i]) + break; + } + if (*t == '\0' || *t == ' ') + { + if (i == n || (i > 0 && little[i-1] == ':')) + return s; + } + s = strchr(t, ' '); + if (s) + s++; + } + } + return NULL; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +struct soap_nlist * +SOAP_FMAC2 +soap_lookup_ns(struct soap *soap, const char *tag, size_t n) +{ + struct soap_nlist *np; + for (np = soap->nlist; np; np = np->next) + if (!strncmp(np->id, tag, n) && !np->id[n]) + return np; + return NULL; +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +static struct soap_nlist * +soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized, short isearly) +{ + struct soap_nlist *np = NULL; + size_t n, k; + unsigned int level = soap->level + isearly; + if (soap_tagsearch(soap->c14nexclude, id)) + return NULL; + if (!utilized) + { + for (np = soap->nlist; np; np = np->next) + { + if (!strcmp(np->id, id) && ((!np->ns && *id) || (np->ns && !strcmp(np->ns, ns)))) + break; + } + if (np) + { + if ((np->level < level || (!np->ns && *id)) && np->index == 1) + utilized = 1; + else + return NULL; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Adding namespace binding (level=%u) '%s' '%s' utilized=%d\n", level, id, ns ? ns : "(null)", utilized)); + n = strlen(id); + if (ns) + k = strlen(ns) + 1; + else + k = 0; + if (sizeof(struct soap_nlist) + n + k > n && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_nlist) + n + k <= SOAP_MAXALLOCSIZE)) + np = (struct soap_nlist*)SOAP_MALLOC(soap, sizeof(struct soap_nlist) + n + k); + if (!np) + { + soap->error = SOAP_EOM; + return NULL; + } + np->next = soap->nlist; + soap->nlist = np; + soap_strcpy((char*)np->id, n + 1, id); + if (ns) + { + np->ns = np->id + n + 1; + soap_strcpy((char*)np->ns, k, ns); + } + else + { + np->ns = NULL; + } + np->level = level; + np->index = utilized; + return np; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static void +soap_utilize_ns(struct soap *soap, const char *tag, short isearly) +{ + struct soap_nlist *np; + size_t n = 0; + if (!strncmp(tag, "xmlns:", 6)) + { + tag += 6; + n = strlen(tag); + } + else + { + const char *t = strchr(tag, ':'); + if (t) + n = t - tag; + } + np = soap_lookup_ns(soap, tag, n); + if (np) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Utilizing namespace of '%s' at level %u utilized=%d at level=%u\n", tag, soap->level + isearly, np->index, np->level)); + if (np->index <= 0) + { + if (np->level == soap->level + isearly) + np->index = 1; + else + (void)soap_push_ns(soap, np->id, np->ns, 1, isearly); + } + } + else if (strncmp(tag, "xml", 3)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Utilizing default namespace of '%s' at level %u\n", tag, soap->level + isearly)); + (void)soap_strncpy(soap->tag, sizeof(soap->tag), tag, n); + (void)soap_push_ns(soap, soap->tag, NULL, 1, isearly); + } +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element(struct soap *soap, const char *tag, int id, const char *type) +{ +#ifndef WITH_LEAN + const char *s; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' level='%u' id='%d' type='%s'\n", tag, soap->level, id, type ? type : SOAP_STR_EOS)); +#ifdef WITH_DOM +#ifndef WITH_LEAN + if (soap_tagsearch(soap->wsuid, tag)) + { + size_t i; + for (s = tag, i = 0; *s && i < sizeof(soap->href) - 1; s++, i++) + soap->href[i] = *s == ':' ? '-' : *s; + soap->href[i] = '\0'; + if (soap_set_attr(soap, "wsu:Id", soap->href, 1)) + return soap->error; + } +#endif +#endif + soap->level++; + if (soap->level > soap->maxlevel) + return soap->error = SOAP_LEVEL; +#ifdef WITH_DOM +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_DOM_ASIS)) + { + if (soap->evlev >= soap->level) + soap->evlev = 0; + if (soap->event == SOAP_SEC_BEGIN && !soap->evlev) + { + struct soap_nlist *np; + /* non-nested wsu:Id found: clear xmlns, re-emit them for exc-c14n */ + for (np = soap->nlist; np; np = np->next) + { + int p = soap->c14ninclude ? *soap->c14ninclude == '+' || soap_tagsearch(soap->c14ninclude, np->id) != NULL : 0; + if (np->index == 2 || p) + { + struct soap_nlist *np1 = soap_push_ns(soap, np->id, np->ns, 1, 0); + if (np1 && !p) + np1->index = 0; + } + } + soap->evlev = soap->level; + } + } +#endif + if ((soap->mode & SOAP_XML_DOM)) + { + struct soap_dom_element *elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element)); + if (!elt) + return soap->error = SOAP_EOM; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Adding DOM element tag='%s' %p (parent='%s' %p)\n", tag, elt, soap->dom ? soap->dom->name : "(null)", soap->dom)); + elt->soap = soap; + elt->next = NULL; + elt->prnt = soap->dom; + elt->elts = NULL; + elt->atts = NULL; + elt->nstr = NULL; + elt->name = soap_strdup(soap, tag); + elt->lead = NULL; + elt->text = NULL; + elt->code = NULL; + elt->tail = NULL; + elt->node = NULL; + elt->type = 0; + if (soap->dom) + { + struct soap_dom_element *p = soap->dom->elts; + if (p) + { + while (p->next) + p = p->next; + p->next = elt; + } + else + { + soap->dom->elts = elt; + } + } + soap->dom = elt; + if (!elt->name) + return soap->error = SOAP_EOM; + } + else + { +#endif +#ifndef WITH_LEAN + if (!soap->ns) + { + if (!(soap->mode & SOAP_XML_CANONICAL) && soap_send(soap, soap->prolog)) + return soap->error; + } + else if ((soap->mode & SOAP_XML_INDENT)) + { + if (soap->ns == 1 && soap_send_raw(soap, soap_indent, soap->level < sizeof(soap_indent) ? soap->level : sizeof(soap_indent) - 1)) + return soap->error; + soap->body = 1; + } + if ((soap->mode & SOAP_XML_DEFAULTNS)) + { + size_t n = 0; + s = strchr(tag, ':'); + if (s) + n = s++ - tag; + else + s = tag; + if (soap_send_raw(soap, "<", 1) + || soap_send(soap, s)) + return soap->error; + if (n) + { + struct Namespace *ns = soap->local_namespaces; + for (; ns && ns->id; ns++) + { + if (*ns->id && ns->ns && !strncmp(ns->id, tag, n) && !ns->id[n]) + { + if (!soap->nlist || *soap->nlist->id || (soap->nlist->ns && strcmp(soap->nlist->ns, ns->ns))) + { + (void)soap_push_ns(soap, SOAP_STR_EOS, ns->out ? ns->out : ns->ns, 0, 0); + if (soap_attribute(soap, "xmlns", ns->out ? ns->out : ns->ns)) + return soap->error; + } + break; + } + } + } +#ifndef WITH_NOEMPTYNAMESPACES + else if (!soap->nlist || *soap->nlist->id || (soap->nlist->ns && *soap->nlist->ns)) + { + (void)soap_push_ns(soap, SOAP_STR_EOS, SOAP_STR_EOS, 0, 0); + if (soap_attribute(soap, "xmlns", SOAP_STR_EOS)) + return soap->error; + } +#endif + } + else +#endif + if (soap_send_raw(soap, "<", 1) + || soap_send(soap, tag)) + return soap->error; +#ifdef WITH_DOM + } +#endif + if (!soap->ns) + { + struct Namespace *ns = soap->local_namespaces; + int k = -1; + if (ns) + { + while (k-- && ns->id) + { + const char *t = ns->out; + if (!t) + t = ns->ns; + if (*ns->id && t && *t) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(ns->id) + 6), "xmlns:%s", ns->id); + if (soap_attribute(soap, soap->tmpbuf, t)) + return soap->error; + } + ns++; + } + } + } + soap->ns = 1; /* namespace table control: ns = 0 or 2 to start, then 1 to stop dumping the table */ +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + if ((soap->mode & SOAP_XML_DEFAULTNS)) + soap_utilize_ns(soap, SOAP_STR_EOS, 0); + else + soap_utilize_ns(soap, tag, 0); + } +#endif + if (id > 0) + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), sizeof(SOAP_BASEREFNAME) + 20), SOAP_BASEREFNAME "%d", id); + if (soap->version == 2) + { + if (soap_attribute(soap, "SOAP-ENC:id", soap->tmpbuf)) + return soap->error; + } + else if (soap_attribute(soap, "id", soap->tmpbuf)) + { + return soap->error; + } + } + if (type && *type && !(soap->mode & SOAP_XML_NOTYPE)) + { +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + soap_utilize_ns(soap, type, 0); +#endif + if (soap_attribute(soap, "xsi:type", type)) + return soap->error; + } + if (soap->null && soap->position > 0 && soap->version == 1) + { + int i; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf) - 1, 20), "[%d", soap->positions[0]); + for (i = 1; i < soap->position; i++) + { + size_t l = strlen(soap->tmpbuf); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l - 1, 20), ",%d", soap->positions[i]); + } + soap_strcat(soap->tmpbuf, sizeof(soap->tmpbuf), "]"); + if (soap_attribute(soap, "SOAP-ENC:position", soap->tmpbuf)) + return soap->error; + } + if (soap->mustUnderstand) + { + if (soap->actor && *soap->actor) + { + if (soap_attribute(soap, soap->version == 2 ? "SOAP-ENV:role" : "SOAP-ENV:actor", soap->actor)) + return soap->error; + } + if (soap_attribute(soap, "SOAP-ENV:mustUnderstand", soap->version == 2 ? "true" : "1")) + return soap->error; + soap->mustUnderstand = 0; + } + if (soap->encoding) + { + if (soap->encodingStyle && soap->local_namespaces && soap->local_namespaces[0].id && soap->local_namespaces[1].id) + { + if (!*soap->encodingStyle) + { + if (soap->local_namespaces[1].out) + soap->encodingStyle = soap->local_namespaces[1].out; + else + soap->encodingStyle = soap->local_namespaces[1].ns; + } + if (soap->encodingStyle && soap_attribute(soap, "SOAP-ENV:encodingStyle", soap->encodingStyle)) + return soap->error; + } + else + { + soap->encodingStyle = NULL; + } + soap->encoding = 0; + } + soap->null = 0; + soap->position = 0; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type) +{ + if (*tag == '-') + return SOAP_OK; +#ifdef WITH_DOM + if (soap->feltbegout) + return soap->error = soap->feltbegout(soap, tag, id, type); +#endif + if (soap_element(soap, tag, id, type)) + return soap->error; + return soap_element_start_end_out(soap, NULL); +} + +/******************************************************************************/ + +#if _MSC_VER < 1400 && !defined(HAVE_STRLCAT) +/* concat string (truncating the result, strings must not be NULL) */ +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_strcat(char *t, size_t n, const char *s) +{ + size_t k = strlen(t); + if (k < n) + { + t += k; + n -= k; + while (--n > 0 && *s) + *t++ = *s++; + *t = '\0'; + } +} +#endif + +/******************************************************************************/ + +#if _MSC_VER < 1400 +/* concat string up to m chars (leaves destination intact on overrun and returns nonzero, zero if OK) */ +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_strncat(char *t, size_t n, const char *s, size_t m) +{ + size_t k; + if (!t || !s) + return 1; + k = strlen(t); + if (n <= k + m) + return 1; + t += k; + n -= k; + while (--n > 0 && *s) + *t++ = *s++; + *t = '\0'; + return 0; +} +#endif + +/******************************************************************************/ + +#ifndef HAVE_STRRCHR +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_strrchr(const char *s, int t) +{ + char *r = NULL; + while (*s) + if (*s++ == t) + r = (char*)s - 1; + return r; +} +#endif + +/******************************************************************************/ + +#ifndef HAVE_STRTOL +SOAP_FMAC1 +long +SOAP_FMAC2 +soap_strtol(const char *s, char **t, int b) +{ + long n = 0; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 214748364 && (n > 214748364 || c >= '8')) + { + if (neg && n == 214748364 && c == '8') + { + if (t) + *t = (char*)(s + 1); + return -2147483648; + } + break; + } + n *= 10; + n += c - '0'; + s++; + } + if (neg) + n = -n; + } + else /* assume b == 16 and value is always positive */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x07FFFFFF) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +#ifndef HAVE_STRTOUL +SOAP_FMAC1 +unsigned long +SOAP_FMAC2 +soap_strtoul(const char *s, char **t, int b) +{ + unsigned long n = 0; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 429496729 && (n > 429496729 || c >= '6')) + break; + n *= 10; + n += c - '0'; + s++; + } + if (neg && n > 0) + s--; + } + else /* b == 16 */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x0FFFFFFF) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +#ifndef soap_strtoll +SOAP_FMAC1 +LONG64 +SOAP_FMAC2 +soap_strtoll(const char *s, char **t, int b) +{ + LONG64 n = 0LL; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 922337203685477580LL && (n > 922337203685477580LL || c >= '8')) + { + if (neg && n == 922337203685477580LL && c == '8') + { + if (t) + *t = (char*)(s + 1); + return -9223372036854775807LL - 1LL; /* appease compilers that complain */ + } + break; + } + n *= 10LL; + n += c - '0'; + s++; + } + if (neg) + n = -n; + } + else /* assume b == 16 and value is always positive */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x07FFFFFFFFFFFFFFLL) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +#ifndef soap_strtoull +SOAP_FMAC1 +ULONG64 +SOAP_FMAC2 +soap_strtoull(const char *s, char **t, int b) +{ + ULONG64 n = 0UL; + int c; + while (*s > 0 && *s <= 32) + s++; + if (b == 10) + { + short neg = 0; + if (*s == '-') + { + s++; + neg = 1; + } + else if (*s == '+') + { + s++; + } + while ((c = *s) && c >= '0' && c <= '9') + { + if (n >= 1844674407370955161ULL) + break; + n *= 10UL; + n += c - '0'; + s++; + } + if (neg && n > 0UL) + s--; + } + else /* b == 16 */ + { + while ((c = *s)) + { + if (c >= '0' && c <= '9') + c -= '0'; + else if (c >= 'A' && c <= 'F') + c -= 'A' - 10; + else if (c >= 'a' && c <= 'f') + c -= 'a' - 10; + if (n > 0x0FFFFFFFFFFFFFFFULL) + break; + n <<= 4; + n += c; + s++; + } + } + if (t) + *t = (char*)s; + return n; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_array_begin_out(struct soap *soap, const char *tag, int id, const char *type, const char *offset) +{ + if (!type || !*type || soap->version == 0) + return soap_element_begin_out(soap, tag, id, NULL); + if (soap_element(soap, tag, id, NULL)) + return soap->error; + if (soap->version == 1) + { + if (offset && soap_attribute(soap, "SOAP-ENC:offset", offset)) + return soap->error; + if (soap_attribute(soap, "SOAP-ENC:arrayType", type)) + return soap->error; + } + else + { + const char *s; + s = strchr(type, '['); + if (s && (size_t)(s - type) < sizeof(soap->tmpbuf)) + { + (void)soap_strncpy(soap->tmpbuf, sizeof(soap->tmpbuf), type, s - type); + if (soap_attribute(soap, "SOAP-ENC:itemType", soap->tmpbuf)) + return soap->error; + s++; + if (*s && *s != ']') + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s); + soap->tmpbuf[strlen(soap->tmpbuf) - 1] = '\0'; + if (soap_attribute(soap, "SOAP-ENC:arraySize", soap->tmpbuf)) + return soap->error; + } + } + } +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + soap_utilize_ns(soap, type, 0); +#endif + return soap_element_start_end_out(soap, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_start_end_out(struct soap *soap, const char *tag) +{ + struct soap_attribute *tp; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + struct soap_nlist *np; + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible && *tp->name && strchr(tp->name, ':')) + soap_utilize_ns(soap, tp->name, 0); + } + if (soap->event == SOAP_SEC_BEGIN) + { + for (np = soap->nlist; np; np = np->next) + if (soap_tagsearch(soap->c14ninclude, np->id)) + (void)soap_push_ns(soap, np->id, np->ns, 1, 0); + soap->event = 0; + soap->evlev = 0; + } + for (np = soap->nlist; np; np = np->next) + { + if (np->ns && np->index == 1) + { + if (*np->id) + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(np->id) + 6), "xmlns:%s", np->id); + else + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "xmlns"); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s' SEC-BEGIN=%d c14ninclude='%s'\n", np->level, soap->tmpbuf, np->ns, soap->event == SOAP_SEC_BEGIN, soap->c14ninclude ? soap->c14ninclude : "(null)")); + np->index = 2; + soap->level--; + if (*np->id || *np->ns || soap->level > 1) + if (soap_set_attr(soap, soap->tmpbuf, np->ns, 1)) + return soap->error; + soap->level++; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Binding (level=%u) %s='%s' utilized=%d\n", np->level, np->id, np->ns, np->index)); + } + } + } +#endif +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + struct soap_dom_attribute **att; + att = &soap->dom->atts; + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute)); + if (!*att) + return soap->error; + (*att)->next = NULL; + (*att)->nstr = NULL; + (*att)->name = soap_strdup(soap, tp->name); + (*att)->text = soap_strdup(soap, tp->value); + (*att)->soap = soap; + if (!(*att)->name || (tp->value && !(*att)->text)) + return soap->error = SOAP_EOM; + att = &(*att)->next; + tp->visible = 0; + } + } + return SOAP_OK; + } +#endif + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + if (soap_send_raw(soap, " ", 1) || soap_send(soap, tp->name)) + return soap->error; + if (tp->visible == 2 && tp->value) + { + if (soap_send_raw(soap, "=\"", 2) + || soap_string_out(soap, tp->value, tp->flag) + || soap_send_raw(soap, "\"", 1)) + return soap->error; + } + else + { + if (soap_send_raw(soap, "=\"\"", 3)) + return soap->error; + } + tp->visible = 0; + } + } + if (tag) + { +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + if (soap_send_raw(soap, ">", 1) + || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; + } +#endif + if (soap->nlist) + soap_pop_namespace(soap); + soap->level--; /* decrement level just before /> */ + soap->body = 0; + return soap_send_raw(soap, "/>", 2); + } + return soap_send_raw(soap, ">", 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_end_out(struct soap *soap, const char *tag) +{ + if (*tag == '-') + return SOAP_OK; +#ifdef WITH_DOM + if (soap->feltendout) + return soap->error = soap->feltendout(soap, tag); +#endif + return soap_element_end(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_end(struct soap *soap, const char *tag) +{ +#ifndef WITH_LEAN + const char *s; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element ending tag='%s'\n", tag)); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + if (soap->dom->prnt) + soap->dom = soap->dom->prnt; + return SOAP_OK; + } +#endif +#ifndef WITH_LEAN + if (soap->nlist) + soap_pop_namespace(soap); + if ((soap->mode & SOAP_XML_INDENT)) + { + if (!soap->body) + { + if (soap_send_raw(soap, soap_indent, soap->level < sizeof(soap_indent) ? soap->level : sizeof(soap_indent) - 1)) + return soap->error; + } + soap->body = 0; + } + if ((soap->mode & SOAP_XML_DEFAULTNS) && (s = strchr(tag, ':')) != NULL) + tag = s + 1; +#endif + if (soap_send_raw(soap, "error; + soap->level--; /* decrement level just before > */ + return soap_send_raw(soap, ">", 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_ref(struct soap *soap, const char *tag, int id, int href) +{ + const char *s = "ref"; + int n = 1; + if (soap->version == 1) + { + s = "href"; + n = 0; + } + else if (soap->version == 2) + { + s = "SOAP-ENC:ref"; + } + (SOAP_SNPRINTF(soap->href, sizeof(soap->href), sizeof(SOAP_BASEREFNAME) + 21), "#" SOAP_BASEREFNAME "%d", href); + return soap_element_href(soap, tag, id, s, soap->href + n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_href(struct soap *soap, const char *tag, int id, const char *ref, const char *val) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element '%s' reference %s='%s'\n", tag, ref, val)); + if (soap_element(soap, tag, id, NULL) + || soap_attribute(soap, ref, val) + || soap_element_start_end_out(soap, tag)) + return soap->error; + soap->body = 0; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_null(struct soap *soap, const char *tag, int id, const char *type) +{ + struct soap_attribute *tp = NULL; + for (tp = soap->attributes; tp; tp = tp->next) + if (tp->visible) + break; + if (tp || (soap->version == 2 && soap->position > 0) || id > 0 || (soap->mode & SOAP_XML_NIL)) + { + if (soap_element(soap, tag, id, type) + || (!tp && soap_attribute(soap, "xsi:nil", "true")) + || soap_element_start_end_out(soap, tag)) + return soap->error; + soap->body = 0; + } + else + { + soap->null = 1; + soap->position = 0; + soap->mustUnderstand = 0; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_empty(struct soap *soap, const char *tag) +{ + if (soap_element(soap, tag, -1, NULL)) + return soap->error; + return soap_element_start_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_nil(struct soap *soap, const char *tag) +{ + if (soap_element(soap, tag, -1, NULL) + || (soap_attribute(soap, "xsi:nil", "true"))) + return soap->error; + return soap_element_start_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const void *a, int n, const char *type, int t, char **mark) +{ + (void)a; (void)n; + if (!p) + { + soap->error = soap_element_null(soap, tag, id, type); + return -1; + } +#ifndef WITH_NOIDREF + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element_id %p type=%d id=%d\n", p, t, id)); + if ((!soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH)) || (soap->mode & SOAP_XML_TREE)) + return soap_check_and_mark(soap, p, t, mark); + if (mark) + *mark = NULL; + if (id < -1) + return soap_embed(soap, p, a, n, t); + else if (id <= 0) + { + struct soap_plist *pp; + if (a) + id = soap_array_pointer_lookup(soap, p, a, n, t, &pp); + else + id = soap_pointer_lookup(soap, p, t, &pp); + if (id) + { + if (soap_is_embedded(soap, pp)) + { + soap_element_ref(soap, tag, 0, id); + return -1; + } + if (soap_is_single(soap, pp)) + return 0; + soap_set_embedded(soap, pp); + } + } + return id; +#else + return soap_check_and_mark(soap, p, t, mark); +#endif +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_check_and_mark(struct soap *soap, const void *p, int t, char **mark) +{ + if (mark) + { + struct soap_plist *pp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Check %p and mark %p\n", p, (void*)mark)); + if (!soap_pointer_lookup(soap, p, t, &pp)) + if (!soap_pointer_enter(soap, p, NULL, 0, t, &pp)) + return -1; + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (pp->mark1 > 0) + return -1; + pp->mark1 = 1; + *mark = &pp->mark1; + } + else + { + if (pp->mark2 > 0) + return -1; + pp->mark2 = 1; + *mark = &pp->mark2; + } + } + return 0; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void * +SOAP_FMAC2 +soap_mark_lookup(struct soap *soap, const void *p, int t, struct soap_plist **ppp, char **mark) +{ + if (!soap) + return NULL; + if (mark || !(soap->mode & SOAP_XML_TREE)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark lookup %p type=%d\n", p, t)); + if (!soap_pointer_lookup(soap, p, t, ppp)) + { + if (!soap_pointer_enter(soap, p, NULL, 0, t, ppp)) + return NULL; + } + else if (!(soap->mode & SOAP_XML_TREE)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark found %p\n", (*ppp)->dup)); + return (*ppp)->dup; + } + if (mark) + { + if ((*ppp)->mark1 > 0) + (*ppp)->mark1 = 2; /* cycle */ + else + (*ppp)->mark1 = 1; /* cycle detection */ + *mark = &(*ppp)->mark1; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Mark cycle %d\n", (*ppp)->mark1)); + } + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_mark_cycle(struct soap *soap, struct soap_plist *pp) +{ + (void)soap; + return pp && pp->mark1 == 2 && (soap->mode & SOAP_XML_TREE); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_mark_dup(struct soap *soap, void *a, struct soap_plist *pp) +{ + (void)soap; + if (pp) + pp->dup = a; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_unmark(struct soap *soap, char *mark) +{ + (void)soap; + if (mark) + *mark = 0; /* release detection */ +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_result(struct soap *soap, const char *tag) +{ + if (soap->version == 2 && soap->encodingStyle) + { + if (soap_element(soap, "SOAP-RPC:result", 0, NULL) + || soap_attribute(soap, "xmlns:SOAP-RPC", soap_rpc) + || soap_element_start_end_out(soap, NULL) + || soap_string_out(soap, tag, 0) + || soap_element_end_out(soap, "SOAP-RPC:result")) + return soap->error; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_check_result(struct soap *soap, const char *tag) +{ + (void)tag; + if (soap->version == 2 && soap->encodingStyle) + { + soap_instring(soap, ":result", NULL, NULL, 0, 2, -1, -1, NULL); + /* just ignore content for compliance reasons, but should compare tag to element's QName value? */ + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_attribute(struct soap *soap, const char *name, const char *value) +{ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute '%s'='%s'\n", name, value)); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && !(soap->mode & SOAP_XML_CANONICAL) && soap->dom) + { + struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute)); + if (!a) + return soap->error; + a->next = soap->dom->atts; + a->nstr = NULL; + a->name = soap_strdup(soap, name); + a->text = soap_strdup(soap, value); + a->soap = soap; + soap->dom->atts = a; + if (!a->name || (value && !a->text)) + return soap->error = SOAP_EOM; + return SOAP_OK; + } +#endif +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + /* push namespace */ + if (!strncmp(name, "xmlns", 5) && ((name[5] == ':') || name[5] == '\0')) + { + if (name[5] == ':' && soap->c14ninclude && ((*soap->c14ninclude == '*' || soap_tagsearch(soap->c14ninclude, name + 6)))) + soap_utilize_ns(soap, name, 0); + (void)soap_push_ns(soap, name + 5 + (name[5] == ':'), value, 0, 0); + } + else + { + soap->level--; + if (soap_set_attr(soap, name, value, 1)) + return soap->error; + soap->level++; + } + } + else +#endif + { + if (soap_send_raw(soap, " ", 1) + || soap_send(soap, name)) + return soap->error; + if (value) + if (soap_send_raw(soap, "=\"", 2) + || soap_string_out(soap, value, 1) + || soap_send_raw(soap, "\"", 1)) + return soap->error; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type) +{ + if (!soap_peek_element(soap)) + { + if (soap->other) + return soap->error = SOAP_TAG_MISMATCH; + if (tag && *tag == '-') + return SOAP_OK; + soap->error = soap_match_tag(soap, soap->tag, tag); + if (!soap->error) + { + if (type && *soap->type && soap_match_tag(soap, soap->type, type)) + return soap->error = SOAP_TYPE; + soap->peeked = 0; + if (!nillable && soap->null && (soap->mode & SOAP_XML_STRICT)) + return soap->error = SOAP_NULL; + if (soap->body) + { + soap->level++; + if (soap->level > soap->maxlevel) + return soap->error = SOAP_LEVEL; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin tag found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS)); + soap->error = SOAP_OK; + } + } + else if (soap->error == SOAP_NO_TAG && tag && *tag == '-') + { + soap->error = SOAP_OK; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_element_end_in(struct soap *soap, const char *tag) +{ + soap_wchar c; + char *s = NULL; + int n = 0; + if (tag && *tag == '-') + return SOAP_OK; + if (soap->error == SOAP_NO_TAG) + soap->error = SOAP_OK; +#ifdef WITH_DOM + /* this whitespace or mixed content is significant for DOM "as-is" */ + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + const char *t = soap->dom->code; /* save XML code */ + s = soap_string_in(soap, -1, -1, -1, NULL); + if (!soap->peeked && !s) + return soap->error; + if (soap->dom->prnt) + soap->dom = soap->dom->prnt; + if (s && (soap->mode & SOAP_XML_STRICT)) + { + for (; *s; s++) + if (!soap_coblank((soap_wchar)*s)) + return soap->error = SOAP_END_TAG; /* reject mixed content before ending tag */ + } + soap->dom->code = t; /* restore XML code */ + } +#endif + if (soap->peeked) + { + if (*soap->tag) + n++; + soap->peeked = 0; + } + do + { + while (((c = soap_get(soap)) != SOAP_TT)) + { + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + if (!soap_coblank(c)) + { + if ((soap->mode & SOAP_XML_STRICT)) + return soap->error = SOAP_END_TAG; /* reject mixed content before ending tag */ + if (c == SOAP_LT) + n++; + else if (c == '/') + { + c = soap_get(soap); + if (c == SOAP_GT && n > 0) + n--; + else + soap_unget(soap, c); + } + } + } + } while (n-- > 0); + s = soap->tag; + n = sizeof(soap->tag); + while ((c = soap_get(soap)) > 32) + { + if (n > 1) + { + *s++ = (char)c; + n--; + } + } + *s = '\0'; + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + while (soap_coblank(c)) + c = soap_get(soap); + if (c != SOAP_GT) + return soap->error = SOAP_SYNTAX_ERROR; +#ifndef WITH_LEAN +#ifdef WITH_DOM + if (soap->feltendin) + { + int err = soap->error; + soap->error = soap->feltendin(soap, soap->tag, tag); + if (soap->error) + return soap->error; + if (err) + return soap->error = err; /* restore error */ + } +#endif +#endif + if (tag && (soap->mode & SOAP_XML_STRICT)) + { + soap_pop_namespace(soap); + if (soap_match_tag(soap, soap->tag, tag)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End tag '%s' does not match '%s'\n", soap->tag, tag ? tag : SOAP_STR_EOS)); + return soap->error = SOAP_SYNTAX_ERROR; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End tag found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS)); + soap->level--; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_attr_value(struct soap *soap, const char *name, int flag, int occurs) +{ + struct soap_attribute *tp; + if (*name == '-') + return SOAP_STR_EOS; + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible == 2 && !soap_match_att(soap, tp->name, name)) + break; + } + if (tp) + { + if (occurs == 4 || (occurs == 2 && (soap->mode & SOAP_XML_STRICT))) + soap->error = SOAP_PROHIBITED; + else if (flag >= 4) + return soap_collapse(soap, tp->value, flag, 1); + else + return tp->value; + } + else if (occurs == 3 || (occurs == 1 && (soap->mode & SOAP_XML_STRICT))) + { + soap->error = SOAP_REQUIRED; + } + else + { + soap->error = SOAP_OK; + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_attr(struct soap *soap, const char *name, const char *value, int flag) +{ + struct soap_attribute *tp, *tq; + if (*name == '-') + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value ? value : SOAP_STR_EOS)); + tq = NULL; + for (tp = soap->attributes; tp; tq = tp, tp = tp->next) + { + if (!strcmp(tp->name, name)) + break; + } + if (!tp) + { + size_t l = strlen(name); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name)); + if (sizeof(struct soap_attribute) + l > l && (SOAP_MAXALLOCSIZE <= 0 || sizeof(struct soap_attribute) + l <= SOAP_MAXALLOCSIZE)) + tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + l); + if (!tp) + return soap->error = SOAP_EOM; + tp->ns = NULL; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + struct soap_attribute **tpp = &soap->attributes; + const char *s = strchr(name, ':'); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inserting attribute %s for c14n\n", name)); + if (!strncmp(name, "xmlns", 5)) + { + for (; *tpp; tpp = &(*tpp)->next) + if (strncmp((*tpp)->name, "xmlns", 5) || strcmp((*tpp)->name + 5, name + 5) > 0) + break; + } + else if (!s) + { + for (; *tpp; tpp = &(*tpp)->next) + if (strncmp((*tpp)->name, "xmlns", 5) && ((*tpp)->ns || strcmp((*tpp)->name, name) > 0)) + break; + } + else + { + struct soap_nlist *np = soap_lookup_ns(soap, name, s - name); + if (np) + { + tp->ns = np->ns; + } + else + { + struct soap_attribute *tq; + for (tq = soap->attributes; tq; tq = tq->next) + { + if (!strncmp(tq->name, "xmlns:", 6) && !strncmp(tq->name + 6, name, s - name) && !tq->name[6 + s - name]) + { + tp->ns = tq->ns; + break; + } + } + } + for (; *tpp; tpp = &(*tpp)->next) + { + int k; + if (strncmp((*tpp)->name, "xmlns", 5) && (*tpp)->ns && tp->ns && ((k = strcmp((*tpp)->ns, tp->ns)) > 0 || (!k && strcmp((*tpp)->name, name) > 0))) + break; + } + } + tp->next = *tpp; + *tpp = tp; + } + else +#endif + if (tq) + { + tq->next = tp; + tp->next = NULL; + } + else + { + tp->next = soap->attributes; + soap->attributes = tp; + } + soap_strcpy((char*)tp->name, l + 1, name); + tp->value = NULL; + } + else if (tp->visible) + { + return SOAP_OK; + } + else if (value && tp->value && tp->size <= strlen(value)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute value of %s (free %p)\n", name, (void*)tp->value)); + SOAP_FREE(soap, tp->value); + tp->value = NULL; + tp->ns = NULL; + } + if (value) + { + if (!tp->value) + { + tp->size = strlen(value) + 1; + if (SOAP_MAXALLOCSIZE <= 0 || tp->size <= SOAP_MAXALLOCSIZE) + tp->value = (char*)SOAP_MALLOC(soap, tp->size); + if (!tp->value) + return soap->error = SOAP_EOM; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute value for %s (%p)\n", tp->name, (void*)tp->value)); + } + soap_strcpy(tp->value, tp->size, value); + if (!strncmp(tp->name, "xmlns:", 6)) + tp->ns = tp->value; + tp->visible = 2; + tp->flag = (short)flag; +#ifndef WITH_LEAN + if (!strcmp(name, "wsu:Id")) + { + soap->event = SOAP_SEC_BEGIN; + soap_strcpy(soap->id, sizeof(soap->id), value); + } + if ((soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + { + const char *s = strchr(name, ':'); + if (s && strchr(value, ':')) + { + struct soap_nlist *np = soap_lookup_ns(soap, name, s - name); + if (np && np->ns && soap->local_namespaces) + { + if ((!strcmp(s + 1, "type") && !strcmp(np->ns, soap->local_namespaces[2].ns)) /* xsi:type QName */ + || ((!strcmp(s + 1, "arrayType") || !strcmp(s + 1, "itemType")) && !strcmp(np->ns, soap->local_namespaces[1].ns))) /* SOAP-ENC:arrayType and SOAP-ENC:itemType QName */ + soap_utilize_ns(soap, value, 1); + } + } + } +#endif + } + else + { + tp->visible = 1; + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_attr(struct soap *soap) +{ + struct soap_attribute *tp; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_XML_CANONICAL)) + { + while (soap->attributes) + { + tp = soap->attributes->next; + if (soap->attributes->value) + SOAP_FREE(soap, soap->attributes->value); + SOAP_FREE(soap, soap->attributes); + soap->attributes = tp; + } + } + else +#endif + { + for (tp = soap->attributes; tp; tp = tp->next) + tp->visible = 0; + } +} + +/******************************************************************************/ + +static int +soap_getattrval(struct soap *soap, char *s, size_t *n, soap_wchar d) +{ + char buf[8]; + size_t i; + size_t k = *n; + size_t m = 0; + char *t = buf; + for (i = 0; i < k; i++) + { + soap_wchar c; + if (m) + { + *s++ = *t++; + m--; + continue; + } + if ((soap->mode & SOAP_C_UTFSTRING)) + { + c = soap_get(soap); + if ((c & 0x80000000) && c >= -0x7FFFFF80 && c < SOAP_AP) + { + t = buf; + c &= 0x7FFFFFFF; + if (c < 0x0800) + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + m = t - buf - 1; + if (i + m >= k) + { + soap_unget(soap, c | 0x80000000); + *n = i; + return soap->error = SOAP_EOM; + } + t = buf; + *s++ = *t++; + continue; + } + } + else + { + c = soap_getutf8(soap); + } + switch (c) + { + case SOAP_TT: + *s++ = '<'; + soap_unget(soap, '/'); + break; + case SOAP_LT: + *s++ = '<'; + break; + case SOAP_GT: + if (d == ' ') + { + soap_unget(soap, c); + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = '>'; + break; + case SOAP_QT: + if (c == d) + { + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = '"'; + break; + case SOAP_AP: + if (c == d) + { + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = '\''; + break; + case '\t': + case '\n': + case '\r': + case ' ': + case '/': + if (d == ' ') + { + soap_unget(soap, c); + *s = '\0'; + *n = i + 1; + return SOAP_OK; + } + *s++ = (char)c; + break; + default: + if ((int)c == EOF) + { + *s = '\0'; + *n = i + 1; + return soap->error = SOAP_CHK_EOF; + } + *s++ = (char)c; + } + } + return soap->error = SOAP_EOM; +} + +/******************************************************************************/ + +#ifdef WITH_FAST +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_store_lab(struct soap *soap, const char *s, size_t n) +{ + soap->labidx = 0; + return soap_append_lab(soap, s, n); +} +#endif + +/******************************************************************************/ + +#ifdef WITH_FAST +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_append_lab(struct soap *soap, const char *s, size_t n) +{ + if (soap->labidx + n < soap->labidx) + return soap->error = SOAP_EOM; + if (soap->labidx + n >= soap->lablen) + { + char *t = soap->labbuf; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enlarging look-aside buffer to append data, size=%lu\n", (unsigned long)soap->lablen)); + if (soap->lablen == 0) + soap->lablen = SOAP_LABLEN; + while (soap->labidx + n >= soap->lablen) + { + if (soap->lablen << 1 < soap->lablen) + return soap->error = SOAP_EOM; + soap->lablen <<= 1; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New look-aside buffer size=%lu\n", (unsigned long)soap->lablen)); + if (SOAP_MAXALLOCSIZE > 0 && soap->lablen > SOAP_MAXALLOCSIZE) + return soap->error = SOAP_EOM; + soap->labbuf = (char*)SOAP_MALLOC(soap, soap->lablen); + if (!soap->labbuf) + { + if (t) + SOAP_FREE(soap, t); + return soap->error = SOAP_EOM; + } + if (t) + { + (void)soap_memcpy((void*)soap->labbuf, soap->lablen, (const void*)t, soap->labidx); + SOAP_FREE(soap, t); + } + } + if (s) + { + (void)soap_memcpy((void*)(soap->labbuf + soap->labidx), soap->lablen - soap->labidx, (const void*)s, n); + soap->labidx += n; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_peek_element(struct soap *soap) +{ +#ifdef WITH_DOM + struct soap_dom_attribute **att = NULL; + char *lead = NULL; +#endif + struct soap_attribute *tp, *tq = NULL; + const char *t; + char *s; + soap_wchar c; + int i; + if (soap->peeked) + { + if (!*soap->tag) + return soap->error = SOAP_NO_TAG; + return SOAP_OK; + } + soap->peeked = 1; + soap->id[0] = '\0'; + soap->href[0] = '\0'; + soap->type[0] = '\0'; + soap->arrayType[0] = '\0'; + soap->arraySize[0] = '\0'; + soap->arrayOffset[0] = '\0'; + soap->other = 0; + soap->root = -1; + soap->position = 0; + soap->null = 0; + soap->mustUnderstand = 0; + /* UTF-8 BOM? */ + c = soap_getchar(soap); + if (c == 0xEF && soap_get0(soap) == 0xBB) + { + soap_get1(soap); + c = soap_get1(soap); + if (c == 0xBF) + soap->mode &= ~SOAP_ENC_LATIN; + else + soap_unget(soap, (0x0F << 12) | (0xBB << 6) | (c & 0x3F)); /* UTF-8 */ + } + else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */ + || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */ + { + return soap->error = SOAP_UTF_ERROR; + } + else + { + soap_unget(soap, c); + } + c = soap_get(soap); +#ifdef WITH_DOM + /* whitespace leading up to the start tag is significant for DOM as-is (but comments and PIs are removed from this lead) */ + if (soap_coblank(c)) + { + soap->labidx = 0; + do + { + if (soap_append_lab(soap, NULL, 0)) + return soap->error; + s = soap->labbuf + soap->labidx; + i = soap->lablen - soap->labidx; + soap->labidx = soap->lablen; + while (soap_coblank(c) && i-- > 0) + { + *s++ = c; + c = soap_get(soap); + } + } while (soap_coblank(c) || i == 0); + *s = '\0'; + lead = soap->labbuf; + } +#else + /* skip space */ + while (soap_coblank(c)) + c = soap_get(soap); +#endif + if (c != SOAP_LT) + { + *soap->tag = '\0'; + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + soap_unget(soap, c); +#ifdef WITH_DOM + /* whitespace leading up to the end tag is significant for DOM as-is */ + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + if (lead && *lead) + soap->dom->tail = soap_strdup(soap, lead); + else + soap->dom->tail = SOAP_STR_EOS; /* body with closing tag instead of */ + } +#endif + return soap->error = SOAP_NO_TAG; + } + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); + s = soap->tag; + i = sizeof(soap->tag); + while (c != '>' && c != '/' && c > 32 && (int)c != EOF) + { + if (i > 1) + { + *s++ = (char)c; + i--; + } + c = soap_get1(soap); + } + *s = '\0'; + while (soap_coblank(c)) + c = soap_get1(soap); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM)) + { + struct soap_dom_element *elt; + elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element)); + if (!elt) + return soap->error; + elt->next = NULL; + elt->prnt = soap->dom; + elt->elts = NULL; + elt->atts = NULL; + elt->nstr = NULL; + elt->name = soap_strdup(soap, soap->tag); + elt->text = NULL; + elt->code = NULL; + elt->tail = NULL; + elt->node = NULL; + elt->type = 0; + if (lead && *lead) + elt->lead = soap_strdup(soap, lead); + else + elt->lead = NULL; + elt->soap = soap; + if (soap->dom) + { + struct soap_dom_element *p = soap->dom->elts; + if (p) + { + while (p->next) + p = p->next; + p->next = elt; + } + else + { + soap->dom->elts = elt; + } + } + soap->dom = elt; + att = &elt->atts; + if (!elt->name) + return soap->error = SOAP_EOM; + } +#endif + soap_pop_namespace(soap); + for (tp = soap->attributes; tp; tp = tp->next) + tp->visible = 0; + while ((int)c != EOF && c != '>' && c != '/') + { + s = soap->tmpbuf; + i = sizeof(soap->tmpbuf); + while (c != '=' && c != '>' && c != '/' && c > 32 && (int)c != EOF) + { + if (i > 1) + { + *s++ = (char)c; + i--; + } + c = soap_get1(soap); + } + *s = '\0'; + if (i == sizeof(soap->tmpbuf)) + return soap->error = SOAP_SYNTAX_ERROR; +#ifdef WITH_DOM + /* add attribute name to dom */ + if (att) + { + *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute)); + if (!*att) + return soap->error; + (*att)->next = NULL; + (*att)->nstr = NULL; + (*att)->name = soap_strdup(soap, soap->tmpbuf); + (*att)->text = NULL; + (*att)->soap = soap; + if (!(*att)->name) + return soap->error = SOAP_EOM; + } +#endif + if (!strncmp(soap->tmpbuf, "xmlns", 5)) + { + if (soap->tmpbuf[5] == ':') + t = soap->tmpbuf + 6; + else if (soap->tmpbuf[5]) + t = NULL; + else + t = SOAP_STR_EOS; + } + else + { + t = NULL; + } + tq = NULL; + for (tp = soap->attributes; tp; tq = tp, tp = tp->next) + { + if (!SOAP_STRCMP(tp->name, soap->tmpbuf)) + break; + } + if (!tp) + { + size_t l = strlen(soap->tmpbuf); + tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + l); + if (!tp) + return soap->error = SOAP_EOM; + (void)soap_memcpy((char*)tp->name, l + 1, soap->tmpbuf, l + 1); + tp->value = NULL; + tp->size = 0; + tp->ns = NULL; + tp->visible = 0; + /* append attribute to the end of the list */ + if (tq) + { + tq->next = tp; + tp->next = NULL; + } + else + { + tp->next = soap->attributes; + soap->attributes = tp; + } + } + while (soap_coblank(c)) + c = soap_get1(soap); + if (c == '=') + { + size_t k; + do + { + c = soap_getutf8(soap); + } while (soap_coblank(c)); + if (c != SOAP_QT && c != SOAP_AP) + { + soap_unget(soap, c); + c = ' '; /* blank delimiter */ + } + k = tp->size; + if (soap_getattrval(soap, tp->value, &k, c)) + { +#ifdef WITH_FAST + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + if (soap_store_lab(soap, tp->value, k)) + return soap->error; + if (tp->value) + SOAP_FREE(soap, tp->value); + tp->value = NULL; + for (;;) + { + k = soap->lablen - soap->labidx; + if (soap_getattrval(soap, soap->labbuf + soap->labidx, &k, c)) + { + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + soap->labidx = soap->lablen; + if (soap_append_lab(soap, NULL, 0)) + return soap->error; + } + else + { + break; + } + } + if (soap->labidx) + { + tp->size = soap->lablen; + } + else + { + tp->size = strlen(soap->labbuf) + 1; + if (tp->size < SOAP_LABLEN) + tp->size = SOAP_LABLEN; + } + tp->value = (char*)SOAP_MALLOC(soap, tp->size); + if (!tp->value) + return soap->error = SOAP_EOM; + soap_strcpy(tp->value, tp->size, soap->labbuf); +#else + tp->size = k; + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + if (soap_alloc_block(soap) == NULL) + return soap->error; + for (;;) + { + s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN); + if (!s) + return soap->error; + k = SOAP_BLKLEN; + if (soap_getattrval(soap, s, &k, c)) + { + if (soap->error != SOAP_EOM) + return soap->error; + soap->error = SOAP_OK; + soap_size_block(soap, NULL, k); + } + else + { + break; + } + } + k = tp->size + soap->blist->size; + if (SOAP_MAXALLOCSIZE > 0 && k > SOAP_MAXALLOCSIZE) + return soap->error = SOAP_EOM; + s = (char*)SOAP_MALLOC(soap, k); + if (!s) + return soap->error = SOAP_EOM; + if (tp->value) + { + (void)soap_memcpy((void*)s, k, (const void*)tp->value, tp->size); + SOAP_FREE(soap, tp->value); + } + soap_save_block(soap, NULL, s + tp->size, 0); + tp->value = s; + tp->size = k; +#endif + } + if (tp->visible) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Duplicate attribute in %s\n", soap->tag)); + return soap->error = SOAP_SYNTAX_ERROR; /* redefined (duplicate) attribute */ + } + tp->visible = 2; /* seen this attribute w/ value */ + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); +#ifdef WITH_DOM + if (att && tp->value) + { + (*att)->text = soap_strdup(soap, tp->value); + if (!(*att)->text) + return soap->error = SOAP_EOM; + } +#endif + } + else + { + tp->visible = 1; /* seen this attribute w/o value */ + } +#ifdef WITH_DOM + if (att) + att = &(*att)->next; +#endif + if (t && tp->value) + { + if (soap_push_namespace(soap, t, tp->value) == NULL) + return soap->error; + } + } +#ifdef WITH_DOM + if (att) + { + soap->dom->nstr = soap_current_namespace_tag(soap, soap->tag); + for (att = &soap->dom->atts; *att; att = &(*att)->next) + (*att)->nstr = soap_current_namespace_att(soap, (*att)->name); + } +#endif + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + soap->body = (c != '/'); + if (!soap->body) + { + do + { + c = soap_get1(soap); + } while (soap_coblank(c)); + } +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM)) + { + if (!soap->body && soap->dom->prnt) + soap->dom = soap->dom->prnt; + } +#endif + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible && tp->value) + { +#ifndef WITH_NOIDREF + if (!strcmp(tp->name, "id")) + { + if ((soap->version > 0 && !(soap->imode & SOAP_XML_TREE)) + || (soap->mode & SOAP_XML_GRAPH)) + { + *soap->id = '#'; + soap_strcpy(soap->id + 1, sizeof(soap->id) - 1, tp->value); + } + } + else if (!strcmp(tp->name, "href")) + { + if ((soap->version == 1 && !(soap->imode & SOAP_XML_TREE)) + || (soap->mode & SOAP_XML_GRAPH) + || ((soap->mode & (SOAP_ENC_MTOM | SOAP_ENC_DIME)) && *tp->value != '#')) + soap_strcpy(soap->href, sizeof(soap->href), tp->value); + } + else if (!strcmp(tp->name, "ref")) + { + if ((soap->version == 2 && !(soap->imode & SOAP_XML_TREE)) + || (soap->mode & SOAP_XML_GRAPH)) + { + *soap->href = '#'; + soap_strcpy(soap->href + (*tp->value != '#'), sizeof(soap->href) - 1, tp->value); + } + } +#else + if (!strcmp(tp->name, "href")) + { + if ((soap->mode & (SOAP_ENC_MTOM | SOAP_ENC_DIME)) && *tp->value != '#') + soap_strcpy(soap->href, sizeof(soap->href), tp->value); + } +#endif + else if (!soap_match_tag(soap, tp->name, "xsi:type")) + { + soap_strcpy(soap->type, sizeof(soap->type), tp->value); + } + else if ((!soap_match_tag(soap, tp->name, "xsi:null") + || !soap_match_tag(soap, tp->name, "xsi:nil")) + && (!strcmp(tp->value, "1") + || !strcmp(tp->value, "true"))) + { + soap->null = 1; + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:encodingStyle")) + { + if (!soap->encodingStyle) + soap->encodingStyle = SOAP_STR_EOS; + soap_version(soap); + } + else if (soap->version == 1) + { + if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arrayType")) + { + s = soap_strrchr(tp->value, '['); + if (s && (size_t)(s - tp->value) < sizeof(soap->arrayType)) + { + (void)soap_strncpy(soap->arrayType, sizeof(soap->arrayType), tp->value, s - tp->value); + soap_strcpy(soap->arraySize, sizeof(soap->arraySize), s); + } + else + soap_strcpy(soap->arrayType, sizeof(soap->arrayType), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:offset")) + { + soap_strcpy(soap->arrayOffset, sizeof(soap->arrayOffset), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:position")) + { + soap->position = soap_getposition(tp->value, soap->positions); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:root")) + { + soap->root = ((!strcmp(tp->value, "1") || !strcmp(tp->value, "true"))); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand") + && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true"))) + { + soap->mustUnderstand = 1; + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:actor")) + { + if ((!soap->actor || strcmp(soap->actor, tp->value)) + && strcmp(tp->value, "http://schemas.xmlsoap.org/soap/actor/next")) + soap->other = 1; + } + } + else if (soap->version == 2) + { +#ifndef WITH_NOIDREF + if (!soap_match_tag(soap, tp->name, "SOAP-ENC:id")) + { + *soap->id = '#'; + soap_strcpy(soap->id + 1, sizeof(soap->id) - 1, tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:ref")) + { + *soap->href = '#'; + soap_strcpy(soap->href + (*tp->value != '#'), sizeof(soap->href) - 1, tp->value); + } + else +#endif + if (!soap_match_tag(soap, tp->name, "SOAP-ENC:itemType")) + { + soap_strcpy(soap->arrayType, sizeof(soap->arrayType), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arraySize")) + { + soap_strcpy(soap->arraySize, sizeof(soap->arraySize), tp->value); + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand") + && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true"))) + { + soap->mustUnderstand = 1; + } + else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:role")) + { + if ((!soap->actor || strcmp(soap->actor, tp->value)) + && strcmp(tp->value, "http://www.w3.org/2003/05/soap-envelope/role/next")) + soap->other = 1; + } + } + else + { + if (!soap_match_tag(soap, tp->name, "wsdl:required") && !strcmp(tp->value, "true")) + soap->mustUnderstand = 1; + } + } + } +#ifdef WITH_DOM + if (soap->feltbegin) + return soap->error = soap->feltbegin(soap, soap->tag); +#endif + return soap->error = SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_retry(struct soap *soap) +{ + soap->error = SOAP_OK; + soap_revert(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_revert(struct soap *soap) +{ + if (!soap->peeked) + { + soap->peeked = 1; + if (soap->body) + soap->level--; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reverting to last element '%s' (level=%u)\n", soap->tag, soap->level)); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_ignore(struct soap *soap) +{ + int n = 0; + soap_wchar c; + soap->level++; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Ignoring XML content at level=%u\n", soap->level)); +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + if (!soap_string_in(soap, -1, -1, -1, NULL)) + return soap->error; + } + else +#endif + { + for (;;) + { + c = soap_get(soap); + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + break; + case SOAP_LT: + n++; + break; + case '/': + if (n > 0) + { + c = soap_get0(soap); + if (c == '>') + n--; + } + break; + default: + if ((int)c == EOF) + return soap->error = SOAP_EOF; + } + } +end: + soap_unget(soap, c); + } + return soap_element_end_in(soap, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_string_out(struct soap *soap, const char *s, int flag) +{ + const char *t; + soap_wchar c; + soap_wchar mask = (soap_wchar)0xFFFFFF80UL; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_strdup(soap, s); + if (!soap->dom->text) + return soap->error = SOAP_EOM; + return SOAP_OK; + } +#endif + if (flag == 2 || (soap->mode & SOAP_C_UTFSTRING)) + mask = 0; + t = s; + while ((c = *t++)) + { + switch (c) + { + case 0x09: + if (flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, " ", 5)) + return soap->error; + s = t; + } + break; + case 0x0A: + if (flag || !(soap->mode & SOAP_XML_CANONICAL)) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, " ", 5)) + return soap->error; + s = t; + } + break; + case '&': + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&", 5)) + return soap->error; + s = t; + break; + case '<': + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "<", 4)) + return soap->error; + s = t; + break; + case '>': + if (!flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, ">", 4)) + return soap->error; + s = t; + } + break; + case '"': + if (flag) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, """, 6)) + return soap->error; + s = t; + } + break; + case 0x7F: + if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "", 6)) + return soap->error; + s = t; + break; + default: +#ifndef WITH_LEANER +#ifdef HAVE_MBTOWC + if ((soap->mode & SOAP_C_MBSTRING)) + { + wchar_t wc; + int m = mbtowc(&wc, t - 1, MB_CUR_MAX); + if (m > 0 && !((soap_wchar)wc == c && m == 1 && c < 0x80)) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned long)wc)) + return soap->error; + s = t += m - 1; + continue; + } + } +#endif +#endif +#ifndef WITH_NOSTRINGTOUTF8 + if ((c & mask) || !(c & 0xFFFFFFE0UL)) + { + if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned char)c)) + return soap->error; + s = t; + } +#endif + } + } + return soap_send_raw(soap, s, t - s - 1); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_string_in(struct soap *soap, int flag, long minlen, long maxlen, const char *pattern) +{ + char *s; + char *t = NULL; + size_t i; + ULONG64 l = 0; + int n = 0, f = 0, m = 0; + soap_wchar c; +#if !defined(WITH_LEANER) && defined(HAVE_WCTOMB) + char buf[MB_LEN_MAX > 8 ? MB_LEN_MAX : 8]; +#else + char buf[8]; +#endif + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading string content, flag=%d\n", flag)); + if (flag <= 0 && soap->peeked && *soap->tag) + { +#ifndef WITH_LEAN + struct soap_attribute *tp; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String content includes tag '%s' and attributes\n", soap->tag)); + t = soap->tmpbuf; + *t = '<'; + soap_strcpy(t + 1, sizeof(soap->tmpbuf) - 1, soap->tag); + t += strlen(t); + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + size_t k = strlen(tp->name); + if (t + k + 1 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; /* too many or attribute values to large */ + *t++ = ' '; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->name, k); + t += k; + if (tp->value) + { + k = strlen(tp->value); + if (t + k + 3 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; /* too many or attribute values to large */ + *t++ = '='; + *t++ = '"'; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->value, k); + t += k; + *t++ = '"'; + } + } + } + if (!soap->body) + *t++ = '/'; + *t++ = '>'; + *t = '\0'; + t = soap->tmpbuf; + m = (int)strlen(soap->tmpbuf); +#endif + if (soap->body) + n = 1; + f = 1; + soap->peeked = 0; + } +#ifdef WITH_CDATA + if (flag <= 0) + { + int state = 0; +#ifdef WITH_FAST + soap->labidx = 0; /* use look-aside buffer */ +#else + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + for (;;) + { +#ifdef WITH_FAST + size_t k; + if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */ + return NULL; + s = soap->labbuf + soap->labidx; /* space to populate */ + k = soap->lablen - soap->labidx; /* number of bytes available */ + soap->labidx = soap->lablen; /* claim this space */ +#else + size_t k = SOAP_BLKLEN; + s = (char*)soap_push_block(soap, NULL, k); + if (!s) + return NULL; +#endif + for (i = 0; i < k; i++) + { + if (m > 0) + { + *s++ = *t++; /* copy multibyte characters */ + m--; + continue; + } + c = soap_getchar(soap); + if ((int)c == EOF) + goto end; + if ((c >= 0x80 || c < SOAP_AP) && state != 1 && !(soap->mode & SOAP_ENC_LATIN)) + { + if ((c & 0x7FFFFFFF) >= 0x80) + { + soap_unget(soap, c); + c = soap_getutf8(soap); + } + if ((c & 0x7FFFFFFF) >= 0x80 && (flag <= 0 || (soap->mode & SOAP_C_UTFSTRING))) + { + c &= 0x7FFFFFFF; + t = buf; + if (c < 0x0800) + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + m = (int)(t - buf) - 1; + t = buf; + *s++ = *t++; + continue; + } + } + switch (state) + { + case 1: + if (c == ']') + state = 4; + *s++ = (char)c; + continue; + case 2: + if (c == '-') + state = 6; + *s++ = (char)c; + continue; + case 3: + if (c == '?') + state = 8; + *s++ = (char)c; + continue; + /* CDATA */ + case 4: + if (c == ']') + state = 5; + else + state = 1; + *s++ = (char)c; + continue; + case 5: + if (c == '>') + state = 0; + else if (c != ']') + state = 1; + *s++ = (char)c; + continue; + /* comment */ + case 6: + if (c == '-') + state = 7; + else + state = 2; + *s++ = (char)c; + continue; + case 7: + if (c == '>') + state = 0; + else if (c != '-') + state = 2; + *s++ = (char)c; + continue; + /* PI */ + case 8: + if (c == '>') + state = 0; + else if (c != '?') + state = 3; + *s++ = (char)c; + continue; + } + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + *s++ = '<'; + t = (char*)"/"; + m = 1; + break; + case SOAP_LT: + if (flag == 3 || (f && n == 0)) + goto end; + n++; + *s++ = '<'; + break; + case SOAP_GT: + *s++ = '>'; + break; + case SOAP_QT: + *s++ = '"'; + break; + case SOAP_AP: + *s++ = '\''; + break; + case '/': + if (n > 0) + { + c = soap_getchar(soap); + if (c == '>') + n--; + soap_unget(soap, c); + } + *s++ = '/'; + break; + case '<': + c = soap_getchar(soap); + if (c == '/') + { + if (n == 0) + { + c = SOAP_TT; + goto end; + } + n--; + } + else if (c == '!') + { + c = soap_getchar(soap); + if (c == '[') + { + do + { + c = soap_getchar(soap); + } while ((int)c != EOF && c != '['); + if ((int)c == EOF) + goto end; + t = (char*)"![CDATA["; + m = 8; + state = 1; + } + else if (c == '-') + { + c = soap_getchar(soap); + if (c == '-') + state = 2; + t = (char*)"!-"; + m = 2; + soap_unget(soap, c); + } + else + { + t = (char*)"!"; + m = 1; + soap_unget(soap, c); + } + *s++ = '<'; + break; + } + else if (c == '?') + { + state = 3; + } + else if (flag == 3 || (f && n == 0)) + { + soap_revget1(soap); + c = '<'; + goto end; + } + else + n++; + soap_unget(soap, c); + *s++ = '<'; + break; + case '>': + *s++ = '>'; + break; + case '"': + *s++ = '"'; + break; + default: +#ifndef WITH_LEANER +#ifdef HAVE_WCTOMB + if ((soap->mode & SOAP_C_MBSTRING)) + { +#if defined(WIN32) && !defined(CYGWIN) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) + m = 0; + wctomb_s(&m, buf, sizeof(buf), (wchar_t)(c & 0x7FFFFFFF)); +#else + m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF)); +#endif + if (m >= 1 && m <= (int)MB_CUR_MAX) + { + t = buf; + *s++ = *t++; + m--; + } + else + { + *s++ = SOAP_UNKNOWN_CHAR; + m = 0; + } + } + else +#endif +#endif + *s++ = (char)(c & 0xFF); + } + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + } + } + } +#endif +#ifdef WITH_FAST + soap->labidx = 0; /* use look-aside buffer */ +#else + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + for (;;) + { +#ifdef WITH_FAST + size_t k; + if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */ + return NULL; + s = soap->labbuf + soap->labidx; /* space to populate */ + k = soap->lablen - soap->labidx; /* number of bytes available */ + soap->labidx = soap->lablen; /* claim this space */ +#else + size_t k = SOAP_BLKLEN; + s = (char*)soap_push_block(soap, NULL, k); + if (!s) + return NULL; +#endif + for (i = 0; i < k; i++) + { + if (m > 0) + { + *s++ = *t++; /* copy multibyte characters */ + m--; + continue; + } +#ifndef WITH_CDATA + if (flag <= 0) + c = soap_getchar(soap); + else +#endif + { + c = soap_getutf8(soap); + if ((soap->mode & SOAP_C_UTFSTRING)) + { + if (c >= 0x80 || (c < SOAP_AP && c >= -0x7FFFFF80)) + { + c &= 0x7FFFFFFF; + t = buf; + if (c < 0x0800) + { + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + } + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + m = (int)(t - buf) - 1; + t = buf; + *s++ = *t++; + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + continue; + } + } + } + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + *s++ = '<'; + t = (char*)"/"; + m = 1; + break; + case SOAP_LT: + if (flag == 3 || (f && n == 0)) + goto end; + n++; + *s++ = '<'; + break; + case SOAP_GT: + *s++ = '>'; + break; + case SOAP_QT: + *s++ = '"'; + break; + case SOAP_AP: + *s++ = '\''; + break; + case '/': + if (n > 0) + { + if (flag > 0) + { + c = soap_get(soap); + if (c == SOAP_GT) + n--; + } + else + { + c = soap_getchar(soap); + if (c == '>') + n--; + } + soap_unget(soap, c); + } + *s++ = '/'; + break; + case (soap_wchar)('<' | 0x80000000): + if (flag > 0) + { + *s++ = '<'; + } + else + { + *s++ = '&'; + t = (char*)"lt;"; + m = 3; + } + break; + case (soap_wchar)('>' | 0x80000000): + if (flag > 0) + { + *s++ = '>'; + } + else + { + *s++ = '&'; + t = (char*)"gt;"; + m = 3; + } + break; + case (soap_wchar)('&' | 0x80000000): + if (flag > 0) + { + *s++ = '&'; + } + else + { + *s++ = '&'; + t = (char*)"amp;"; + m = 4; + } + break; + case (soap_wchar)('"' | 0x80000000): + if (flag > 0) + { + *s++ = '"'; + } + else + { + *s++ = '&'; + t = (char*)"quot;"; + m = 5; + } + break; + case (soap_wchar)('\'' | 0x80000000): + if (flag > 0) + { + *s++ = '\''; + } + else + { + *s++ = '&'; + t = (char*)"apos;"; + m = 5; + } + break; + default: + if ((int)c == EOF) + goto end; +#ifndef WITH_CDATA + if (c == '<') + { + c = soap_getchar(soap); + soap_unget(soap, c); + if (c == '/') + { + c = SOAP_TT; + if (n == 0) + goto end; + n--; + } + else + { + n++; + } + *s++ = '<'; + } + else +#endif +#ifndef WITH_LEANER +#ifdef HAVE_WCTOMB + if ((soap->mode & SOAP_C_MBSTRING)) + { +#if defined(WIN32) && !defined(CYGWIN) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) + m = 0; + wctomb_s(&m, buf, sizeof(buf), (wchar_t)(c & 0x7FFFFFFF)); +#else + m = wctomb(buf, (wchar_t)(c & 0x7FFFFFFF)); +#endif + if (m >= 1 && m <= (int)MB_CUR_MAX) + { + t = buf; + *s++ = *t++; + m--; + } + else + { + *s++ = SOAP_UNKNOWN_CHAR; + m = 0; + } + } + else +#endif +#endif + *s++ = (char)(c & 0xFF); + } + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + } + } +end: + soap_unget(soap, c); + *s = '\0'; +#ifdef WITH_FAST + t = soap_strdup(soap, soap->labbuf); + if (!t) + return NULL; +#else + soap_size_block(soap, NULL, i + 1); + t = soap_save_block(soap, NULL, NULL, 0); +#endif + if (minlen > 0 && l < (size_t)minlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %lu chars, minlen=%ld\n", (unsigned long)l, minlen)); + soap->error = SOAP_LENGTH; + return NULL; + } +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom && *t) + { + if (flag > 0) + soap->dom->text = t; + else + soap->dom->code = t; + } +#endif + if (flag == 2) + { + if (soap_s2QName(soap, t, &t, minlen, maxlen, pattern)) + return NULL; + } + else if (flag >= 4 && t) + { + t = soap_collapse(soap, t, flag, 1); + } +#ifndef WITH_LEANER + else if (pattern && soap->fsvalidate) + { + soap->error = soap->fsvalidate(soap, pattern, t); + if (soap->error) + return NULL; + } +#endif + return t; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_wstring_out(struct soap *soap, const wchar_t *s, int flag) +{ + const char *t; + char tmp; + soap_wchar c; +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_wchar2s(soap, s); + return SOAP_OK; + } +#endif + while ((c = *s++)) + { + switch (c) + { + case 0x09: + if (flag) + t = " "; + else + t = "\t"; + break; + case 0x0A: + if (flag || !(soap->mode & SOAP_XML_CANONICAL)) + t = " "; + else + t = "\n"; + break; + case 0x0D: + t = " "; + break; + case '&': + t = "&"; + break; + case '<': + t = "<"; + break; + case '>': + if (flag) + t = ">"; + else + t = ">"; + break; + case '"': + if (flag) + t = """; + else + t = "\""; + break; + default: + if (c >= 0x20 && c < 0x80) + { + tmp = (char)c; + if (soap_send_raw(soap, &tmp, 1)) + return soap->error; + } + else + { + /* check for UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && (c & 0xFC00) == 0xD800) + { + soap_wchar d = *s; + if ((d & 0xFC00) == 0xDC00) + { + c = ((c - 0xD800) << 10) + (d - 0xDC00) + 0x10000; + s++; + } +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + else + { + c = SOAP_UNKNOWN_UNICODE_CHAR; /* Malformed UTF-16 */ + } +#endif + } + if (soap_pututf8(soap, (unsigned long)c)) + return soap->error; + } + continue; + } + if (soap_send(soap, t)) + return soap->error; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +wchar_t * +SOAP_FMAC2 +soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen, const char *pattern) +{ + wchar_t *s; + int i, n = 0, f = 0; + ULONG64 l = 0; + soap_wchar c; + char *t = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading wide string content\n")); + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + if (flag <= 0 && soap->peeked && *soap->tag) + { +#ifndef WITH_LEAN + struct soap_attribute *tp; + t = soap->tmpbuf; + *t = '<'; + soap_strcpy(t + 1, sizeof(soap->tmpbuf) - 1, soap->tag); + t += strlen(t); + for (tp = soap->attributes; tp; tp = tp->next) + { + if (tp->visible) + { + size_t k = strlen(tp->name); + if (t + k + 1 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; + *t++ = ' '; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->name, k); + t += k; + if (tp->value) + { + k = strlen(tp->value); + if (t + k + 3 >= soap->tmpbuf + sizeof(soap->tmpbuf)) + break; + *t++ = '='; + *t++ = '"'; + (void)soap_strncpy(t, sizeof(soap->tmpbuf) - (t - soap->tmpbuf), tp->value, k); + t += k; + *t++ = '"'; + } + } + } + if (!soap->body) + *t++ = '/'; + *t++ = '>'; + *t = '\0'; + t = soap->tmpbuf; +#endif + if (soap->body) + n = 1; + f = 1; + soap->peeked = 0; + } + if (soap_alloc_block(soap) == NULL) + return NULL; + for (;;) + { + s = (wchar_t*)soap_push_block(soap, NULL, sizeof(wchar_t)*SOAP_BLKLEN); + if (!s) + return NULL; + for (i = 0; i < SOAP_BLKLEN; i++) + { + if (t) + { + *s++ = (wchar_t)*t++; + if (!*t) + t = NULL; + continue; + } + c = soap_getutf8(soap); + switch (c) + { + case SOAP_TT: + if (n == 0) + goto end; + n--; + *s++ = L'<'; + soap_unget(soap, '/'); + break; + case SOAP_LT: + if (flag == 3 || (f && n == 0)) + goto end; + n++; + *s++ = L'<'; + break; + case SOAP_GT: + *s++ = L'>'; + break; + case SOAP_QT: + *s++ = L'"'; + break; + case SOAP_AP: + *s++ = L'\''; + break; + case '/': + if (n > 0) + { + c = soap_getutf8(soap); + if (c == SOAP_GT) + n--; + soap_unget(soap, c); + } + *s++ = L'/'; + break; + case '<': + if (flag > 0) + { + *s++ = L'<'; + } + else + { + *s++ = L'&'; + t = (char*)"lt;"; + } + break; + case '>': + if (flag > 0) + { + *s++ = L'>'; + } + else + { + *s++ = (wchar_t)'&'; + t = (char*)"gt;"; + } + break; + case '"': + if (flag > 0) + { + *s++ = L'"'; + } + else + { + *s++ = L'&'; + t = (char*)"quot;"; + } + break; + default: + if ((int)c == EOF) + goto end; + /* use UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && c > 0xFFFF) + { + soap_wchar c1, c2; + c1 = 0xD800 - (0x10000 >> 10) + (c >> 10); + c2 = 0xDC00 + (c & 0x3FF); + c = c1; + soap_unget(soap, c2); + } + *s++ = (wchar_t)(c & 0x7FFFFFFF); + } + l++; + if (maxlen >= 0 && l > (size_t)maxlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + } + } +end: + soap_unget(soap, c); + *s = L'\0'; + soap_size_block(soap, NULL, sizeof(wchar_t) * (i + 1)); + if (minlen > 0 && l < (size_t)minlen) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %lu chars, minlen=%ld\n", (unsigned long)l, minlen)); + soap->error = SOAP_LENGTH; + return NULL; + } + s = (wchar_t*)soap_save_block(soap, NULL, NULL, 0); +#ifndef WITH_LEAN + if (flag >= 4 && s) + s = soap_wcollapse(soap, s, flag, 1); +#endif +#ifndef WITH_LEANER + if (pattern && soap->fwvalidate) + { + soap->error = soap->fwvalidate(soap, pattern, s); + if (soap->error) + return NULL; + } +#endif +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + soap->dom->text = soap_wchar2s(soap, s); +#endif + return s; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_int2s(struct soap *soap, int n) +{ + return soap_long2s(soap, (long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outint(struct soap *soap, const char *tag, int id, const int *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, (long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2int(struct soap *soap, const char *s, int *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + n = soap_strtol(s, &r, 10); + if (s == r || *r +#ifndef WITH_LEAN + || n != (int)n +#endif +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + *p = (int)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int * +SOAP_FMAC2 +soap_inint(struct soap *soap, const char *tag, int *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (int*)soap_id_enter(soap, soap->id, p, t, sizeof(int), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2int(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (int*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(int), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_long2s(struct soap *soap, long n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "%ld", n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outlong(struct soap *soap, const char *tag, int id, const long *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2long(struct soap *soap, const char *s, long *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtol(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +long * +SOAP_FMAC2 +soap_inlong(struct soap *soap, const char *tag, long *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (long*)soap_id_enter(soap, soap->id, p, t, sizeof(long), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2long(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (long*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(long), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_LONG642s(struct soap *soap, LONG64 n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_LONG_FORMAT, n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outLONG64(struct soap *soap, const char *tag, int id, const LONG64 *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_LONG642s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtoll(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +LONG64 * +SOAP_FMAC2 +soap_inLONG64(struct soap *soap, const char *tag, LONG64 *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":integer") + && soap_match_tag(soap, soap->type, ":positiveInteger") + && soap_match_tag(soap, soap->type, ":negativeInteger") + && soap_match_tag(soap, soap->type, ":nonPositiveInteger") + && soap_match_tag(soap, soap->type, ":nonNegativeInteger") + && soap_match_tag(soap, soap->type, ":long") + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (LONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(LONG64), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2LONG64(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (LONG64*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(LONG64), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_byte2s(struct soap *soap, char n) +{ + return soap_long2s(soap, (long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outbyte(struct soap *soap, const char *tag, int id, const char *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, (long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2byte(struct soap *soap, const char *s, char *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < -128 || n > 127) + soap->error = SOAP_TYPE; + *p = (char)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_inbyte(struct soap *soap, const char *tag, char *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (char*)soap_id_enter(soap, soap->id, p, t, sizeof(char), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2byte(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (char*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(char), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_short2s(struct soap *soap, short n) +{ + return soap_long2s(soap, (long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outshort(struct soap *soap, const char *tag, int id, const short *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_long2s(soap, (long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2short(struct soap *soap, const char *s, short *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < -32768 || n > 32767) + soap->error = SOAP_TYPE; + *p = (short)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +short * +SOAP_FMAC2 +soap_inshort(struct soap *soap, const char *tag, short *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (short*)soap_id_enter(soap, soap->id, p, t, sizeof(short), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2short(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (short*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(short), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_float2s(struct soap *soap, float n) +{ +#if defined(WITH_C_LOCALE) +# if !defined(WIN32) + SOAP_LOCALE_T locale; +# endif +#else + char *s; +#endif + if (soap_isnan((double)n)) + return "NaN"; + if (soap_ispinff(n)) + return "INF"; + if (soap_isninff(n)) + return "-INF"; +#if defined(WITH_C_LOCALE) +# ifdef WIN32 + _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->float_format, SOAP_LOCALE(soap), n); +# else + locale = uselocale(SOAP_LOCALE(soap)); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), soap->float_format, n); + uselocale(locale); +# endif +#else + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), soap->float_format, n); + s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */ + if (s) + *s = '.'; +#endif + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outfloat(struct soap *soap, const char *tag, int id, const float *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_float2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2float(struct soap *soap, const char *s, float *p) +{ + if (s) + { + if (!*s) + return soap->error = SOAP_EMPTY; + if (!soap_tag_cmp(s, "INF")) + { + *p = FLT_PINFTY; + } + else if (!soap_tag_cmp(s, "+INF")) + { + *p = FLT_PINFTY; + } + else if (!soap_tag_cmp(s, "-INF")) + { + *p = FLT_NINFTY; + } + else if (!soap_tag_cmp(s, "NaN")) + { + *p = FLT_NAN; + } + else + { +/* On some systems strtof requires -std=c99 or does not even link: so we try strtod first */ +#if defined(WITH_C_LOCALE) +# if defined(HAVE_STRTOD_L) + char *r; +# ifdef WIN32 + *p = (float)_strtod_l(s, &r, SOAP_LOCALE(soap)); +# else + *p = (float)strtod_l(s, &r, SOAP_LOCALE(soap)); +# endif + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_STRTOF_L) + char *r; + *p = strtof_l((char*)s, &r, SOAP_LOCALE(soap)); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_SSCANF_L) + double n; + if (sscanf_l(s, SOAP_LOCALE(soap), "%lf", &n) != 1) + soap->error = SOAP_TYPE; + *p = (float)n; +# elif defined(HAVE_STRTOD) + char *r; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + *p = (float)strtod((char*)s, &r); + uselocale(locale); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_STRTOF) + char *r; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + *p = strtof((char*)s, &r); + uselocale(locale); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_SSCANF) + double n; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + if (sscanf(s, "%lf", &n) != 1) + soap->error = SOAP_TYPE; + uselocale(locale); + *p = (float)n; +# else + soap->error = SOAP_TYPE; +# endif +#elif defined(HAVE_STRTOD) + char *r; + *p = (float)strtod(s, &r); + if (*r) + soap->error = SOAP_TYPE; +#elif defined(HAVE_STRTOF) + char *r; + *p = strtof((char*)s, &r); + if (*r) + soap->error = SOAP_TYPE; +#elif defined(HAVE_SSCANF) + double n; + if (sscanf(s, "%lf", &n) != 1) + soap->error = SOAP_TYPE; + *p = (float)n; +#else + soap->error = SOAP_TYPE; +#endif + } + } + return soap->error; +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +static int soap_isnumeric(struct soap *soap, const char *type) +{ + if (soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":float") + && soap_match_tag(soap, soap->type, ":double") + && soap_match_tag(soap, soap->type, ":decimal") + && soap_match_tag(soap, soap->type, ":integer") + && soap_match_tag(soap, soap->type, ":positiveInteger") + && soap_match_tag(soap, soap->type, ":negativeInteger") + && soap_match_tag(soap, soap->type, ":nonPositiveInteger") + && soap_match_tag(soap, soap->type, ":nonNegativeInteger") + && soap_match_tag(soap, soap->type, ":long") + && soap_match_tag(soap, soap->type, ":int") + && soap_match_tag(soap, soap->type, ":short") + && soap_match_tag(soap, soap->type, ":byte") + && soap_match_tag(soap, soap->type, ":unsignedLong") + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return SOAP_ERR; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +float * +SOAP_FMAC2 +soap_infloat(struct soap *soap, const char *tag, float *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type != '\0' && soap_isnumeric(soap, type)) + return NULL; +#else + (void)type; +#endif + p = (float*)soap_id_enter(soap, soap->id, p, t, sizeof(float), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2float(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (float*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(float), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_double2s(struct soap *soap, double n) +{ +#if defined(WITH_C_LOCALE) +# if !defined(WIN32) + SOAP_LOCALE_T locale; +# endif +#else + char *s; +#endif + if (soap_isnan(n)) + return "NaN"; + if (soap_ispinfd(n)) + return "INF"; + if (soap_isninfd(n)) + return "-INF"; +#if defined(WITH_C_LOCALE) +# ifdef WIN32 + _sprintf_s_l(soap->tmpbuf, _countof(soap->tmpbuf), soap->double_format, SOAP_LOCALE(soap), n); +# else + locale = uselocale(SOAP_LOCALE(soap)); + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 40), soap->double_format, n); + uselocale(locale); +# endif +#else + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 40), soap->double_format, n); + s = strchr(soap->tmpbuf, ','); /* convert decimal comma to DP */ + if (s) + *s = '.'; +#endif + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outdouble(struct soap *soap, const char *tag, int id, const double *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_double2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2double(struct soap *soap, const char *s, double *p) +{ + if (s) + { + if (!*s) + return soap->error = SOAP_EMPTY; + if (!soap_tag_cmp(s, "INF")) + { + *p = DBL_PINFTY; + } + else if (!soap_tag_cmp(s, "+INF")) + { + *p = DBL_PINFTY; + } + else if (!soap_tag_cmp(s, "-INF")) + { + *p = DBL_NINFTY; + } + else if (!soap_tag_cmp(s, "NaN")) + { + *p = DBL_NAN; + } + else + { +#if defined(WITH_C_LOCALE) +# if defined(HAVE_STRTOD_L) + char *r; +# ifdef WIN32 + *p = _strtod_l(s, &r, SOAP_LOCALE(soap)); +# else + *p = strtod_l(s, &r, SOAP_LOCALE(soap)); +# endif + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_STRTOD) + char *r; + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + *p = strtod(s, &r); + uselocale(locale); + if (*r) + soap->error = SOAP_TYPE; +# elif defined(HAVE_SSCANF_L) + SOAP_LOCALE_T locale = uselocale(SOAP_LOCALE(soap)); + if (sscanf_l(s, SOAP_LOCALE(soap), "%lf", p) != 1) + soap->error = SOAP_TYPE; + uselocale(locale); +# else + soap->error = SOAP_TYPE; +# endif +#elif defined(HAVE_STRTOD) + char *r; + *p = strtod(s, &r); + if (*r) + soap->error = SOAP_TYPE; +#elif defined(HAVE_SSCANF) + if (sscanf(s, "%lf", p) != 1) + soap->error = SOAP_TYPE; +#else + soap->error = SOAP_TYPE; +#endif + } + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +double * +SOAP_FMAC2 +soap_indouble(struct soap *soap, const char *tag, double *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type != '\0' && soap_isnumeric(soap, type)) + return NULL; +#else + (void)type; +#endif + p = (double*)soap_id_enter(soap, soap->id, p, t, sizeof(double), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2double(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (double*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(double), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedByte2s(struct soap *soap, unsigned char n) +{ + return soap_unsignedLong2s(soap, (unsigned long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedByte(struct soap *soap, const char *tag, int id, const unsigned char *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedByte(struct soap *soap, const char *s, unsigned char *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < 0 || n > 255) + soap->error = SOAP_TYPE; + *p = (unsigned char)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned char * +SOAP_FMAC2 +soap_inunsignedByte(struct soap *soap, const char *tag, unsigned char *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned char*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned char), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedByte(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned char*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned char), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedShort2s(struct soap *soap, unsigned short n) +{ + return soap_unsignedLong2s(soap, (unsigned long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedShort(struct soap *soap, const char *tag, int id, const unsigned short *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedShort(struct soap *soap, const char *s, unsigned short *p) +{ + if (s) + { + long n; + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; + n = soap_strtol(s, &r, 10); + if (s == r || *r || n < 0 || n > 65535) + soap->error = SOAP_TYPE; + *p = (unsigned short)n; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned short * +SOAP_FMAC2 +soap_inunsignedShort(struct soap *soap, const char *tag, unsigned short *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned short*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned short), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedShort(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned short*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned short), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedInt2s(struct soap *soap, unsigned int n) +{ + return soap_unsignedLong2s(soap, (unsigned long)n); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedInt(struct soap *soap, const char *tag, int id, const unsigned int *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedInt(struct soap *soap, const char *s, unsigned int *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = (unsigned int)soap_strtoul(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; +#ifdef HAVE_STRTOUL + if (*p > 0 && strchr(s, '-')) + return soap->error = SOAP_TYPE; +#endif + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned int * +SOAP_FMAC2 +soap_inunsignedInt(struct soap *soap, const char *tag, unsigned int *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned int*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned int), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedInt(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned int*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned int), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_unsignedLong2s(struct soap *soap, unsigned long n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "%lu", n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outunsignedLong(struct soap *soap, const char *tag, int id, const unsigned long *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_unsignedLong2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2unsignedLong(struct soap *soap, const char *s, unsigned long *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtoul(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; +#ifdef HAVE_STRTOUL + if (*p > 0 && strchr(s, '-')) + return soap->error = SOAP_TYPE; +#endif + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +unsigned long * +SOAP_FMAC2 +soap_inunsignedLong(struct soap *soap, const char *tag, unsigned long *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (unsigned long*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned long), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2unsignedLong(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (unsigned long*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(unsigned long), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_ULONG642s(struct soap *soap, ULONG64 n) +{ + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_ULONG_FORMAT, n); + return soap->tmpbuf; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outULONG64(struct soap *soap, const char *tag, int id, const ULONG64 *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_ULONG642s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2ULONG64(struct soap *soap, const char *s, ULONG64 *p) +{ + if (s) + { + char *r; + if (!*s) + return soap->error = SOAP_EMPTY; +#ifndef WITH_NOIO +#ifndef WITH_LEAN + soap_reset_errno; +#endif +#endif + *p = soap_strtoull(s, &r, 10); + if (s == r || *r +#ifndef WITH_NOIO +#ifndef WITH_LEAN + || soap_errno == SOAP_ERANGE +#endif +#endif + ) + soap->error = SOAP_TYPE; + if (*p > 0 && strchr(s, '-')) + return soap->error = SOAP_TYPE; + } + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +ULONG64 * +SOAP_FMAC2 +soap_inULONG64(struct soap *soap, const char *tag, ULONG64 *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; +#ifndef WITH_LEAN + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":positiveInteger") + && soap_match_tag(soap, soap->type, ":nonNegativeInteger") + && soap_match_tag(soap, soap->type, ":unsignedLong") + && soap_match_tag(soap, soap->type, ":unsignedInt") + && soap_match_tag(soap, soap->type, ":unsignedShort") + && soap_match_tag(soap, soap->type, ":unsignedByte")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } +#else + (void)type; +#endif + p = (ULONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(ULONG64), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2ULONG64(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (ULONG64*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(ULONG64), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2char(struct soap *soap, const char *s, char **t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const char *r = soap_string(soap, s, flag, minlen, maxlen, pattern); + if (r && (*t = soap_strdup(soap, r)) == NULL) + return soap->error = SOAP_EOM; + } + return soap->error; +} + +/******************************************************************************/ + +#ifndef WITH_COMPAT +#ifdef __cplusplus +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2stdchar(struct soap *soap, const char *s, std::string *t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const char *r = soap_string(soap, s, flag, minlen, maxlen, pattern); + if (r) + t->assign(r); + } + return soap->error; +} +#endif +#endif + +/******************************************************************************/ + +static const char* +soap_string(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + if (minlen > 0 || maxlen >= 0) + { + size_t l; + if ((soap->mode & SOAP_C_UTFSTRING)) + l = soap_utf8len(s); + else + l = strlen(s); + if ((maxlen >= 0 && l > (size_t)maxlen) || (minlen > 0 && l < (size_t)minlen)) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } + if (flag >= 4) + s = soap_collapse(soap, (char*)s, flag, 0); +#ifndef WITH_LEANER + if (pattern && soap->fsvalidate) + { + soap->error = soap->fsvalidate(soap, pattern, s); + if (soap->error) + return NULL; + } +#else + (void)pattern; +#endif + } + return s; +} + +/******************************************************************************/ + +static char* +soap_collapse(struct soap *soap, char *s, int flag, int insitu) +{ + /* flag 4=normalizedString (replace), 5=token (collapse) */ + char *t; + size_t n; + if (!s) + return NULL; + if (flag == 4) + { + for (t = s; *t && (!soap_coblank((soap_wchar)*t) || *t == 32); t++) + continue; + if (*t) + { + /* replace white space and control chars by blanks */ + if (!insitu) + s = soap_strdup(soap, s); + for (t = s; *t; t++) + if (soap_coblank((soap_wchar)*t)) + *t = ' '; + } + return s; + } + /* collapse white space */ + for (t = s; *t && soap_coblank((soap_wchar)*t); t++) + continue; + n = strlen(t); + if (insitu && s < t) + (void)soap_memmove(s, n + 1, t, n + 1); + else + s = t; + if (n > 0) + { + if (!soap_coblank((soap_wchar)s[n-1])) + { + for (t = s; (*t && !soap_coblank((soap_wchar)*t)) || (*t == 32 && (!t[1] || !soap_coblank((soap_wchar)t[1]))); t++) + continue; + if (!*t) + return s; + } + if (!insitu) + s = soap_strdup(soap, s); + for (t = s; *t; t++) + { + if (soap_coblank((soap_wchar)*t)) + { + char *r; + *t = ' '; + for (r = t + 1; *r && soap_coblank((soap_wchar)*r); r++) + continue; + if (r > t + 1) + (void)soap_memmove(t + 1, n - (t-s), r, n - (r-s) + 1); + } + } + t--; + if (t >= s && *t == 32) + *t = '\0'; + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2QName(struct soap *soap, const char *s, char **t, long minlen, long maxlen, const char *pattern) +{ + *t = NULL; + if (s) + { + const char *r = soap_QName(soap, s, minlen, maxlen, pattern); + if (r && (*t = soap_strdup(soap, r)) == NULL) + return soap->error = SOAP_EOM; + } + return soap->error; +} + +/******************************************************************************/ + +#ifndef WITH_COMPAT +#ifdef __cplusplus +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2stdQName(struct soap *soap, const char *s, std::string *t, long minlen, long maxlen, const char *pattern) +{ + t->clear(); + if (s) + { + const char *r = soap_QName(soap, s, minlen, maxlen, pattern); + if (r) + t->assign(r); + } + return soap->error; +} +#endif +#endif + +/******************************************************************************/ + +static const char* +soap_QName(struct soap *soap, const char *s, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + char *b; + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + if (minlen > 0 || maxlen >= 0) + { + size_t l; + if ((soap->mode & SOAP_C_UTFSTRING)) + l = soap_utf8len(s); + else + l = strlen(s); + if ((maxlen >= 0 && l > (size_t)maxlen) || (minlen > 0 && l < (size_t)minlen)) + { + soap->error = SOAP_LENGTH; + return NULL; + } + } +#ifdef WITH_FAST + soap->labidx = 0; +#else + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Normalized namespace(s) of QNames '%s'", s)); + /* convert (by prefix normalize prefix) all QNames in s */ + for (;;) + { + size_t n; + struct soap_nlist *np; + const char *p = NULL; + short flag = 0; + const char *r = NULL; + size_t m = 0; +#ifndef WITH_FAST + size_t k = 0; +#endif + /* skip blanks */ + while (*s && soap_coblank((soap_wchar)*s)) + s++; + if (!*s) + break; + /* find next QName */ + n = 1; + while (s[n] && !soap_coblank((soap_wchar)s[n])) + n++; + np = soap->nlist; + /* if there is no namespace stack, or prefix is "#" or "xml" then copy string */ + if (!np || *s == '#' || !strncmp(s, "xml:", 4)) + { + r = s; + m = n; + } + else /* we normalize the QName by replacing its prefix */ + { + const char *q; + for (p = s; *p && p < s + n; p++) + if (*p == ':') + break; + if (*p == ':') + { + size_t k = p - s; + while (np && (strncmp(np->id, s, k) || np->id[k])) + np = np->next; + p++; + } + else + { + while (np && *np->id) + np = np->next; + p = s; + } + /* replace prefix */ + if (np) + { + if (np->index >= 0 && soap->local_namespaces && (q = soap->local_namespaces[np->index].id) != NULL) + { + size_t k = strlen(q); + if (q[k-1] != '_') + { + r = q; + m = k; + } + else + { + flag = 1; + r = soap->local_namespaces[np->index].ns; + m = strlen(r); + } + } + else if (np->ns) + { + flag = 1; + r = np->ns; + m = strlen(r); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI='%s')\n", s, np->index, np->ns ? np->ns : SOAP_STR_EOS)); + soap->error = SOAP_NAMESPACE; + return NULL; + } + } + else if (s[n]) /* no namespace, part of string */ + { + r = s; + m = n; + } + else /* no namespace: assume "" namespace */ + { + flag = 1; + } + } +#ifdef WITH_FAST + if ((flag && soap_append_lab(soap, "\"", 1)) + || (m && soap_append_lab(soap, r, m)) + || (flag && soap_append_lab(soap, "\"", 1)) + || (p && (soap_append_lab(soap, ":", 1) || soap_append_lab(soap, p, n - (p-s))))) + return NULL; +#else + k = 2*flag + m + (p ? n - (p-s) + 1 : 0) + (s[n] != '\0'); + b = (char*)soap_push_block(soap, NULL, k); + if (!b) + return NULL; + if (flag) + *b++ = '"'; + if (m) + { + if (soap_memcpy((void*)b, k, (const void*)r, m)) + { + soap->error = SOAP_EOM; + return NULL; + } + b += m; + } + if (flag) + *b++ = '"'; + if (p) + { + *b++ = ':'; + if (soap_memcpy((void*)b, k - m - flag - 1, (const void*)p, n - (p-s))) + { + soap->error = SOAP_EOM; + return NULL; + } + b += n - (p-s); + } +#endif + /* advance to next and add spacing */ + s += n; + while (*s && soap_coblank(*s)) + s++; + if (*s) + { +#ifdef WITH_FAST + if (soap_append_lab(soap, " ", 1)) + return NULL; +#else + *b = ' '; +#endif + } + } +#ifdef WITH_FAST + if (soap_append_lab(soap, SOAP_STR_EOS, 1)) + return NULL; + b = soap->labbuf; +#else + b = (char*)soap_push_block(soap, NULL, 1); + if (!b) + return NULL; + *b = '\0'; + b = (char*)soap_save_block(soap, NULL, NULL, 0); +#endif +#ifndef WITH_LEANER + if (pattern && soap->fsvalidate) + { + soap->error = soap->fsvalidate(soap, pattern, b); + if (soap->error) + return NULL; + } +#else + (void)pattern; +#endif + return b; + } + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_QName2s(struct soap *soap, const char *s) +{ + const char *t = NULL; + if (s) + { +#ifdef WITH_FAST + soap_store_lab(soap, SOAP_STR_EOS, 1); + soap->labidx = 0; +#else + char *b = NULL; + if (soap_alloc_block(soap) == NULL) + return NULL; +#endif + for (;;) + { + size_t n; + const char *q = NULL; + const char *r = NULL; + size_t m = 0; +#ifndef WITH_FAST + size_t k = 0; +#endif + /* skip blanks */ + while (*s && soap_coblank((soap_wchar)*s)) + s++; + if (!*s) + { +#ifdef WITH_FAST + soap->labbuf[soap->labidx > 0 ? soap->labidx - 1 : 0] = '\0'; +#else + if (!b) + return soap_strdup(soap, SOAP_STR_EOS); + --b; + *b = '\0'; +#endif + break; + } + /* find next QName */ + n = 0; + while (s[n] && !soap_coblank((soap_wchar)s[n])) + { + if (s[n] == ':') + r = s; + n++; + } + if (*s != '"') /* non-quoted: pass string as is */ + { +#ifndef WITH_LEAN + if (r && (soap->mode & SOAP_XML_CANONICAL) && !(soap->mode & SOAP_XML_CANONICAL_NA)) + soap_utilize_ns(soap, s, 1); +#endif + r = s; + m = n + 1; + } + else /* prefix quoted URI-based string */ + { + q = strchr(s + 1, '"'); + if (q) + { + struct Namespace *p = soap->local_namespaces; + if (p) + { + for (; p->id; p++) + { + if (p->ns) + if (!soap_tag_cmp(s + 1, p->ns)) + break; + if (p->in) + if (!soap_tag_cmp(s + 1, p->in)) + break; + } + } + q++; + /* URL is in the namespace table? */ + if (p && p->id) + { + r = p->id; + m = strlen(r); + } + else /* not in namespace table: create xmlns binding */ + { + char *x = soap_strdup(soap, s + 1); + if (!x) + return NULL; + x[q - s - 2] = '\0'; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 27), "xmlns:_%d", soap->idnum++); + soap_set_attr(soap, soap->tmpbuf, x, 1); + r = soap->tmpbuf + 6; + m = strlen(r); + } + } + } + /* copy normalized QName into buffer, including the ending blank or NUL */ +#ifdef WITH_FAST + if ((m && soap_append_lab(soap, r, m)) + || (q && soap_append_lab(soap, q, n - (q - s) + 1))) + return NULL; +#else + k = m + (q ? n - (q - s) + 1 : 0); + b = (char*)soap_push_block(soap, NULL, k); + if (!b) + { + soap->error = SOAP_EOM; + return NULL; + } + if (soap_memcpy((void*)b, k, (const void*)r, m)) + { + soap->error = SOAP_EOM; + return NULL; + } + b += m; + if (q) + { + if (soap_memcpy((void*)b, k - m, (const void*)q, n - (q - s) + 1)) + { + soap->error = SOAP_EOM; + return NULL; + } + b += n - (q - s) + 1; + } +#endif + /* advance to next */ + s += n; + } +#ifdef WITH_FAST + t = soap_strdup(soap, soap->labbuf); + if (!t) + soap->error = SOAP_EOM; +#else + t = (char*)soap_save_block(soap, NULL, NULL, 0); +#endif + } + return t; +} + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2wchar(struct soap *soap, const char *s, wchar_t **t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const wchar_t *r = soap_wstring(soap, s, flag, minlen, maxlen, pattern); + if (r && (*t = soap_wstrdup(soap, r)) == NULL) + return soap->error = SOAP_EOM; + } + return soap->error; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_COMPAT +#ifdef __cplusplus +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2stdwchar(struct soap *soap, const char *s, std::wstring *t, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + const wchar_t *r = soap_wstring(soap, s, flag, minlen, maxlen, pattern); + if (r) + t->assign(r); + } + return soap->error; +} +#endif +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static const wchar_t* +soap_wstring(struct soap *soap, const char *s, int flag, long minlen, long maxlen, const char *pattern) +{ + if (s) + { + size_t l; + soap_wchar c; + wchar_t *t; + if (maxlen < 0 && soap->maxlength > 0) + maxlen = soap->maxlength; + soap->labidx = 0; + if ((soap->mode & SOAP_ENC_LATIN)) + { + wchar_t *r; + if (soap_append_lab(soap, NULL, sizeof(wchar_t) * (strlen(s) + 1))) + return NULL; + r = (wchar_t*)soap->labbuf; + while (*s) + *r++ = (wchar_t)*s++; + } + else + { + /* Convert UTF8 to wchar_t */ + while (*s) + { + c = (unsigned char)*s++; + if (c >= 0x80) + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + soap_wchar c1, c2, c3; + c1 = (unsigned char)*s; + if (c <= 0xC1 || (c1 & 0xC0) != 0x80) + { + c = SOAP_UNKNOWN_UNICODE_CHAR; + } + else + { + ++s; + c1 &= 0x3F; + if (c < 0xE0) + { + c = (((c & 0x1F) << 6) | c1); + } + else + { + c2 = (unsigned char)*s; + if ((c == 0xE0 && c1 < 0x20) || (c2 & 0xC0) != 0x80) + { + c = SOAP_UNKNOWN_UNICODE_CHAR; + } + else + { + ++s; + c2 &= 0x3F; + if (c < 0xF0) + { + c = (((c & 0x0F) << 12) | (c1 << 6) | c2); + } + else + { + c3 = (unsigned char)*s; + if ((c == 0xF0 && c1 < 0x10) || (c == 0xF4 && c1 >= 0x10) || c >= 0xF5 || (c3 & 0xC0) != 0x80) + { + c = SOAP_UNKNOWN_UNICODE_CHAR; + } + else + { + ++s; + c = (((c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | (c3 & 0x3F)); + } + } + } + } + } +#else + soap_wchar c1, c2, c3, c4; + c1 = (unsigned char)*s; + if (c1) + { + s++; + c1 &= 0x3F; + if (c < 0xE0) + { + c = (wchar_t)(((soap_wchar)(c & 0x1F) << 6) | c1); + } + else + { + c2 = (unsigned char)*s; + if (c2) + { + s++; + c2 &= 0x3F; + if (c < 0xF0) + { + c = (wchar_t)(((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2); + } + else + { + c3 = (unsigned char)*s; + if (c3) + { + s++; + c3 &= 0x3F; + if (c < 0xF8) + { + c = (wchar_t)(((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3); + } + else + { + c4 = (unsigned char)*s; + if (c4) + { + s++; + c4 &= 0x3F; + if (c < 0xFC) + { + c = (wchar_t)(((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4); + } + else + { + c = (wchar_t)(((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (unsigned char)(*s & 0x3F)); + if (*s) + s++; + } + } + } + } + } + } + } + } +#endif + } + /* use UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && c > 0xFFFF) + { + wchar_t c1, c2; + c1 = 0xD800 - (0x10000 >> 10) + (c >> 10); + c2 = 0xDC00 + (c & 0x3FF); + if (soap_append_lab(soap, (const char*)&c1, sizeof(wchar_t)) || soap_append_lab(soap, (const char*)&c2, sizeof(wchar_t))) + return NULL; + } + else if (soap_append_lab(soap, (const char*)&c, sizeof(wchar_t))) + { + return NULL; + } + } + } + l = soap->labidx / sizeof(wchar_t); + c = L'\0'; + if (soap_append_lab(soap, (const char*)&c, sizeof(wchar_t))) + return NULL; + if ((maxlen >= 0 && l > (size_t)maxlen) || (minlen > 0 && l < (size_t)minlen)) + { + soap->error = SOAP_LENGTH; + return NULL; + } + t = (wchar_t*)soap->labbuf; +#ifndef WITH_LEAN + if (flag >= 4 && t) + t = soap_wcollapse(soap, t, flag, 1); +#endif +#ifndef WITH_LEANER + if (pattern && soap->fwvalidate) + { + soap->error = soap->fwvalidate(soap, pattern, t); + if (soap->error) + return NULL; + } +#endif + return t; + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static wchar_t* +soap_wcollapse(struct soap *soap, wchar_t *s, int flag, int insitu) +{ + /* flag 4=normalizedString (replace), 5=token (collapse) */ + wchar_t *t; + size_t n; + if (!s) + return NULL; + if (flag == 4) + { + for (t = s; *t && (!soap_coblank((soap_wchar)*t) || *t == 32); t++) + continue; + if (*t) + { + /* replace blanks and control char by space */ + if (!insitu) + s = soap_wstrdup(soap, s); + if (s) + for (t = s; *t; t++) + if (soap_coblank((soap_wchar)*t)) + *t = L' '; + } + return s; + } + /* collapse white space */ + for (t = s; *t && soap_coblank((soap_wchar)*t); t++) + continue; + n = 0; + while (t[n]) + n++; + if (insitu && s < t) + (void)soap_memmove(s, n + 1, t, n + 1); + else + s = t; + if (n > 0) + { + if (!soap_coblank((soap_wchar)s[n-1])) + { + for (t = s; (*t && !soap_coblank((soap_wchar)*t)) || (*t == 32 && (!t[1] || !soap_coblank((soap_wchar)t[1]))); t++) + continue; + if (!*t) + return s; + } + if (!insitu) + s = soap_wstrdup(soap, s); + if (s) + { + for (t = s; *t; t++) + { + if (soap_coblank((soap_wchar)*t)) + { + wchar_t *r; + *t = L' '; + for (r = t + 1; *r && soap_coblank((soap_wchar)*r); r++) + continue; + if (r > t + 1) + (void)soap_memmove(t + 1, sizeof(wchar_t) * (n - (t-s)), r, sizeof(wchar_t) * (n - (r-s) + 1)); + } + } + t--; + if (t >= s && *t == 32) + *t = L'\0'; + } + } + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_wchar2s(struct soap *soap, const wchar_t *s) +{ + soap_wchar c; + char *r, *t; + const wchar_t *q = s; + size_t n = 0; + if (!s) + return NULL; + while ((c = *q++)) + { + if (c > 0 && c < 0x80) + n++; + else +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + n += 4; +#else + n += 6; +#endif + } + r = t = (char*)soap_malloc(soap, n + 1); + if (r) + { + /* Convert wchar to UTF8 (chars above U+10FFFF are silently converted, but should not be used) */ + while ((c = *s++)) + { + if (c > 0 && c < 0x80) + { + *t++ = (char)c; + } + else + { + /* check for UTF16 encoding when wchar_t is too small to hold UCS */ + if (sizeof(wchar_t) < 4 && (c & 0xFC00) == 0xD800) + { + soap_wchar d = *s; + if ((d & 0xFC00) == 0xDC00) + { + c = ((c - 0xD800) << 10) + (d - 0xDC00) + 0x10000; + s++; + } +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + else + { + c = SOAP_UNKNOWN_UNICODE_CHAR; /* Malformed UTF-16 */ + } +#endif + } + if (c < 0x0800) + { + *t++ = (char)(0xC0 | ((c >> 6) & 0x1F)); + } + else + { +#ifdef WITH_REPLACE_ILLEGAL_UTF8 + if (!((c >= 0x80 && c <= 0xD7FF) || (c >= 0xE000 && c <= 0xFFFD) || (c >= 0x10000 && c <= 0x10FFFF))) + c = SOAP_UNKNOWN_UNICODE_CHAR; +#endif + if (c < 0x010000) + { + *t++ = (char)(0xE0 | ((c >> 12) & 0x0F)); + } + else + { + if (c < 0x200000) + { + *t++ = (char)(0xF0 | ((c >> 18) & 0x07)); + } + else + { + if (c < 0x04000000) + { + *t++ = (char)(0xF8 | ((c >> 24) & 0x03)); + } + else + { + *t++ = (char)(0xFC | ((c >> 30) & 0x01)); + *t++ = (char)(0x80 | ((c >> 24) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 18) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 12) & 0x3F)); + } + *t++ = (char)(0x80 | ((c >> 6) & 0x3F)); + } + *t++ = (char)(0x80 | (c & 0x3F)); + } + } + *t = '\0'; + } + return r; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outstring(struct soap *soap, const char *tag, int id, char *const*p, const char *type, int n) +{ + id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n, NULL); + if (id < 0) + return soap->error; + if (!**p && (soap->mode & SOAP_C_NILSTRING)) + return soap_element_null(soap, tag, id, type); + if (soap_element_begin_out(soap, tag, id, type) + || soap_string_out(soap, *p, 0) + || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char ** +SOAP_FMAC2 +soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen, const char *pattern) +{ + (void)type; + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (char**)soap_malloc(soap, sizeof(char*)); + if (!p) + return NULL; + } + if (soap->null) + { + *p = NULL; + } + else if (soap->body) + { + *p = soap_string_in(soap, flag, minlen, maxlen, pattern); + if (!*p || !(char*)soap_id_enter(soap, soap->id, *p, t, sizeof(char*), NULL, NULL, NULL, NULL)) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + else if (*soap->href != '#') + { + if (minlen > 0) + { + soap->error = SOAP_LENGTH; + return NULL; + } + *p = soap_strdup(soap, SOAP_STR_EOS); + if (!*p) + return NULL; + } + if (*soap->href == '#') + p = (char**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(char**), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outwstring(struct soap *soap, const char *tag, int id, wchar_t *const*p, const char *type, int n) +{ + id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n, NULL); + if (id < 0) + return soap->error; + if (!**p && (soap->mode & SOAP_C_NILSTRING)) + return soap_element_null(soap, tag, id, type); + if (soap_element_begin_out(soap, tag, id, type) + || soap_wstring_out(soap, *p, 0) + || soap_element_end_out(soap, tag)) + return soap->error; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +wchar_t ** +SOAP_FMAC2 +soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type, int t, int flag, long minlen, long maxlen, const char *pattern) +{ + (void)type; + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*)); + if (!p) + return NULL; + } + if (soap->null) + { + *p = NULL; + } + else if (soap->body) + { + *p = soap_wstring_in(soap, flag, minlen, maxlen, pattern); + if (!*p || !(wchar_t*)soap_id_enter(soap, soap->id, *p, t, sizeof(wchar_t*), NULL, NULL, NULL, NULL)) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + else if (*soap->href != '#') + { + if (minlen > 0) + { + soap->error = SOAP_LENGTH; + return NULL; + } + *p = soap_wstrdup(soap, L""); + } + if (*soap->href == '#') + p = (wchar_t**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(wchar_t**), 0, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifdef UNDER_CE +/* WinCE mktime (based on the mingw-runtime, public domain) */ +#define __FILETIME_to_ll(f) ((long long)(f).dwHighDateTime << 32 | (long long)(f).dwLowDateTime) +static time_t +mktime(struct tm *pt) +{ + SYSTEMTIME s, s1, s2; + FILETIME f, f1, f2; + long long diff; + GetSystemTime(&s1); + GetLocalTime(&s2); + SystemTimeToFileTime(&s1, &f1); + SystemTimeToFileTime(&s2, &f2); + diff = (__FILETIME_to_ll(f2) - __FILETIME_to_ll(f1)) / 10000000LL; + s.wYear = pt->tm_year + 1900; + s.wMonth = pt->tm_mon + 1; + s.wDayOfWeek = pt->tm_wday; + s.wDay = pt->tm_mday; + s.wHour = pt->tm_hour; + s.wMinute = pt->tm_min; + s.wSecond = pt->tm_sec; + s.wMilliseconds = 0; + SystemTimeToFileTime(&s, &f); + return (time_t)((__FILETIME_to_ll(f) - 116444736000000000LL) / 10000000LL) - (time_t)diff; +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifdef UNDER_CE +/* WinCE gmtime_r (based on the mingw-runtime, public domain) */ +#define HAVE_GMTIME_R +static struct tm* +gmtime_r(const time_t *t, struct tm *pt) +{ + FILETIME f, f1, f2; + SYSTEMTIME s, s1 = {0}; + long long time = (long long)(*t) * 10000000LL + 116444736000000000LL; + f.dwHighDateTime = (DWORD)((time >> 32) & 0x00000000FFFFFFFF); + f.dwLowDateTime = (DWORD)(time & 0x00000000FFFFFFFF); + FileTimeToSystemTime(&f, &s); + pt->tm_year = s.wYear - 1900; + pt->tm_mon = s.wMonth - 1; + pt->tm_wday = s.wDayOfWeek; + pt->tm_mday = s.wDay; + s1.wYear = s.wYear; + s1.wMonth = 1; + s1.wDayOfWeek = 1; + s1.wDay = 1; + SystemTimeToFileTime(&s1, &f1); + SystemTimeToFileTime(&s, &f2); + pt->tm_yday = (((__FILETIME_to_ll(f2) - __FILETIME_to_ll(f1)) / 10000000LL) / (60 * 60 * 24)); + pt->tm_hour = s.wHour; + pt->tm_min = s.wMinute; + pt->tm_sec = s.wSecond; + pt->tm_isdst = 0; + return pt; +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifdef UNDER_CE +/* WinCE very simple strftime for format "%Y-%m-%dT%H:%M:%SZ", note: %F and %T not supported by MS */ +static size_t +strftime(char *buf, size_t len, const char *format, const struct tm *pT) +{ + (void)len; (void)format; +#ifndef WITH_NOZONE + (SOAP_SNPRINTF(buf, len, 20), "%04d-%02d-%02dT%02d:%02d:%02dZ", pT->tm_year + 1900, pT->tm_mon + 1, pT->tm_mday, pT->tm_hour, pT->tm_min, pT->tm_sec); +#else + (SOAP_SNPRINTF(buf, len, 20), "%04d-%02d-%02dT%02d:%02d:%02d", pT->tm_year + 1900, pT->tm_mon + 1, pT->tm_mday, pT->tm_hour, pT->tm_min, pT->tm_sec); +#endif + return len; +} +#endif +#endif + +/******************************************************************************/ + +#if !defined(WITH_LEAN) || defined(WITH_COOKIES) +SOAP_FMAC1 +time_t +SOAP_FMAC2 +soap_timegm(struct tm *T) +{ +#if defined(HAVE_TIMEGM) + return timegm(T); +#else + time_t t, g, z; + struct tm tm; +#ifndef HAVE_GMTIME_R + struct tm *tp; +#endif + t = mktime(T); + if (t == (time_t)-1) + return (time_t)-1; +#ifdef HAVE_GMTIME_R + if (gmtime_r(&t, &tm) == SOAP_FUNC_R_ERR) + return (time_t)-1; +#else + tp = gmtime(&t); + if (!tp) + return (time_t)-1; + tm = *tp; +#endif + tm.tm_isdst = 0; + g = mktime(&tm); + if (g == (time_t)-1) + return (time_t)-1; + z = g - t; + return t - z; +#endif +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_dateTime2s(struct soap *soap, time_t n) +{ + struct tm T, *pT = &T; + size_t l = 0; +#if defined(HAVE_GMTIME_R) && !defined(WITH_NOZONE) + if (gmtime_r(&n, pT) != SOAP_FUNC_R_ERR) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT); +#elif defined(HAVE_GMTIME) && !defined(WITH_NOZONE) + pT = gmtime(&n); + if (pT) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT); +#elif (defined(HAVE_TM_GMTOFF) || defined(HAVE_STRUCT_TM_TM_GMTOFF) || defined(HAVE_STRUCT_TM___TM_GMTOFF)) && !defined(WITH_NOZONE) +#if defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + { + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT); + if (l) + { + (void)soap_memmove(soap->tmpbuf + 23, sizeof(soap->tmpbuf) - 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */ + soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */ + } + } +#else + pT = localtime(&n); + if (pT) + { + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S%z", pT); + if (l) + { + (void)soap_memmove(soap->tmpbuf + 23, sizeof(soap->tmpbuf) - 23, soap->tmpbuf + 22, 3); /* 2000-03-01T02:00:00+0300 */ + soap->tmpbuf[22] = ':'; /* 2000-03-01T02:00:00+03:00 */ + } + } +#endif +#elif defined(HAVE_GETTIMEOFDAY) && !defined(WITH_NOZONE) +#if defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + { + struct timeval tv; + struct timezone tz; + memset((void*)&tz, 0, sizeof(tz)); + gettimeofday(&tv, &tz); + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60); + } +#else + pT = localtime(&n); + if (pT) + { + struct timeval tv; + struct timezone tz; + memset((void*)&tz, 0, sizeof(tz)); + gettimeofday(&tv, &tz); + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -tz.tz_minuteswest/60+(pT->tm_isdst!=0), abs(tz.tz_minuteswest)%60); + } +#endif +#elif defined(HAVE_FTIME) && !defined(WITH_NOZONE) +#if defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + { + struct timeb t; + memset((void*)&t, 0, sizeof(t)); +#ifdef __BORLANDC__ + ::ftime(&t); +#else + ftime(&t); +#endif + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60); + } +#else + pT = localtime(&n); + if (pT) + { + struct timeb t; + memset((void*)&t, 0, sizeof(t)); +#ifdef __BORLANDC__ + ::ftime(&t); +#else + ftime(&t); +#endif + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); + if (l) + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, 7), "%+03d:%02d", -t.timezone/60+(pT->tm_isdst!=0), abs(t.timezone)%60); + } +#endif +#elif defined(HAVE_LOCALTIME_R) + if (localtime_r(&n, pT) != SOAP_FUNC_R_ERR) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); +#else + pT = localtime(&n); + if (pT) + l = strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT); +#endif + if (!l) + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), "1969-12-31T23:59:59Z"); + return soap->tmpbuf; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outdateTime(struct soap *soap, const char *tag, int id, const time_t *p, const char *type, int n) +{ + if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type) + || soap_string_out(soap, soap_dateTime2s(soap, *p), 0)) + return soap->error; + return soap_element_end_out(soap, tag); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_s2dateTime(struct soap *soap, const char *s, time_t *p) +{ + *p = 0; + if (s) + { + char *t; + unsigned long d; + struct tm T; + if (!*s) + return soap->error = SOAP_EMPTY; + memset((void*)&T, 0, sizeof(T)); + d = soap_strtoul(s, &t, 10); + if (*t == '-') + { + /* YYYY-MM-DD */ + T.tm_year = (int)d; + T.tm_mon = (int)soap_strtoul(t + 1, &t, 10); + T.tm_mday = (int)soap_strtoul(t + 1, &t, 10); + } + else if (!(soap->mode & SOAP_XML_STRICT)) + { + /* YYYYMMDD */ + T.tm_year = (int)(d / 10000); + T.tm_mon = (int)(d / 100 % 100); + T.tm_mday = (int)(d % 100); + } + else + { + return soap->error = SOAP_TYPE; + } + if (*t == 'T' || ((*t == 't' || *t == ' ') && !(soap->mode & SOAP_XML_STRICT))) + { + d = soap_strtoul(t + 1, &t, 10); + if (*t == ':') + { + /* Thh:mm:ss */ + T.tm_hour = (int)d; + T.tm_min = (int)soap_strtoul(t + 1, &t, 10); + T.tm_sec = (int)soap_strtoul(t + 1, &t, 10); + } + else if (!(soap->mode & SOAP_XML_STRICT)) + { + /* Thhmmss */ + T.tm_hour = (int)(d / 10000); + T.tm_min = (int)(d / 100 % 100); + T.tm_sec = (int)(d % 100); + } + else + { + return soap->error = SOAP_TYPE; + } + } + if (T.tm_year == 1) + T.tm_year = 70; + else + T.tm_year -= 1900; + T.tm_mon--; + if (*t == '.') + { + for (t++; *t; t++) + if (*t < '0' || *t > '9') + break; + } + if (*t == ' ' && !(soap->mode & SOAP_XML_STRICT)) + t++; + if (*t) + { +#ifndef WITH_NOZONE + if (*t == '+' || *t == '-') + { + int h, m; + m = (int)soap_strtol(t, &t, 10); + if (*t == ':') + { + /* +hh:mm */ + h = m; + m = (int)soap_strtol(t + 1, &t, 10); + if (h < 0) + m = -m; + } + else if (!(soap->mode & SOAP_XML_STRICT)) + { + /* +hhmm */ + h = m / 100; + m = m % 100; + } + else + { + /* +hh */ + h = m; + m = 0; + } + if (*t) + return soap->error = SOAP_TYPE; + T.tm_min -= m; + T.tm_hour -= h; + /* put hour and min in range */ + T.tm_hour += T.tm_min / 60; + T.tm_min %= 60; + if (T.tm_min < 0) + { + T.tm_min += 60; + T.tm_hour--; + } + T.tm_mday += T.tm_hour / 24; + T.tm_hour %= 24; + if (T.tm_hour < 0) + { + T.tm_hour += 24; + T.tm_mday--; + } + /* note: day of the month may be out of range, timegm() handles it */ + } + else if (*t != 'Z') + { + return soap->error = SOAP_TYPE; + } +#endif + *p = soap_timegm(&T); + } + else /* no UTC or timezone, so assume we got a localtime */ + { + T.tm_isdst = -1; + *p = mktime(&T); + } + } + return soap->error; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +SOAP_FMAC1 +time_t * +SOAP_FMAC2 +soap_indateTime(struct soap *soap, const char *tag, time_t *p, const char *type, int t) +{ + if (soap_element_begin_in(soap, tag, 0, NULL)) + return NULL; + if (*soap->type + && soap_match_tag(soap, soap->type, type) + && soap_match_tag(soap, soap->type, ":dateTime")) + { + soap->error = SOAP_TYPE; + soap_revert(soap); + return NULL; + } + p = (time_t*)soap_id_enter(soap, soap->id, p, t, sizeof(time_t), NULL, NULL, NULL, NULL); + if (!p) + return NULL; + if (*soap->href != '#') + { + int err = soap_s2dateTime(soap, soap_value(soap), p); + if ((soap->body && soap_element_end_in(soap, tag)) || err) + return NULL; + } + else + { + p = (time_t*)soap_id_forward(soap, soap->href, p, 0, t, t, sizeof(time_t), 0, NULL, NULL); + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + } + return p; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outliteral(struct soap *soap, const char *tag, char *const*p, const char *type) +{ + if (tag && *tag != '-') + if (soap_element_begin_out(soap, tag, 0, type)) + return soap->error; + if (p && *p) + if (soap_send(soap, *p)) /* send as-is */ + return soap->error; + if (tag && *tag != '-') + return soap_element_end_out(soap, tag); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char ** +SOAP_FMAC2 +soap_inliteral(struct soap *soap, const char *tag, char **p) +{ + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (soap->error != SOAP_NO_TAG || soap_peek(soap) == SOAP_TT) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (char**)soap_malloc(soap, sizeof(char*)); + if (!p) + return NULL; + } + if (soap->body || (tag && *tag == '-')) + { + if (tag && *tag != '-') + *p = soap_string_in(soap, -1, -1, -1, NULL); + else + *p = soap_string_in(soap, 0, -1, -1, NULL); + if (!*p) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (soap->null) + { + *p = NULL; + } + else + { + *p = soap_strdup(soap, SOAP_STR_EOS); + } + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_outwliteral(struct soap *soap, const char *tag, wchar_t *const*p, const char *type) +{ + if (tag && *tag != '-') + if (soap_element_begin_out(soap, tag, 0, type)) + return soap->error; + if (p) + { + wchar_t c; + const wchar_t *s = *p; + while ((c = *s++)) + { + if (soap_pututf8(soap, (unsigned long)c)) /* send as-is in UTF8 */ + return soap->error; + } + } + if (tag && *tag != '-') + return soap_element_end_out(soap, tag); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +wchar_t ** +SOAP_FMAC2 +soap_inwliteral(struct soap *soap, const char *tag, wchar_t **p) +{ + if (soap_element_begin_in(soap, tag, 1, NULL)) + { + if (soap->error != SOAP_NO_TAG || soap_peek(soap) == SOAP_TT) + return NULL; + soap->error = SOAP_OK; + } + if (!p) + { + p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*)); + if (!p) + return NULL; + } + if (soap->body) + { + if (tag && *tag != '-') + *p = soap_wstring_in(soap, -1, -1, -1, NULL); + else + *p = soap_wstring_in(soap, 0, -1, -1, NULL); + if (!*p) + return NULL; + if (!**p && tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + } + else if (tag && *tag == '-') + { + soap->error = SOAP_NO_TAG; + return NULL; + } + else if (soap->null) + { + *p = NULL; + } + else + { + *p = soap_wstrdup(soap, L""); + } + if (soap->body && soap_element_end_in(soap, tag)) + return NULL; + return p; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_value(struct soap *soap) +{ + size_t i; + soap_wchar c = 0; + char *s = soap->tmpbuf; + if (!soap->body) + return SOAP_STR_EOS; + do + { + c = soap_get(soap); + } while (soap_coblank(c)); + for (i = 0; i < sizeof(soap->tmpbuf) - 1; i++) + { + if (c == SOAP_TT || c == SOAP_LT || (int)c == EOF) + break; + *s++ = (char)c; + c = soap_get(soap); + } + for (s--; i > 0; i--, s--) + { + if (!soap_coblank((soap_wchar)*s)) + break; + } + s[1] = '\0'; + soap->tmpbuf[sizeof(soap->tmpbuf) - 1] = '\0'; /* appease */ + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element content value='%s'\n", soap->tmpbuf)); + if (c == SOAP_TT || c == SOAP_LT || (int)c == EOF) + { + soap_unget(soap, c); + } + else + { + soap->error = SOAP_LENGTH; + return NULL; + } +#ifdef WITH_DOM + if ((soap->mode & SOAP_XML_DOM) && soap->dom) + { + soap->dom->text = soap_strdup(soap, soap->tmpbuf); + if (!soap->dom->text) + return NULL; + } +#endif + return soap->tmpbuf; /* return non-null pointer */ +} + +/******************************************************************************/ + +#if !defined(WITH_LEANER) || !defined(WITH_NOHTTP) +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getline(struct soap *soap, char *buf, int len) +{ + char *s = buf; + int i = len; + soap_wchar c = 0; + for (;;) + { + while (i > 1) + { + c = soap_getchar(soap); + if (c == '\r' || c == '\n') + break; + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + *s++ = (char)c; + i--; + } + *s = '\0'; + if (c != '\n') + c = soap_getchar(soap); /* got \r or something else, now get \n */ + if (c == '\n') + { + if (i == len) /* empty line: end of HTTP/MIME header */ + break; + c = soap_get0(soap); + if (c != ' ' && c != '\t') /* HTTP line continuation? */ + break; + } + else if ((int)c == EOF) + { + return soap->error = SOAP_CHK_EOF; + } + else if (i <= 1) + { + return soap->error = SOAP_HDR; + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +static ULONG64 +soap_count_attachments(struct soap *soap) +{ +#ifndef WITH_LEANER + struct soap_multipart *content; + ULONG64 count = soap->count; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the message size with attachments, current count=" SOAP_ULONG_FORMAT "\n", count)); + if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the size of DIME attachments\n")); + for (content = soap->dime.first; content; content = content->next) + { + count += 12 + ((content->size+3)&(~3)); + if (content->id) + count += ((strlen(content->id)+3)&(~3)); + if (content->type) + count += ((strlen(content->type)+3)&(~3)); + if (content->options) + count += ((((unsigned char)content->options[2] << 8) | ((unsigned char)content->options[3]))+7)&(~3); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Size of DIME attachment content is %lu bytes\n", (unsigned long)content->size)); + } + } + if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary) + { + size_t n = strlen(soap->mime.boundary); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Calculating the size of MIME attachments\n")); + for (content = soap->mime.first; content; content = content->next) + { + const char *s; + /* count \r\n--boundary\r\n */ + count += 6 + n; + /* count Content-Type: ...\r\n */ + if (content->type) + count += 16 + strlen(content->type); + /* count Content-Transfer-Encoding: ...\r\n */ + s = soap_code_str(mime_codes, content->encoding); + if (s) + count += 29 + strlen(s); + /* count Content-ID: ...\r\n */ + if (content->id) + count += 14 + strlen(content->id); + /* count Content-Location: ...\r\n */ + if (content->location) + count += 20 + strlen(content->location); + /* count Content-Description: ...\r\n */ + if (content->description) + count += 23 + strlen(content->description); + /* count \r\n...content */ + count += 2 + content->size; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Size of MIME attachment content is %lu bytes\n", (unsigned long)content->size)); + } + /* count \r\n--boundary-- */ + count += 6 + n; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New count=" SOAP_ULONG_FORMAT "\n", count)); + return count; +#else + return soap->count; +#endif +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_putdimefield(struct soap *soap, const char *s, size_t n) +{ + if (soap_send_raw(soap, s, n)) + return soap->error; + return soap_send_raw(soap, SOAP_STR_PADDING, -(long)n&3); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_dime_option(struct soap *soap, unsigned short optype, const char *option) +{ + size_t n; + char *s = NULL; + if (option) + { + n = strlen(option); + s = (char*)soap_malloc(soap, n + 5); + if (s) + { + s[0] = (char)(optype >> 8); + s[1] = (char)(optype & 0xFF); + s[2] = (char)(n >> 8); + s[3] = (char)(n & 0xFF); + soap_strcpy(s + 4, n + 1, option); + } + } + return s; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putdimehdr(struct soap *soap) +{ + unsigned char tmp[12]; + size_t optlen = 0, idlen = 0, typelen = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS)); + if (soap->dime.options) + optlen = (((unsigned char)soap->dime.options[2] << 8) | ((unsigned char)soap->dime.options[3])) + 4; + if (soap->dime.id) + { + idlen = strlen(soap->dime.id); + if (idlen > 0x0000FFFF) + idlen = 0x0000FFFF; + } + if (soap->dime.type) + { + typelen = strlen(soap->dime.type); + if (typelen > 0x0000FFFF) + typelen = 0x0000FFFF; + } + tmp[0] = SOAP_DIME_VERSION | (soap->dime.flags & 0x7); + tmp[1] = soap->dime.flags & 0xF0; + tmp[2] = (char)(optlen >> 8); + tmp[3] = (char)(optlen & 0xFF); + tmp[4] = (char)(idlen >> 8); + tmp[5] = (char)(idlen & 0xFF); + tmp[6] = (char)(typelen >> 8); + tmp[7] = (char)(typelen & 0xFF); + tmp[8] = (char)(soap->dime.size >> 24); + tmp[9] = (char)((soap->dime.size >> 16) & 0xFF); + tmp[10] = (char)((soap->dime.size >> 8) & 0xFF); + tmp[11] = (char)(soap->dime.size & 0xFF); + if (soap_send_raw(soap, (char*)tmp, 12) + || soap_putdimefield(soap, soap->dime.options, optlen) + || soap_putdimefield(soap, soap->dime.id, idlen) + || soap_putdimefield(soap, soap->dime.type, typelen)) + return soap->error; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putdime(struct soap *soap) +{ + struct soap_multipart *content; + if (!(soap->mode & SOAP_ENC_DIME)) + return SOAP_OK; + for (content = soap->dime.first; content; content = content->next) + { + void *handle; + soap->dime.size = content->size; + soap->dime.id = content->id; + soap->dime.type = content->type; + soap->dime.options = content->options; + soap->dime.flags = SOAP_DIME_VERSION | SOAP_DIME_MEDIA; + if (soap->fdimereadopen && ((handle = soap->fdimereadopen(soap, (void*)content->ptr, content->id, content->type, content->options)) != NULL || soap->error)) + { + size_t size = content->size; + if (!handle) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadopen failed\n")); + return soap->error; + } + if (!size && ((soap->mode & SOAP_ENC_PLAIN) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_IO) == SOAP_IO_STORE)) + { + size_t chunksize = sizeof(soap->tmpbuf); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming DIME\n")); + do + { + size = soap->fdimeread(soap, handle, soap->tmpbuf, chunksize); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread returned %lu bytes\n", (unsigned long)size)); + if (size < chunksize) + { + soap->dime.flags &= ~SOAP_DIME_CF; + if (!content->next) + soap->dime.flags |= SOAP_DIME_ME; + } + else + { + soap->dime.flags |= SOAP_DIME_CF; + } + soap->dime.size = size; + if (soap_putdimehdr(soap) + || soap_putdimefield(soap, soap->tmpbuf, size)) + break; + if (soap->dime.id) + { + soap->dime.flags &= ~(SOAP_DIME_MB | SOAP_DIME_MEDIA); + soap->dime.id = NULL; + soap->dime.type = NULL; + soap->dime.options = NULL; + } + } while (size >= chunksize); + } + else + { + if (!content->next) + soap->dime.flags |= SOAP_DIME_ME; + if (soap_putdimehdr(soap)) + return soap->error; + do + { + size_t bufsize; + if (size < sizeof(soap->tmpbuf)) + bufsize = size; + else + bufsize = sizeof(soap->tmpbuf); + bufsize = soap->fdimeread(soap, handle, soap->tmpbuf, bufsize); + if (!bufsize) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size)); + soap->error = SOAP_CHK_EOF; + break; + } + if (soap_send_raw(soap, soap->tmpbuf, bufsize)) + break; + size -= bufsize; + } while (size); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n")); + if (soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3)) + return soap->error; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n")); + if (soap->fdimereadclose) + soap->fdimereadclose(soap, handle); + } + else + { + if (!content->next) + soap->dime.flags |= SOAP_DIME_ME; + if (soap_putdimehdr(soap) + || soap_putdimefield(soap, (char*)content->ptr, content->size)) + return soap->error; + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static char * +soap_getdimefield(struct soap *soap, size_t n) +{ + char *p = NULL; + if (n > 0) + { + p = (char*)soap_malloc(soap, n + 1 > n ? n + 1 : n); + if (p) + { + char *s = p; + size_t i; + for (i = n; i > 0; i--) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + { + soap->error = SOAP_CHK_EOF; + return NULL; + } + *s++ = (char)c; + } + if (n + 1 > n) + *s = '\0'; /* force NUL terminated */ + soap->error = soap_move(soap, (size_t)(-(long)n&3)); + if (soap->error) + return NULL; + } + else + { + soap->error = SOAP_EOM; + } + } + return p; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getdimehdr(struct soap *soap) +{ + soap_wchar c; + char *s; + int i; + unsigned char tmp[12]; + size_t optlen, idlen, typelen; + if (!(soap->mode & SOAP_ENC_DIME)) + return soap->error = SOAP_DIME_END; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME header\n")); + s = (char*)tmp; + for (i = 12; i > 0; i--) + { + c = soap_getchar(soap); + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + *s++ = (char)c; + } + if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION) + return soap->error = SOAP_DIME_MISMATCH; + soap->dime.flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0); + optlen = (tmp[2] << 8) | tmp[3]; + idlen = (tmp[4] << 8) | tmp[5]; + typelen = (tmp[6] << 8) | tmp[7]; + soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu flags=0x%X\n", (unsigned long)soap->dime.size, soap->dime.flags)); + soap->dime.options = soap_getdimefield(soap, optlen); + if (!soap->dime.options && soap->error) + return soap->error; + soap->dime.id = soap_getdimefield(soap, idlen); + if (!soap->dime.id && soap->error) + return soap->error; + soap->dime.type = soap_getdimefield(soap, typelen); + if (!soap->dime.type && soap->error) + return soap->error; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME flags=%x id='%s', type='%s', options='%s'\n", soap->dime.flags, soap->dime.id ? soap->dime.id : SOAP_STR_EOS, soap->dime.type ? soap->dime.type : "", soap->dime.options ? soap->dime.options+4 : SOAP_STR_EOS)); + if ((soap->dime.flags & SOAP_DIME_ME)) + soap->mode &= ~SOAP_ENC_DIME; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getdime(struct soap *soap) +{ + if (soap->dime.buflen || soap->dime.chunksize) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip remainder of SOAP in DIME (%u bytes or %u bytes in chunk left)\n", (unsigned int)soap->dime.buflen, (unsigned int)soap->dime.chunksize)); + do + if (soap_get1(soap) == (int)EOF) + return soap->error = SOAP_CHK_EOF; + while (soap->dime.buflen || soap->dime.chunksize); + if (soap_move(soap, (size_t)(-(long)soap->dime.size&3))) + return soap->error = SOAP_CHK_EOF; + if (!(soap->mode & SOAP_ENC_DIME)) + return SOAP_OK; + } + else + { + if (soap_move(soap, (size_t)(((soap->dime.size+3)&(~3)) - soap_tell(soap)))) + return soap->error = SOAP_CHK_EOF; + } + for (;;) + { + struct soap_multipart *content; + if (soap_getdimehdr(soap)) + break; + if (soap->fdimewriteopen && ((soap->dime.ptr = (char*)soap->fdimewriteopen(soap, soap->dime.id, soap->dime.type, soap->dime.options)) != NULL || soap->error)) + { + const char *id, *type, *options; + size_t size, n; + if (!soap->dime.ptr) + return soap->error; + id = soap->dime.id; + type = soap->dime.type; + options = soap->dime.options; + for (;;) + { + size = soap->dime.size; + for (;;) + { + n = soap->buflen - soap->bufidx; + if (size < n) + n = size; + soap->error = soap->fdimewrite(soap, (void*)soap->dime.ptr, soap->buf + soap->bufidx, n); + if (soap->error) + break; + size -= n; + if (!size) + { + soap->bufidx += n; + break; + } + if (soap_recv(soap)) + { + soap->error = SOAP_EOF; + goto end; + } + } + if (soap_move(soap, (size_t)(-(long)soap->dime.size&3))) + { + soap->error = SOAP_EOF; + break; + } + if (!(soap->dime.flags & SOAP_DIME_CF)) + break; + if (soap_getdimehdr(soap)) + break; + } +end: + if (soap->fdimewriteclose) + soap->fdimewriteclose(soap, (void*)soap->dime.ptr); + soap->dime.size = 0; + soap->dime.id = id; + soap->dime.type = type; + soap->dime.options = options; + } + else if ((soap->dime.flags & SOAP_DIME_CF)) + { + const char *id, *type, *options; + id = soap->dime.id; + type = soap->dime.type; + options = soap->dime.options; + if (soap_alloc_block(soap) == NULL) + return soap->error = SOAP_EOM; + for (;;) + { + soap_wchar c; + size_t i; + char *s; + if (soap->dime.size > SOAP_MAXDIMESIZE) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu exceeds SOAP_MAXDIMESIZE=%lu\n", (unsigned long)soap->dime.size, (unsigned long)SOAP_MAXDIMESIZE)); + return soap->error = SOAP_DIME_ERROR; + } + s = (char*)soap_push_block(soap, NULL, soap->dime.size); + if (!s) + return soap->error = SOAP_EOM; + for (i = soap->dime.size; i > 0; i--) + { + c = soap_get1(soap); + if ((int)c == EOF) + return soap->error = SOAP_EOF; + *s++ = (char)c; + } + if (soap_move(soap, (size_t)(-(long)soap->dime.size&3))) + return soap->error = SOAP_EOF; + if (!(soap->dime.flags & SOAP_DIME_CF)) + break; + if (soap_getdimehdr(soap)) + return soap->error; + } + soap->dime.size = soap->blist->size; + if (soap->dime.size + 1 > soap->dime.size) + soap->blist->size++; /* allocate one more byte in blist for the terminating '\0' */ + soap->dime.ptr = soap_save_block(soap, NULL, NULL, 0); + if (!soap->dime.ptr) + return soap->error; + if (soap->dime.size + 1 > soap->dime.size) + soap->dime.ptr[soap->dime.size] = '\0'; /* make 0-terminated, just in case even though this is binary data */ + soap->dime.id = id; + soap->dime.type = type; + soap->dime.options = options; + } + else + { + soap->dime.ptr = soap_getdimefield(soap, soap->dime.size); + } + content = soap_alloc_multipart(soap, &soap->dime.first, &soap->dime.last, soap->dime.ptr, soap->dime.size); + if (!content) + return soap->error = SOAP_EOM; + content->id = soap->dime.id; + content->type = soap->dime.type; + content->options = soap->dime.options; + if (soap->error) + return soap->error; + soap_resolve_attachment(soap, content); + } + if (soap->error != SOAP_DIME_END) + return soap->error; + return soap->error = SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getmimehdr(struct soap *soap) +{ + struct soap_multipart *content; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get MIME header\n")); + do + { + if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf))) + return soap->error; + } while (!*soap->msgbuf); + if (soap->msgbuf[0] == '-' && soap->msgbuf[1] == '-') + { + char *s = soap->msgbuf + strlen(soap->msgbuf) - 1; + /* remove white space */ + while (soap_coblank((soap_wchar)*s)) + s--; + s[1] = '\0'; + if (soap->mime.boundary) + { + if (strcmp(soap->msgbuf + 2, soap->mime.boundary)) + return soap->error = SOAP_MIME_ERROR; + } + else + { + soap->mime.boundary = soap_strdup(soap, soap->msgbuf + 2); + if (!soap->mime.boundary) + return soap->error = SOAP_EOM; + } + if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf))) + return soap->error; + } + if (soap_set_mime_attachment(soap, NULL, 0, SOAP_MIME_NONE, NULL, NULL, NULL, NULL)) + return soap->error = SOAP_EOM; + content = soap->mime.last; + for (;;) + { + char *key = soap->msgbuf; + char *val; + if (!*key) + break; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME header: %s\n", key)); + val = strchr(soap->msgbuf, ':'); + if (val) + { + *val = '\0'; + do + { + val++; + } while (*val && *val <= 32); + if (!soap_tag_cmp(key, "Content-ID")) + content->id = soap_strdup(soap, val); + else if (!soap_tag_cmp(key, "Content-Location")) + content->location = soap_strdup(soap, val); + else if (!content->id && !soap_tag_cmp(key, "Content-Disposition")) + content->id = soap_strdup(soap, soap_http_header_attribute(soap, val, "name")); + else if (!soap_tag_cmp(key, "Content-Type")) + content->type = soap_strdup(soap, val); + else if (!soap_tag_cmp(key, "Content-Description")) + content->description = soap_strdup(soap, val); + else if (!soap_tag_cmp(key, "Content-Transfer-Encoding")) + content->encoding = (enum soap_mime_encoding)soap_code_int(mime_codes, val, (LONG64)SOAP_MIME_NONE); + } + if (soap_getline(soap, key, sizeof(soap->msgbuf))) + return soap->error; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_getmime(struct soap *soap) +{ + while (soap_recv_mime_attachment(soap, NULL)) + continue; + return soap->error; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_post_check_mime_attachments(struct soap *soap) +{ + soap->imode |= SOAP_MIME_POSTCHECK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_check_mime_attachments(struct soap *soap) +{ + if ((soap->mode & SOAP_MIME_POSTCHECK)) + return soap_recv_mime_attachment(soap, NULL) != NULL; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +struct soap_multipart * +SOAP_FMAC2 +soap_recv_mime_attachment(struct soap *soap, void *handle) +{ + soap_wchar c = 0; + size_t i, m = 0; + char *s, *t = NULL; + struct soap_multipart *content; + short flag = 0; + if (!(soap->mode & SOAP_ENC_MIME)) + return NULL; + content = soap->mime.last; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get MIME (%p)\n", (void*)content)); + if (!content) + { + if (soap_getmimehdr(soap)) + return NULL; + content = soap->mime.last; + } + else if (content != soap->mime.first) + { + if (soap->fmimewriteopen && ((content->ptr = (char*)soap->fmimewriteopen(soap, (void*)handle, content->id, content->type, content->description, content->encoding)) != NULL || soap->error)) + { + if (!content->ptr) + return NULL; + } + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing MIME content id='%s' type='%s'\n", content->id ? content->id : SOAP_STR_EOS, content->type ? content->type : SOAP_STR_EOS)); + if (!content->ptr && soap_alloc_block(soap) == NULL) + { + soap->error = SOAP_EOM; + return NULL; + } + for (;;) + { + if (content->ptr) + { + s = soap->tmpbuf; + } + else + { + s = (char*)soap_push_block(soap, NULL, sizeof(soap->tmpbuf)); + if (!s) + { + soap->error = SOAP_EOM; + return NULL; + } + } + for (i = 0; i < sizeof(soap->tmpbuf); i++) + { + if (m > 0) + { + *s++ = *t++; + m--; + } + else + { + if (!flag) + { + c = soap_getchar(soap); + if ((int)c == EOF) + { + if (content->ptr && soap->fmimewriteclose) + soap->fmimewriteclose(soap, (void*)content->ptr); + soap->error = SOAP_CHK_EOF; + return NULL; + } + } + if (flag || c == '\r') + { + memset((void*)soap->msgbuf, 0, sizeof(soap->msgbuf)); + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "\n--"); + if (soap->mime.boundary) + { + if (soap_strncat(soap->msgbuf, sizeof(soap->msgbuf), soap->mime.boundary, sizeof(soap->msgbuf) - 4)) + { + soap->error = SOAP_MIME_ERROR; + return NULL; + } + } + t = soap->msgbuf; + do + { + c = soap_getchar(soap); + } while (c == *t++); + if ((int)c == EOF) + { + if (content->ptr && soap->fmimewriteclose) + soap->fmimewriteclose(soap, (void*)content->ptr); + soap->error = SOAP_CHK_EOF; + return NULL; + } + if (!*--t) + goto end; + *t = (char)c; + flag = (c == '\r'); + m = t - soap->msgbuf + 1 - flag; + t = soap->msgbuf; + c = '\r'; + } + *s++ = (char)c; + } + } + if (content->ptr && soap->fmimewrite) + { + soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i); + if (soap->error) + break; + } + } +end: + if (content->ptr) + { + if (!soap->error && soap->fmimewrite) + soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i); + if (soap->fmimewriteclose) + soap->fmimewriteclose(soap, (void*)content->ptr); + if (soap->error) + return NULL; + } + else + { + *s = '\0'; /* make 0-terminated, just in case even though this is binary data */ + content->size = soap_size_block(soap, NULL, i + 1) - 1; /* last block with '\0' */ + content->ptr = soap_save_block(soap, NULL, NULL, 0); + } + soap_resolve_attachment(soap, content); + if (c == '-' && soap_getchar(soap) == '-') + { + soap->mode &= ~SOAP_ENC_MIME; + if ((soap->mode & SOAP_MIME_POSTCHECK) && soap_end_recv(soap)) + { + if (soap->keep_alive == -2) /* special case to keep alive */ + soap->keep_alive = 0; + soap_closesock(soap); + return NULL; + } + } + else + { + while (c != '\r' && (int)c != EOF && soap_coblank(c)) + c = soap_getchar(soap); + if (c != '\r' || soap_getchar(soap) != '\n') + { + soap->error = SOAP_MIME_ERROR; + return NULL; + } + if (soap_getmimehdr(soap)) + return NULL; + } + return content; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_match_cid(struct soap *soap, const char *s, const char *t) +{ + size_t n; + if (!s) + return 1; + if (!strcmp(s, t)) + return 0; + if (!strncmp(s, "cid:", 4)) + s += 4; + n = strlen(t); + if (*t == '<') + { + t++; + n -= 2; + } + if (!strncmp(s, t, n) && !s[n]) + return 0; + (void)soap_decode(soap->tmpbuf, sizeof(soap->tmpbuf), s, SOAP_STR_EOS); + if (!strncmp(soap->tmpbuf, t, n) && !soap->tmpbuf[n]) + return 0; + return 1; +} +#endif + +/******************************************************************************/ + +/* return UUID "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" in a temporary buffer */ +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_rand_uuid(struct soap *soap, const char *prefix) +{ + int r1, r2, r3, r4; +#ifdef WITH_OPENSSL + r1 = soap_random; + r2 = soap_random; +#else + size_t i; + static int k = 0xFACEB00C; + int lo = k % 127773; + int hi = k / 127773; +# if defined(HAVE_GETTIMEOFDAY) + struct timeval tv; + gettimeofday(&tv, NULL); + r1 = 10000000 * tv.tv_sec + tv.tv_usec; +# elif defined(UNDER_CE) + r1 = (int)Random(); +# elif !defined(WITH_LEAN) + r1 = (int)time(NULL); +# else + r1 = k; +# endif + k = 16807 * lo - 2836 * hi; + if (k <= 0) + k += 0x7FFFFFFF; + r2 = k; + /* k &= 0x8FFFFFFF; */ + for (i = 0; i < (sizeof(soap->buf) < 16UL ? sizeof(soap->buf) : 16UL); i++) + r2 += soap->buf[i]; +#endif + r3 = soap_random; + r4 = soap_random; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), prefix ? strlen(prefix) + 37 : 37), "%s%8.8x-%4.4hx-4%3.3hx-%4.4hx-%4.4hx%8.8x", prefix ? prefix : SOAP_STR_EOS, r1, (short)(r2 >> 16), (short)(((short)r2 >> 4) & 0x0FFF), (short)(((short)(r3 >> 16) & 0x3FFF) | 0x8000), (short)r3, r4); + return soap->tmpbuf; +} + +/******************************************************************************/ + +#ifndef WITH_LEANER +static void +soap_resolve_attachment(struct soap *soap, struct soap_multipart *content) +{ + if (content->id) + { + struct soap_xlist **xp = &soap->xlist; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving attachment data for id='%s'\n", content->id)); + while (*xp) + { + struct soap_xlist *xq = *xp; + if (!soap_match_cid(soap, xq->id, content->id)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Found matching attachment id='%s' for content id='%s'\n", xq->id, content->id)); + *xp = xq->next; + *xq->ptr = (unsigned char*)content->ptr; + *xq->size = (int)content->size; + *xq->type = (char*)content->type; + if (content->options) + *xq->options = (char*)content->options; + else + *xq->options = (char*)content->description; + SOAP_FREE(soap, xq); + } + else + { + xp = &(*xp)->next; + } + } + } +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putmimehdr(struct soap *soap, struct soap_multipart *content) +{ + const char *s; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME attachment type='%s'\n", content->type ? content->type : SOAP_STR_EOS)); + if (soap_send3(soap, "\r\n--", soap->mime.boundary, "\r\n")) + return soap->error; + if (content->type && soap_send3(soap, "Content-Type: ", content->type, "\r\n")) + return soap->error; + s = soap_code_str(mime_codes, content->encoding); + if (s && soap_send3(soap, "Content-Transfer-Encoding: ", s, "\r\n")) + return soap->error; + if (content->id && soap_send3(soap, "Content-ID: ", content->id, "\r\n")) + return soap->error; + if (content->location && soap_send3(soap, "Content-Location: ", content->location, "\r\n")) + return soap->error; + if (content->description && soap_send3(soap, "Content-Description: ", content->description, "\r\n")) + return soap->error; + return soap_send_raw(soap, "\r\n", 2); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_putmime(struct soap *soap) +{ + struct soap_multipart *content; + if (!(soap->mode & SOAP_ENC_MIME) || !soap->mime.boundary) + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending MIME attachments\n")); + for (content = soap->mime.first; content; content = content->next) + { + void *handle; + if (soap->fmimereadopen && ((handle = soap->fmimereadopen(soap, (void*)content->ptr, content->id, content->type, content->description)) != NULL || soap->error)) + { + size_t size = content->size; + if (!handle) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimereadopen failed\n")); + return soap->error; + } + if (soap_putmimehdr(soap, content)) + return soap->error; + if (!size) + { + if ((soap->mode & SOAP_ENC_PLAIN) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_IO) == SOAP_IO_STORE) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming MIME\n")); + do + { + size = soap->fmimeread(soap, handle, soap->tmpbuf, sizeof(soap->tmpbuf)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread returned %lu bytes\n", (unsigned long)size)); + if (soap_send_raw(soap, soap->tmpbuf, size)) + break; + } while (size); + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: cannot chunk streaming MIME (no HTTP chunking)\n")); + } + } + else + { + do + { + size_t bufsize; + if (size < sizeof(soap->tmpbuf)) + bufsize = size; + else + bufsize = sizeof(soap->tmpbuf); + bufsize = soap->fmimeread(soap, handle, soap->tmpbuf, bufsize); + if (!bufsize) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size)); + soap->error = SOAP_EOF; + break; + } + if (soap_send_raw(soap, soap->tmpbuf, bufsize)) + break; + size -= bufsize; + } while (size); + } + if (soap->fmimereadclose) + soap->fmimereadclose(soap, handle); + } + else + { + if (soap_putmimehdr(soap, content) + || soap_send_raw(soap, content->ptr, content->size)) + return soap->error; + } + } + return soap_send3(soap, "\r\n--", soap->mime.boundary, "--"); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_dime(struct soap *soap) +{ + soap->omode |= SOAP_ENC_DIME; + soap->dime.first = NULL; + soap->dime.last = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_mime(struct soap *soap, const char *boundary, const char *start) +{ + soap->omode |= SOAP_ENC_MIME; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = soap_strdup(soap, boundary); + soap->mime.start = soap_strdup(soap, start); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_dime(struct soap *soap) +{ + soap->omode &= ~SOAP_ENC_DIME; + soap->dime.first = NULL; + soap->dime.last = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_clr_mime(struct soap *soap) +{ + soap->omode &= ~SOAP_ENC_MIME; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + soap->mime.start = NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_begin_attachments(struct soap *soap) +{ + if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && soap->mime.start) + { + const char *s; + if (strlen(soap->mime.boundary) + strlen(soap->mime.start) + 140 > sizeof(soap->tmpbuf)) + return soap->error = SOAP_EOM; + if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + { + s = "application/dime"; + } + else if (soap->version == 2) + { + if ((soap->mode & SOAP_ENC_MTOM)) + s = "application/xop+xml; charset=utf-8; type=\"application/soap+xml\""; + else + s = "application/soap+xml; charset=utf-8"; + } + else if ((soap->mode & SOAP_ENC_MTOM)) + { + s = "application/xop+xml; charset=utf-8; type=\"text/xml\""; + } + else + { + s = "text/xml; charset=utf-8"; + } + (SOAP_SNPRINTF_SAFE(soap->tmpbuf, sizeof(soap->tmpbuf)), "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start); + if (soap_send(soap, soap->tmpbuf)) + return soap->error; + } + if ((soap->mode & SOAP_IO_LENGTH)) + soap->dime.size = (size_t)soap->count; /* DIME in MIME correction, soap->count is small */ + if (!(soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME)) + { + if (soap_putdimehdr(soap)) + return soap->error; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_end_attachments(struct soap *soap) +{ + if ((soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + { + if (soap->count > 0xFFFFFFFF) + return soap->error = SOAP_DIME_ERROR; + soap->dime.size = (size_t)soap->count - soap->dime.size; /* DIME in MIME correction */ + (SOAP_SNPRINTF(soap->id, sizeof(soap->id), strlen(soap->dime_id_format) + 20), soap->dime_id_format, 0); + soap->dime.id = soap->id; + if (soap->local_namespaces && soap->local_namespaces[0].id) + { + if (soap->local_namespaces[0].out) + soap->dime.type = (char*)soap->local_namespaces[0].out; + else + soap->dime.type = (char*)soap->local_namespaces[0].ns; + } + soap->dime.options = NULL; + soap->dime.flags = SOAP_DIME_MB | SOAP_DIME_ABSURI; + if (!soap->dime.first) + soap->dime.flags |= SOAP_DIME_ME; + soap->count += 12 + ((strlen(soap->dime.id)+3)&(~3)) + (soap->dime.type ? ((strlen(soap->dime.type)+3)&(~3)) : 0); + } + if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM)) + return soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static struct soap_multipart* +soap_alloc_multipart(struct soap *soap, struct soap_multipart **first, struct soap_multipart **last, const char *ptr, size_t size) +{ + struct soap_multipart *content; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New DIME/MIME attachment %p (%lu)\n", (void*)ptr, (unsigned long)size)); + content = (struct soap_multipart*)soap_malloc(soap, sizeof(struct soap_multipart)); + if (content) + { + content->next = NULL; + content->ptr = ptr; + content->size = size; + content->id = NULL; + content->type = NULL; + content->options = NULL; + content->encoding = SOAP_MIME_NONE; + content->location = NULL; + content->description = NULL; + if (!*first) + *first = content; + if (*last) + (*last)->next = content; + *last = content; + } + return content; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_dime_attachment(struct soap *soap, const char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option) +{ + struct soap_multipart *content = soap_alloc_multipart(soap, &soap->dime.first, &soap->dime.last, ptr, size); + if (!content) + return SOAP_EOM; + content->id = soap_strdup(soap, id); + content->type = soap_strdup(soap, type); + content->options = soap_dime_option(soap, optype, option); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_mime_attachment(struct soap *soap, const char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description) +{ + struct soap_multipart *content = soap_alloc_multipart(soap, &soap->mime.first, &soap->mime.last, ptr, size); + if (!content) + return SOAP_EOM; + content->id = soap_strdup(soap, id); + content->type = soap_strdup(soap, type); + content->encoding = encoding; + content->location = soap_strdup(soap, location); + content->description = soap_strdup(soap, description); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +SOAP_FMAC1 +struct soap_multipart* +SOAP_FMAC2 +soap_next_multipart(struct soap_multipart *content) +{ + if (content) + return content->next; + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static void +soap_select_mime_boundary(struct soap *soap) +{ + while (!soap->mime.boundary || soap_valid_mime_boundary(soap)) + { + char *s = soap->mime.boundary; + size_t n = 0; + if (s) + n = strlen(s); + if (n < 16) + { + n = 64; + s = soap->mime.boundary = (char*)soap_malloc(soap, n + 1); + if (!s) + return; + } + *s++ = '='; + *s++ = '='; + n -= 4; + while (n) + { + *s++ = soap_base64o[soap_random & 0x3F]; + n--; + } + *s++ = '='; + *s++ = '='; + *s = '\0'; + } + if (!soap->mime.start) + soap->mime.start = ""; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER +static int +soap_valid_mime_boundary(struct soap *soap) +{ + struct soap_multipart *content; + size_t k; + if (soap->fmimeread) + return SOAP_OK; + k = strlen(soap->mime.boundary); + for (content = soap->mime.first; content; content = content->next) + { + if (content->ptr && content->size >= k) + { + const char *p = (const char*)content->ptr; + size_t i; + for (i = 0; i < content->size - k; i++, p++) + { + if (!strncmp(p, soap->mime.boundary, k)) + return SOAP_ERR; + } + } + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +#ifdef WITH_GZIP +static int +soap_getgziphdr(struct soap *soap) +{ + int i; + soap_wchar c = 0, f = 0; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get gzip header\n")); + for (i = 0; i < 9; i++) + { + c = soap_get1(soap); + if (i == 1 && c == 8) + soap->z_dict = 0; + if (i == 2) + f = c; + } + if (f & 0x04) /* FEXTRA */ + { + i = soap_get1(soap); + i |= soap_get1(soap) << 8; + while (i-- > 0) + { + if ((int)soap_get1(soap) == EOF) + return soap->error = SOAP_ZLIB_ERROR; + } + } + if (f & 0x08) /* skip FNAME */ + { + do + { + c = soap_get1(soap); + } while (c && (int)c != EOF); + } + if ((int)c != EOF && (f & 0x10)) /* skip FCOMMENT */ + { + do + { + c = soap_get1(soap); + } while (c && (int)c != EOF); + } + if ((int)c != EOF && (f & 0x02)) /* skip FHCRC (CRC32 is used) */ + { + c = soap_get1(soap); + if ((int)c != EOF) + c = soap_get1(soap); + } + if ((int)c == EOF) + return soap->error = SOAP_ZLIB_ERROR; + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_serve(struct soap *soap) +{ +#ifdef WITH_FASTCGI + if (FCGI_Accept() < 0) + { + soap->error = SOAP_EOF; + return soap_send_fault(soap); + } +#endif + soap_begin(soap); + if (soap_begin_recv(soap) + || soap_envelope_begin_in(soap) + || soap_recv_header(soap) + || soap_body_begin_in(soap)) + { + if (soap->error < SOAP_STOP) + { +#ifdef WITH_FASTCGI + (void)soap_send_fault(soap); +#else + return soap_send_fault(soap); +#endif + } + return soap_closesock(soap); + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_begin_recv(struct soap *soap) +{ + soap_wchar c; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for input from socket=%d/fd=%d\n", (int)soap->socket, soap->recvfd)); + soap->error = SOAP_OK; +#ifndef WITH_LEANER + soap->recverror = SOAP_OK; +#endif + soap_free_temp(soap); + soap_set_local_namespaces(soap); + soap->version = 0; /* don't assume we're parsing SOAP content by default */ +#ifndef WITH_NOIDREF + soap_free_iht(soap); +#endif + if ((soap->imode & SOAP_IO) == SOAP_IO_CHUNK) + { + soap->imode &= ~SOAP_IO; + soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_CHUNK; + } + soap->imode &= ~(SOAP_ENC_DIME | SOAP_ENC_MIME | SOAP_ENC_MTOM | SOAP_ENC_ZLIB); + soap->mode = soap->imode; + if (!(soap->mode & SOAP_IO_KEEPALIVE)) + soap->keep_alive = 0; + if (!soap->keep_alive) + soap->buflen = soap->bufidx = 0; + soap->null = 0; + soap->position = 0; + soap->mustUnderstand = 0; + soap->shaky = 0; + soap->ahead = 0; + soap->peeked = 0; + soap->level = 0; + soap->part = SOAP_BEGIN_RECV; + soap->count = 0; + soap->length = 0; + soap->cdata = 0; + *soap->endpoint = '\0'; + soap->action = NULL; + soap->header = NULL; + soap->fault = NULL; + soap->status = 0; + soap->fform = NULL; + soap->body = 1; +#ifndef WITH_LEANER + soap->dom = NULL; + soap->dime.count = 0; + soap->dime.chunksize = 0; + soap->dime.buflen = 0; + soap->dime.list = NULL; + soap->dime.first = NULL; + soap->dime.last = NULL; + soap->mime.list = NULL; + soap->mime.first = NULL; + soap->mime.last = NULL; + soap->mime.boundary = NULL; + soap->mime.start = NULL; +#endif +#ifdef WIN32 +#ifndef UNDER_CE +#ifndef WITH_FASTCGI + if (!soap_valid_socket(soap->socket) && !soap->is && soap->recvfd >= 0) /* Set win32 stdin or soap->recvfd to BINARY, e.g. to support DIME */ +#ifdef __BORLANDC__ + setmode(soap->recvfd, _O_BINARY); +#else + _setmode(soap->recvfd, _O_BINARY); +#endif +#endif +#endif +#endif +#ifdef WITH_ZLIB + soap->zlib_in = SOAP_ZLIB_NONE; + soap->zlib_out = SOAP_ZLIB_NONE; + if (!soap->d_stream) + { + soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream)); + if (!soap->d_stream) + return soap->error = SOAP_EOM; + soap->d_stream->zalloc = Z_NULL; + soap->d_stream->zfree = Z_NULL; + soap->d_stream->opaque = Z_NULL; + soap->d_stream->next_in = Z_NULL; + soap->d_stream->msg = Z_NULL; + } + soap->d_stream->avail_in = 0; + soap->d_stream->next_out = (Byte*)soap->buf; + soap->d_stream->avail_out = sizeof(soap->buf); + soap->z_ratio_in = 1.0; +#endif +#ifdef WITH_OPENSSL + if (soap->ssl) + ERR_clear_error(); +#endif +#ifndef WITH_LEAN + soap->start = (ULONG64)time(NULL); +#endif +#ifndef WITH_LEANER + if (soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap)) != SOAP_OK) + return soap->error; +#endif + c = soap_getchar(soap); +#ifdef WITH_GZIP + if (c == 0x1F) + { + if (soap_getgziphdr(soap)) + return soap->error; + if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + if (soap->z_dict) + { + if (inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + soap->zlib_state = SOAP_ZLIB_INFLATE; + soap->mode |= SOAP_ENC_ZLIB; + soap->zlib_in = SOAP_ZLIB_GZIP; + soap->z_crc = crc32(0L, NULL, 0); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n")); + if (!soap->z_buf) + soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf)); + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf)); + /* should not chunk over plain transport, so why bother to check? */ + /* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */ + /* soap->z_buflen = soap->bufidx; */ + /* else */ + soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx); + soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx); + soap->z_buflen = soap->buflen; + soap->buflen = soap->bufidx; + c = ' '; + } +#endif + while (soap_coblank(c)) + c = soap_getchar(soap); +#ifndef WITH_LEANER + if (c == '-' && soap_get0(soap) == '-') + { + soap->mode |= SOAP_ENC_MIME; + } + else if ((c & 0xFFFC) == (SOAP_DIME_VERSION | SOAP_DIME_MB) && (soap_get0(soap) & 0xFFF0) == 0x20) + { + soap->mode |= SOAP_ENC_DIME; + } + else +#endif + { + /* skip BOM */ + if (c == 0xEF && soap_get0(soap) == 0xBB) + { + soap_get1(soap); + c = soap_get1(soap); + if (c == 0xBF) + { + soap->mode &= ~SOAP_ENC_LATIN; + c = soap_getchar(soap); + } + else + { + c = (0x0F << 12) | (0xBB << 6) | (c & 0x3F); /* UTF-8 */ + } + } + else if ((c == 0xFE && soap_get0(soap) == 0xFF) /* UTF-16 BE */ + || (c == 0xFF && soap_get0(soap) == 0xFE)) /* UTF-16 LE */ + { + return soap->error = SOAP_UTF_ERROR; + } + /* skip space */ + while (soap_coblank(c)) + c = soap_getchar(soap); + } + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + soap_unget(soap, c); +#ifndef WITH_NOHTTP + /* if not XML/MIME/DIME/ZLIB, assume HTTP method or status line */ + if (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && !(soap->mode & (SOAP_ENC_MIME | SOAP_ENC_DIME | SOAP_ENC_ZLIB | SOAP_ENC_PLAIN))) + { + soap_mode m = soap->imode; + soap->error = soap->fparse(soap); + soap->mode = soap->imode; /* if imode is changed, effectuate */ + soap->imode = m; /* restore imode */ + if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) + { + soap->chunkbuflen = soap->buflen; + soap->buflen = soap->bufidx; + soap->chunksize = 0; + } +#ifdef WITH_ZLIB + soap->mode &= ~SOAP_ENC_ZLIB; + if (soap->zlib_in != SOAP_ZLIB_NONE) + { +#ifdef WITH_GZIP + if (soap->zlib_in != SOAP_ZLIB_DEFLATE) + { + c = soap_get1(soap); + if (c == (int)EOF) + return soap->error = SOAP_EOF; + if (c == 0x1F) + { + if (soap_getgziphdr(soap)) + return soap->error; + if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + soap->z_crc = crc32(0L, NULL, 0); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n")); + } + else + { + soap_revget1(soap); + if (inflateInit(soap->d_stream) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + soap->zlib_in = SOAP_ZLIB_DEFLATE; + } + } + else +#endif + if (inflateInit(soap->d_stream) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + if (soap->z_dict) + { + if (inflateSetDictionary(soap->d_stream, (const Bytef*)soap->z_dict, soap->z_dict_len) != Z_OK) + return soap->error = SOAP_ZLIB_ERROR; + } + soap->zlib_state = SOAP_ZLIB_INFLATE; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n")); + soap->mode |= SOAP_ENC_ZLIB; + if (!soap->z_buf) + soap->z_buf = (char*)SOAP_MALLOC(soap, sizeof(soap->buf)); + (void)soap_memcpy((void*)soap->z_buf, sizeof(soap->buf), (const void*)soap->buf, sizeof(soap->buf)); + soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx); + soap->d_stream->avail_in = (unsigned int)(soap->buflen - soap->bufidx); + soap->z_buflen = soap->buflen; + soap->buflen = soap->bufidx; + } +#endif +#ifndef WITH_LEANER + if (soap->fpreparerecv && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK && soap->buflen > soap->bufidx) + { + int r; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking fpreparerecv\n")); + r = soap->fpreparerecv(soap, soap->buf + soap->bufidx, soap->buflen - soap->bufidx); + if (r) + return soap->error = r; + } +#endif + if (soap->error && soap->error < SOAP_STOP) + { + if (soap->status >= 200 && soap->status < 600) + { + const char *s = soap_http_get_body(soap, NULL); + (void)soap_end_recv(soap); + if (soap->status >= 300) + soap->keep_alive = 0; /* to force close */ + return soap_set_receiver_error(soap, "HTTP Error", s, soap->status); + } + return soap->error; + } + if (!soap->body && soap->status >= 200 && soap->status < 600) + return soap->error = soap->status; /* client side received HTTP status code */ + if (soap->status > SOAP_POST) + { + soap->fform = NULL; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking http method handler\n")); + switch (soap->status) + { + case SOAP_GET: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fget(soap); + break; + case SOAP_PUT: + soap->error = soap->fput(soap); + break; + case SOAP_PATCH: + soap->error = soap->fpatch(soap); + break; + case SOAP_DEL: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fdel(soap); + break; + case SOAP_HEAD: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fhead(soap); + break; + case SOAP_OPTIONS: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + soap->error = soap->fopt(soap); + break; + default: + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap->error; + return 405; + } + if (soap->error == SOAP_OK) + return soap->error = SOAP_STOP; /* prevents further processing */ + if (soap->error != SOAP_FORM || !soap->fform) /* continue if handler returned SOAP_FORM */ + return soap->error; + soap->error = SOAP_OK; + } + if (soap->fform) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Invoking http form handler\n")); + soap->error = soap->fform(soap); + if (soap->error == SOAP_OK) + return soap->error = SOAP_STOP; /* prevents further processing */ + if (soap->status != SOAP_POST || soap->error != 404) /* continue with POST if handler returned HTTP not found */ + return soap->error; + soap->error = SOAP_OK; + } + if (!soap->body) + return soap->error = SOAP_NO_DATA; + } +#endif +#ifndef WITH_LEANER + if ((soap->mode & SOAP_ENC_MIME)) + { + do /* skip preamble */ + { + c = soap_getchar(soap); + if ((int)c == EOF) + return soap->error = SOAP_CHK_EOF; + } while (c != '-' || soap_get0(soap) != '-'); + soap_unget(soap, c); + if (soap_getmimehdr(soap)) + return soap->error; + if (soap->mime.start) + { + do + { + if (!soap->mime.last->id) + break; + if (!soap_match_cid(soap, soap->mime.start, soap->mime.last->id)) + break; + } while (soap_recv_mime_attachment(soap, NULL)); + } + if (soap_http_header_attribute(soap, soap->mime.first->type, "application/dime")) + soap->mode |= SOAP_ENC_DIME; + } + if ((soap->mode & SOAP_ENC_DIME)) + { + if (soap_getdimehdr(soap)) + return soap->error; + if ((soap->dime.flags & SOAP_DIME_CF)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked SOAP in DIME message\n")); + soap->dime.chunksize = soap->dime.size; + if (soap->buflen - soap->bufidx >= soap->dime.chunksize) + { + soap->dime.buflen = soap->buflen; + soap->buflen = soap->bufidx + soap->dime.chunksize; + } + else + { + soap->dime.chunksize -= soap->buflen - soap->bufidx; + } + } + soap->count = soap->buflen - soap->bufidx; + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + return soap->error = SOAP_EOF; + } +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_begin_out(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_IN_ENVELOPE; + return soap_element_begin_out(soap, "SOAP-ENV:Envelope", 0, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_end_out(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + if (soap_element_end_out(soap, "SOAP-ENV:Envelope") + || soap_send_raw(soap, "\r\n", 2)) /* 2.8: always emit \r\n */ + return soap->error; + soap->part = SOAP_END_ENVELOPE; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_http_has_body(struct soap *soap) +{ + return soap->length || (soap->mode & SOAP_ENC_ZLIB) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_http_skip_body(struct soap *soap) +{ + ULONG64 k = soap->length; + /* check HTTP body, return "" if none */ + if (!k && !(soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK) + return SOAP_OK; + /* do not consume DIME or MIME attachments, leave this to soap_end_recv */ + if ((soap->mode & SOAP_ENC_DIME) || (soap->mode & SOAP_ENC_MIME)) + return SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skipping HTTP body (mode=0x%x)\n", soap->mode)); + if (k && !(soap->mode & SOAP_ENC_ZLIB)) + { + size_t i; + soap->length = 0; + for (i = 0; i < k; i++) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + break; + } + } + else + { + for (;;) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + break; + } + } + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_http_get_body(struct soap *soap, size_t *len) +{ + return soap_http_get_body_prefix(soap, len, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_http_get_form(struct soap *soap) +{ + return soap_http_get_body_prefix(soap, NULL, "?"); +} + +/******************************************************************************/ + +SOAP_FMAC1 +char * +SOAP_FMAC2 +soap_http_get_body_prefix(struct soap *soap, size_t *len, const char *prefix) +{ + char *s; + ULONG64 k = soap->length; + size_t n = 0; + if (!prefix) + prefix = SOAP_STR_EOS; + else + n = strlen(prefix); + if (len) + *len = 0; + /* check HTTP body, return "" if none */ + if (!k && !(soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) != SOAP_IO_CHUNK) + return soap_strdup(soap, prefix); + /* do not consume DIME or MIME attachments, leave this to soap_end_recv */ + if ((soap->mode & SOAP_ENC_DIME) || (soap->mode & SOAP_ENC_MIME)) + return soap_strdup(soap, prefix); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing HTTP body, prefixed with '%s' (mode=0x%x)\n", prefix, soap->mode)); + if (k && !(soap->mode & SOAP_ENC_ZLIB)) + { + char *t; + soap->length = 0; + /* http content length != 0 and uncompressed body */ + if ((SOAP_MAXALLOCSIZE != 0 && n + k > SOAP_MAXALLOCSIZE) || n + k > (ULONG64)((size_t)-2)) + { + soap->error = SOAP_EOM; + return NULL; + } + s = t = (char*)soap_malloc(soap, (size_t)k + n + 1); + if (s) + { + size_t i; + soap_strcpy(t, n + 1, prefix); + t += n; + for (i = 0; i < k; i++) + { + soap_wchar c = soap_get1(soap); + if ((int)c == EOF) + break; + *t++ = (char)(c & 0xFF); + } + *t = '\0'; + if (len) + *len = n + i; + } + else + { + soap->error = SOAP_EOM; + return NULL; + } + } + else + { + size_t i, l = 0; + if (soap_alloc_block(soap) == NULL) + return NULL; + if (n) + { + s = (char*)soap_push_block(soap, NULL, n); + if (!s) + return NULL; + soap_strcpy(s, n + 1, prefix); + l += n; + } + for (;;) + { + size_t k = SOAP_BLKLEN; + s = (char*)soap_push_block(soap, NULL, k); + if (!s) + return NULL; + for (i = 0; i < k; i++) + { + soap_wchar c; + l++; + if (l == 0) + { + soap->error = SOAP_EOM; + return NULL; + } + c = soap_get1(soap); + if ((int)c == EOF) + goto end; + *s++ = (char)(c & 0xFF); + } + } +end: + *s = '\0'; + if (len) + *len = l - 1; + soap_size_block(soap, NULL, i + 1); + s = soap_save_block(soap, NULL, NULL, 0); + } + return s; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_begin_in(struct soap *soap) +{ + soap->part = SOAP_IN_ENVELOPE; + if (soap_element_begin_in(soap, "SOAP-ENV:Envelope", 0, NULL)) + { + if (soap->error == SOAP_TAG_MISMATCH) + { + if (!soap_element_begin_in(soap, "Envelope", 0, NULL)) + soap->error = SOAP_VERSIONMISMATCH; + else if (soap->status == 0 + || (soap->status >= 200 && soap->status <= 299) + || soap->status == 400 + || soap->status == 500) + return SOAP_OK; /* allow non-SOAP (REST) XML content to be captured */ + soap->error = soap->status; + } + else if (soap->status) + { + soap->error = soap->status; + } + return soap->error; + } + soap_version(soap); + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_envelope_end_in(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_END_ENVELOPE; + return soap_element_end_in(soap, "SOAP-ENV:Envelope"); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_begin_out(struct soap *soap) +{ + if (soap->version == 1) + soap->encoding = 1; +#ifndef WITH_LEAN + if ((soap->mode & SOAP_SEC_WSUID) && soap_set_attr(soap, "wsu:Id", "Body", 1)) + return soap->error; +#endif + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_IN_BODY; + return soap_element_begin_out(soap, "SOAP-ENV:Body", 0, NULL); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_end_out(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + if (soap_element_end_out(soap, "SOAP-ENV:Body")) + return soap->error; + soap->part = SOAP_END_BODY; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_begin_in(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + soap->part = SOAP_IN_BODY; + if (soap_element_begin_in(soap, "SOAP-ENV:Body", 0, NULL)) + return soap->error; + if (!soap->body) + soap->part = SOAP_NO_BODY; + return SOAP_OK; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_body_end_in(struct soap *soap) +{ + if (soap->version == 0) + return SOAP_OK; + if (soap->part == SOAP_NO_BODY) + return soap->error = SOAP_OK; + soap->part = SOAP_END_BODY; + return soap_element_end_in(soap, "SOAP-ENV:Body"); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_header(struct soap *soap) +{ + if (soap_getheader(soap) && soap->error == SOAP_TAG_MISMATCH) + soap->error = SOAP_OK; + if (soap->error == SOAP_OK && soap->fheader) + soap->error = soap->fheader(soap); + return soap->error; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_endpoint(struct soap *soap, const char *endpoint) +{ + const char *s, *t; + size_t i, n; + soap->endpoint[0] = '\0'; + soap->host[0] = '\0'; + soap->path[0] = '/'; + soap->path[1] = '\0'; + soap->port = 80; + if (!endpoint || !*endpoint) + return; +#ifdef WITH_OPENSSL + if (!soap_tag_cmp(endpoint, "https:*")) + soap->port = 443; +#endif + soap_strcpy(soap->endpoint, sizeof(soap->endpoint), endpoint); + s = strchr(endpoint, ':'); + if (s && s[1] == '/' && s[2] == '/') + s += 3; + else + s = endpoint; +#if !defined(WITH_NOHTTP) || !defined(WITH_LEANER) + t = strchr(s, '@'); + if (t && *s != ':' && *s != '@') + { + size_t l = t - s + 1; + char *r = (char*)soap_malloc(soap, l); + n = s - endpoint; + if (r) + { + s = soap_decode(r, l, s, ":@"); + soap->userid = r; + soap->passwd = SOAP_STR_EOS; + if (*s == ':') + { + s++; + if (*s != '@') + { + l = t - s + 1; + r = r + strlen(r) + 1; + s = soap_decode(r, l, s, "@"); + soap->passwd = r; + } + } + } + s++; + soap_strcpy(soap->endpoint + n, sizeof(soap->endpoint) - n, s); + } +#endif + n = strlen(s); + if (n >= sizeof(soap->host)) + n = sizeof(soap->host) - 1; +#ifdef WITH_IPV6 + if (s[0] == '[') + { + s++; + for (i = 0; i < n; i++) + { + if (s[i] == ']') + { + s++; + --n; + break; + } + soap->host[i] = s[i]; + } + } + else + { + for (i = 0; i < n; i++) + { + soap->host[i] = s[i]; + if (s[i] == '/' || s[i] == ':' || s[i] == '?') + break; + } + } +#else + for (i = 0; i < n; i++) + { + soap->host[i] = s[i]; + if (s[i] == '/' || s[i] == ':' || s[i] == '?') + break; + } +#endif + soap->host[i] = '\0'; + if (s[i] == ':') + { + soap->port = (int)soap_strtol(s + i + 1, NULL, 10); + for (i++; i < n; i++) + if (s[i] == '/') + break; + } + if (i < n && s[i]) + soap_strcpy(soap->path, sizeof(soap->path), s + i); + if (soap->override_host && *soap->override_host) + { + soap_strcpy(soap->host, sizeof(soap->host), soap->override_host); + if (soap->override_port) + soap->port = soap->override_port; + } + if (soap->userid && !soap->authrealm) + soap->authrealm = soap->host; +} + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_GET(struct soap *soap, const char *endpoint, const char *action) +{ + return soap_connect_command(soap, SOAP_GET, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_PUT(struct soap *soap, const char *endpoint, const char *action, const char *type) +{ + soap->http_content = type; + if ((soap->omode & SOAP_IO) != SOAP_IO_CHUNK) + { + soap->omode &= ~SOAP_IO; + soap->omode |= SOAP_IO_STORE; + } + return soap_connect_command(soap, SOAP_PUT, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_POST(struct soap *soap, const char *endpoint, const char *action, const char *type) +{ + soap->http_content = type; + if ((soap->omode & SOAP_IO) != SOAP_IO_CHUNK) + { + soap->omode &= ~SOAP_IO; + soap->omode |= SOAP_IO_STORE; + } + return soap_connect_command(soap, SOAP_POST_FILE, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_PATCH(struct soap *soap, const char *endpoint, const char *action, const char *type) +{ + soap->http_content = type; + if ((soap->omode & SOAP_IO) != SOAP_IO_CHUNK) + { + soap->omode &= ~SOAP_IO; + soap->omode |= SOAP_IO_STORE; + } + return soap_connect_command(soap, SOAP_PATCH, endpoint, action); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_DELETE(struct soap *soap, const char *endpoint) +{ + if (soap_connect_command(soap, SOAP_DEL, endpoint, NULL) + || soap_recv_empty_response(soap)) + return soap_closesock(soap); + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_connect(struct soap *soap, const char *endpoint, const char *action) +{ + return soap_connect_command(soap, SOAP_POST, endpoint, action); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_connect_command(struct soap *soap, int http_command, const char *endpoints, const char *action) +{ + if (endpoints) + { + int retry = soap->connect_retry; + unsigned int backoff = 1; + for (;;) + { + struct timeval tv; + const char *s; + s = strchr(endpoints, ' '); + if (s) + { + size_t l = strlen(endpoints); + char *endpoint = NULL; + if (SOAP_MAXALLOCSIZE == 0 || l <= SOAP_MAXALLOCSIZE) + endpoint = (char*)SOAP_MALLOC(soap, l + 1); + if (!endpoint) + return soap->error = SOAP_EOM; + for (;;) + { + (void)soap_strncpy(endpoint, l + 1, endpoints, s - endpoints); + endpoint[s - endpoints] = '\0'; + if (soap_try_connect_command(soap, http_command, endpoint, action) != SOAP_TCP_ERROR) + break; + while (*s == ' ') + s++; + if (!*s) + break; + soap->error = SOAP_OK; + endpoints = s; + s = strchr(endpoints, ' '); + if (!s) + s = endpoints + strlen(endpoints); + } + SOAP_FREE(soap, endpoint); + } + else + { + soap_try_connect_command(soap, http_command, endpoints, action); + } + if (soap->error != SOAP_TCP_ERROR || retry <= 0) + break; + soap->error = SOAP_OK; + tv.tv_sec = backoff; + tv.tv_usec = 0; + select(0, NULL, NULL, NULL, &tv); + if (backoff < 32) + backoff *= 2; + --retry; + } + } + return soap->error; +} + +/******************************************************************************/ + +static int +soap_try_connect_command(struct soap *soap, int http_command, const char *endpoint, const char *action) +{ + char host[sizeof(soap->host)]; + int port; + ULONG64 count; + soap->error = SOAP_OK; + (void)soap_memcpy(host, sizeof(host), soap->host, sizeof(soap->host)); /* save previous host name: if != then reconnect */ + port = soap->port; /* save previous port to compare */ + soap->status = http_command; + soap_set_endpoint(soap, endpoint); + soap->action = soap_strdup(soap, action); +#ifndef WITH_LEANER + if (soap->fconnect) + { + soap->error = soap->fconnect(soap, endpoint, soap->host, soap->port); + if (soap->error) + return soap->error; + } + else +#endif + if (soap->fopen && *soap->host) + { + if (!soap->keep_alive || !soap_valid_socket(soap->socket) || strcmp(soap->host, host) || soap->port != port || !soap->fpoll || soap->fpoll(soap)) + { + soap->error = SOAP_OK; +#ifndef WITH_LEAN + if (!strncmp(endpoint, "soap.udp:", 9) || !strncmp(endpoint, "udp:", 4)) + { + soap->omode |= SOAP_IO_UDP; + } + else +#endif + { + soap->keep_alive = 0; /* to force close */ + soap->omode &= ~SOAP_IO_UDP; /* to force close */ + } + soap_closesock(soap); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect/reconnect to '%s' host='%s' path='%s' port=%d\n", endpoint?endpoint:"(null)", soap->host, soap->path, soap->port)); + if (!soap->keep_alive || !soap_valid_socket(soap->socket)) + { + soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port); + if (!soap_valid_socket(soap->socket) || soap->error) + { + if (soap->error) + return soap->error; + return soap->error = SOAP_TCP_ERROR; + } + soap->keep_alive = -((soap->omode & SOAP_IO_KEEPALIVE) != 0); + } + } + } +#ifdef WITH_NTLM + if (soap_ntlm_handshake(soap, SOAP_GET, endpoint, soap->host, soap->port)) + return soap->error; +#endif + count = soap_count_attachments(soap); + if (soap_init_send(soap)) + return soap->error; +#ifndef WITH_NOHTTP + if (http_command == SOAP_GET || http_command == SOAP_DEL || http_command == SOAP_HEAD || http_command == SOAP_OPTIONS) + { + soap->mode &= ~SOAP_IO; + soap->mode |= SOAP_IO_BUFFER; + } + if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_PLAIN) && endpoint) + { + soap_mode k = soap->mode; + soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB); + if ((k & SOAP_IO) != SOAP_IO_FLUSH) + soap->mode |= SOAP_IO_BUFFER; + soap->error = soap->fpost(soap, endpoint, soap->host, soap->port, soap->path, action, count); + if (soap->error) + return soap->error; + if ((k & SOAP_IO) == SOAP_IO_CHUNK) + { + if (soap_flush(soap)) + return soap->error; + } + soap->mode = k; + } + if (http_command == SOAP_GET || http_command == SOAP_DEL || http_command == SOAP_HEAD || http_command == SOAP_OPTIONS) + return soap_end_send_flush(soap); +#endif +#ifndef WITH_LEANER + if (soap_begin_attachments(soap)) + return soap->error; +#endif + return SOAP_OK; +} + +/******************************************************************************/ + +#ifdef WITH_NTLM +static int +soap_ntlm_handshake(struct soap *soap, int command, const char *endpoint, const char *host, int port) +{ + /* requires libntlm from http://www.nongnu.org/libntlm/ */ + const char *userid = (soap->proxy_userid ? soap->proxy_userid : soap->userid); + const char *passwd = (soap->proxy_passwd ? soap->proxy_passwd : soap->passwd); + struct SOAP_ENV__Header *oldheader; + if (soap->ntlm_challenge && userid && passwd && soap->authrealm) + { + tSmbNtlmAuthRequest req; + tSmbNtlmAuthResponse res; + tSmbNtlmAuthChallenge ch; + int k = soap->keep_alive; + ULONG64 l = soap->length; + ULONG64 c = soap->count; + soap_mode m = soap->mode, o = soap->omode; + int s = soap->status; + char *a = soap->action; + short v = soap->version; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM '%s'\n", soap->ntlm_challenge)); + if (!*soap->ntlm_challenge) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM S->C Type 1: received NTLM authentication challenge from server\n")); + /* S -> C 401 Unauthorized + WWW-Authenticate: NTLM + */ + buildSmbNtlmAuthRequest(&req, userid, soap->authrealm); + soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)(void*)&req, NULL, SmbLength(&req)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM C->S Type 2: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge)); + /* C -> S GET ... + Authorization: NTLM TlRMTVNTUAABAAAAA7IAAAoACgApAAAACQAJACAAAABMSUdIVENJVFlVUlNBLU1JTk9S + */ + soap->omode = SOAP_IO_BUFFER; + if (soap_init_send(soap)) + return soap->error; + if (!soap->keep_alive) + soap->keep_alive = -1; /* client keep alive */ + soap->status = command; + if (soap->fpost(soap, endpoint, host, port, soap->path, soap->action, 0) + || soap_end_send_flush(soap)) + return soap->error; + soap->mode = m; + soap->keep_alive = k; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM S->C Type 2: waiting on server NTLM response\n")); + oldheader = soap->header; + if (soap_begin_recv(soap)) + if (soap->error == SOAP_EOF) + return soap->error; + (void)soap_end_recv(soap); + soap->header = oldheader; + soap->length = l; + if (soap->status != 401 && soap->status != 407) + return soap->error = SOAP_NTLM_ERROR; + soap->error = SOAP_OK; + } + /* S -> C 401 Unauthorized + WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA== + */ + soap_base642s(soap, soap->ntlm_challenge, (char*)&ch, sizeof(tSmbNtlmAuthChallenge), NULL); + buildSmbNtlmAuthResponse(&ch, &res, userid, passwd); + soap->ntlm_challenge = soap_s2base64(soap, (unsigned char*)(void*)&res, NULL, SmbLength(&res)); + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "NTLM C->S Type 3: sending NTLM authorization to server\nAuthorization: NTLM %s\n", soap->ntlm_challenge)); + /* C -> S GET ... + Authorization: NTLM TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT + */ + soap->userid = NULL; + soap->passwd = NULL; + soap->proxy_userid = NULL; + soap->proxy_passwd = NULL; + soap->keep_alive = k; + soap->length = l; + soap->count = c; + soap->mode = m; + soap->omode = o; + soap->status = s; + soap->action = a; + soap->version = v; + } + return SOAP_OK; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_s2base64(struct soap *soap, const unsigned char *s, char *t, int n) +{ + int i; + unsigned long m; + char *p; + if (!t) + t = (char*)soap_malloc(soap, (n + 2) / 3 * 4 + 1); + if (!t) + return NULL; + p = t; + t[0] = '\0'; + if (!s) + return p; + for (; n > 2; n -= 3, s += 3) + { + m = s[0]; + m = (m << 8) | s[1]; + m = (m << 8) | s[2]; + for (i = 4; i > 0; m >>= 6) + t[--i] = soap_base64o[m & 0x3F]; + t += 4; + } + t[0] = '\0'; + if (n > 0) /* 0 < n <= 2 implies that t[0..4] is allocated (base64 scaling formula) */ + { + m = 0; + for (i = 0; i < n; i++) + m = (m << 8) | *s++; + for (; i < 3; i++) + m <<= 8; + for (i = 4; i > 0; m >>= 6) + t[--i] = soap_base64o[m & 0x3F]; + for (i = 3; i > n; i--) + t[i] = '='; + t[4] = '\0'; + } + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n) +{ + size_t i, j; + soap_wchar c; + unsigned long m; + const char *p; + if (!s || !*s) + { + if (n) + *n = 0; + if (soap->error) + return NULL; + return SOAP_NON_NULL; + } + if (!t) + { + l = (strlen(s) + 3) / 4 * 3 + 1; /* space for raw binary and \0 */ + t = (char*)soap_malloc(soap, l); + } + if (!t) + return NULL; + p = t; + if (n) + *n = 0; + for (i = 0; ; i += 3, l -= 3) + { + m = 0; + j = 0; + while (j < 4) + { + c = *s++; + if (c == '=' || !c) + { + if (l >= j - 1) + { + switch (j) + { + case 2: + *t++ = (char)((m >> 4) & 0xFF); + i++; + l--; + break; + case 3: + *t++ = (char)((m >> 10) & 0xFF); + *t++ = (char)((m >> 2) & 0xFF); + i += 2; + l -= 2; + } + } + if (n) + *n = (int)i; + if (l) + *t = '\0'; + return p; + } + c -= '+'; + if (c >= 0 && c <= 79) + { + int b = soap_base64i[c]; + if (b >= 64) + { + soap->error = SOAP_TYPE; + return NULL; + } + m = (m << 6) + b; + j++; + } + else if (!soap_coblank(c + '+')) + { + soap->error = SOAP_TYPE; + return NULL; + } + } + if (l < 3) + { + if (n) + *n = (int)i; + if (l) + *t = '\0'; + return p; + } + *t++ = (char)((m >> 16) & 0xFF); + *t++ = (char)((m >> 8) & 0xFF); + *t++ = (char)(m & 0xFF); + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_s2hex(struct soap *soap, const unsigned char *s, char *t, int n) +{ + char *p; + if (!t) + t = (char*)soap_malloc(soap, 2 * n + 1); + if (!t) + return NULL; + p = t; + t[0] = '\0'; + if (s) + { + for (; n > 0; n--) + { + int m = *s++; + *t++ = (char)((m >> 4) + (m > 159 ? 'a' - 10 : '0')); + m &= 0x0F; + *t++ = (char)(m + (m > 9 ? 'a' - 10 : '0')); + } + } + *t++ = '\0'; + return p; +} + +/******************************************************************************/ + +SOAP_FMAC1 +const char* +SOAP_FMAC2 +soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n) +{ + const char *p; + if (!s || !*s) + { + if (n) + *n = 0; + if (soap->error) + return NULL; + return SOAP_NON_NULL; + } + if (!t) + { + l = strlen(s) / 2 + 1; /* make sure enough space for \0 */ + t = (char*)soap_malloc(soap, l); + } + if (!t) + return NULL; + p = t; + while (l) + { + int d1, d2; + d1 = *s++; + if (!d1) + break; + d2 = *s++; + if (!d2) + break; + *t++ = (char)(((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0')); + l--; + } + if (n) + *n = (int)(t - p); + if (l) + *t = '\0'; + return p; +} + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +const char * +SOAP_FMAC2 +soap_http_content_type(struct soap *soap, int status) +{ + if (soap->status != SOAP_GET && soap->status != SOAP_DEL && soap->status != SOAP_CONNECT) + { + const char *s = "text/xml; charset=utf-8"; +#ifndef WITH_LEANER + const char *r = NULL; + size_t n; +#endif + if (((status >= SOAP_FILE && status < SOAP_FILE + 600) || soap->status == SOAP_PUT || soap->status == SOAP_POST_FILE || soap->status == SOAP_PATCH) && soap->http_content && *soap->http_content && !strchr(soap->http_content, 10) && !strchr(soap->http_content, 13)) + s = soap->http_content; + else if (status == SOAP_HTML) + s = "text/html; charset=utf-8"; + else if (soap->version == 2) + s = "application/soap+xml; charset=utf-8"; + soap->http_content = NULL; /* use http_content once (assign new value before each call) */ +#ifndef WITH_LEANER + if (soap->mode & (SOAP_ENC_DIME | SOAP_ENC_MTOM)) + { + if ((soap->mode & SOAP_ENC_MTOM)) + { + if (soap->version == 2) + r = "application/soap+xml"; + else + r = "text/xml"; + s = "application/xop+xml"; + } + else + { + s = "application/dime"; + } + } + if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary) + { + const char *t; + size_t l; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), strlen(soap->mime.boundary) + 53), "multipart/related; charset=utf-8; boundary=\"%s\"; type=\"", soap->mime.boundary); + t = strchr(s, ';'); + if (t) + n = t - s; + else + n = strlen(s); + l = strlen(soap->tmpbuf); + if (sizeof(soap->tmpbuf) > l + n) + (void)soap_strncpy(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, s, n); + if (soap->mime.start) + { + l = strlen(soap->tmpbuf); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, strlen(soap->mime.start) + 10), "\"; start=\"%s", soap->mime.start); + } + if (r) + { + l = strlen(soap->tmpbuf); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, strlen(r) + 15), "\"; start-info=\"%s", r); + } + l = strlen(soap->tmpbuf); + if (sizeof(soap->tmpbuf) > l) + soap_strcpy(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, "\""); + } + else + { + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s); + } + if (status == SOAP_OK && soap->version == 2 && soap->action) + { + size_t l = strlen(soap->tmpbuf); + n = strlen(soap->action); + (SOAP_SNPRINTF(soap->tmpbuf + l, sizeof(soap->tmpbuf) - l, n + 11), "; action=\"%s\"", soap->action); + } +#else + soap_strcpy(soap->tmpbuf, sizeof(soap->tmpbuf), s); +#endif + return soap->tmpbuf; + } + return NULL; +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_puthttphdr(struct soap *soap, int status, ULONG64 count) +{ + int err = SOAP_OK; + if (soap_http_content_type(soap, status)) + { + err = soap->fposthdr(soap, "Content-Type", soap->tmpbuf); + if (err) + return err; +#ifdef WITH_ZLIB + if ((soap->omode & SOAP_ENC_ZLIB)) + { +#ifdef WITH_GZIP + err = soap->fposthdr(soap, "Content-Encoding", soap->zlib_out == SOAP_ZLIB_DEFLATE ? "deflate" : "gzip"); +#else + err = soap->fposthdr(soap, "Content-Encoding", "deflate"); +#endif + if (err) + return err; + } +#endif +#ifndef WITH_LEANER + if ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK) + { + err = soap->fposthdr(soap, "Transfer-Encoding", "chunked"); + } + else +#endif + { + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), SOAP_ULONG_FORMAT, count); + err = soap->fposthdr(soap, "Content-Length", soap->tmpbuf); + } + if (err) + return err; + } + if (soap->http_extra_header) + { + err = soap_send(soap, soap->http_extra_header); + soap->http_extra_header = NULL; /* use http_extra_header once (assign new value before each call) */ + if (err) + return err; + err = soap_send_raw(soap, "\r\n", 2); + if (err) + return err; + } + if (soap->keep_alive) + { + if (soap->keep_alive > 0 && soap->recv_timeout) + { + int t = soap->recv_timeout; + if (t < 0) + t = 1; + (SOAP_SNPRINTF(soap->tmpbuf, sizeof(soap->tmpbuf), 20), "timeout=%d, max=%d", soap->recv_timeout, soap->keep_alive); + err = soap->fposthdr(soap, "Keep-Alive", soap->tmpbuf); + if (err) + return err; + } + return soap->fposthdr(soap, "Connection", "keep-alive"); + } + return soap->fposthdr(soap, "Connection", "close"); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +static const char* +soap_set_validation_fault(struct soap *soap, const char *s, const char *t) +{ + if (!t) + t = SOAP_STR_EOS; + if (*soap->tag) + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + strlen(soap->tag) + 47), "Validation constraint violation: %s%s in element '%s'", s, t, soap->tag); + else + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(s) + strlen(t) + 33), "Validation constraint violation: %s%s", s, t); + return soap->msgbuf; +} +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_set_fault(struct soap *soap) +{ + const char **c; + const char **s; + if (soap->version == 0) + soap_version(soap); + c = soap_faultcode(soap); + s = soap_faultstring(soap); + if (soap->fseterror) + soap->fseterror(soap, c, s); + if (!*c) + { + if (soap->version == 2) + *c = "SOAP-ENV:Sender"; + else if (soap->version == 1) + *c = "SOAP-ENV:Client"; + else + *c = ""; + } + if (*s) + return; + if (soap->error >= SOAP_POST) + soap->error = SOAP_HTTP_METHOD; + switch (soap->error) + { +#ifndef WITH_LEAN + case SOAP_CLI_FAULT: + *s = "Client fault"; + break; + case SOAP_SVR_FAULT: + *s = "Server fault"; + break; + case SOAP_TAG_MISMATCH: + *s = soap_set_validation_fault(soap, "tag name or namespace mismatch", NULL); + break; + case SOAP_TYPE: + if (*soap->type) + *s = soap_set_validation_fault(soap, "type mismatch ", soap->type); + else if (*soap->arrayType) + *s = soap_set_validation_fault(soap, "array type mismatch", NULL); + else + *s = soap_set_validation_fault(soap, "invalid value", NULL); + break; + case SOAP_SYNTAX_ERROR: + *s = soap_set_validation_fault(soap, "syntax error", NULL); + break; + case SOAP_NO_TAG: + if (soap->version == 0 && soap->level == 0) + *s = soap_set_validation_fault(soap, "root element expected", NULL); + else if (soap->level == 0) + *s = soap_set_validation_fault(soap, "SOAP message expected", NULL); + else + *s = soap_set_validation_fault(soap, "element tag expected", NULL); + break; + case SOAP_END_TAG: + *s = soap_set_validation_fault(soap, "closing tag expected", NULL); + break; + case SOAP_MUSTUNDERSTAND: + *c = "SOAP-ENV:MustUnderstand"; + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(soap->tag) + 65), "The data in element '%s' must be understood but cannot be processed", soap->tag); + *s = soap->msgbuf; + break; + case SOAP_VERSIONMISMATCH: + *c = "SOAP-ENV:VersionMismatch"; + *s = "Invalid SOAP message or SOAP version mismatch"; + break; + case SOAP_DATAENCODINGUNKNOWN: + *c = "SOAP-ENV:DataEncodingUnknown"; + *s = "Unsupported SOAP data encoding"; + break; + case SOAP_NAMESPACE: + *s = soap_set_validation_fault(soap, "namespace error", NULL); + break; + case SOAP_USER_ERROR: + *s = "User data access error"; + break; + case SOAP_NO_METHOD: + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(soap->tag) + 66), "Method '%s' not implemented: method name or namespace not recognized", soap->tag); + *s = soap->msgbuf; + break; + case SOAP_NO_DATA: + *s = "Data required for operation"; + break; + case SOAP_GET_METHOD: + *s = "HTTP GET method not implemented"; + break; + case SOAP_PUT_METHOD: + *s = "HTTP PUT method not implemented"; + break; + case SOAP_PATCH_METHOD: + *s = "HTTP PATCH method not implemented"; + break; + case SOAP_DEL_METHOD: + *s = "HTTP DELETE method not implemented"; + break; + case SOAP_HTTP_METHOD: + *s = "HTTP method error"; + break; + case SOAP_EOM: + *s = "Out of memory"; + break; + case SOAP_MOE: + *s = "Memory overflow or memory corruption error"; + break; + case SOAP_HDR: + *s = "Header line too long"; + break; + case SOAP_IOB: + *s = "Array index out of bounds"; + break; + case SOAP_NULL: + *s = soap_set_validation_fault(soap, "nil not allowed", NULL); + break; + case SOAP_DUPLICATE_ID: + *s = soap_set_validation_fault(soap, "multiple elements (use the SOAP_XML_TREE flag) with duplicate id ", soap->id); + if (soap->version == 2) + *soap_faultsubcode(soap) = "SOAP-ENC:DuplicateID"; + break; + case SOAP_MISSING_ID: + *s = soap_set_validation_fault(soap, "missing id for ref ", soap->id); + if (soap->version == 2) + *soap_faultsubcode(soap) = "SOAP-ENC:MissingID"; + break; + case SOAP_HREF: + *s = soap_set_validation_fault(soap, "incompatible object type id-ref ", soap->id); + break; + case SOAP_FAULT: + break; +#ifndef WITH_NOIO + case SOAP_UDP_ERROR: + *s = "Message too large for UDP packet"; + break; + case SOAP_TCP_ERROR: + *s = tcp_error(soap); + break; +#endif + case SOAP_HTTP_ERROR: + *s = "An HTTP processing error occurred"; + break; + case SOAP_NTLM_ERROR: + *s = "An HTTP NTLM authentication error occurred"; + break; + case SOAP_SSL_ERROR: +#ifdef WITH_OPENSSL + *s = "SSL/TLS error"; +#else + *s = "OpenSSL not installed: recompile with -DWITH_OPENSSL"; +#endif + break; + case SOAP_PLUGIN_ERROR: + *s = "Plugin registry error"; + break; + case SOAP_DIME_ERROR: + *s = "DIME format error or max DIME size exceeds SOAP_MAXDIMESIZE currently set to " SOAP_XSTRINGIFY(SOAP_MAXDIMESIZE); + break; + case SOAP_DIME_HREF: + *s = "DIME href to missing attachment"; + break; + case SOAP_DIME_MISMATCH: + *s = "DIME version/transmission error"; + break; + case SOAP_DIME_END: + *s = "End of DIME error"; + break; + case SOAP_MIME_ERROR: + *s = "MIME format error"; + break; + case SOAP_MIME_HREF: + *s = "MIME href to missing attachment"; + break; + case SOAP_MIME_END: + *s = "End of MIME error"; + break; + case SOAP_ZLIB_ERROR: +#ifdef WITH_ZLIB + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), (soap->d_stream && soap->d_stream->msg ? strlen(soap->d_stream->msg) : 0) + 19), "Zlib/gzip error: '%s'", soap->d_stream && soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS); + *s = soap->msgbuf; +#else + *s = "Zlib/gzip not installed for (de)compression: recompile with -DWITH_GZIP"; +#endif + break; + case SOAP_REQUIRED: + *s = soap_set_validation_fault(soap, "missing required attribute", NULL); + break; + case SOAP_PROHIBITED: + *s = soap_set_validation_fault(soap, "prohibited attribute present", NULL); + break; + case SOAP_LEVEL: + *s = "Maximum XML nesting depth level exceeded: increase maxlevel"; + break; + case SOAP_LENGTH: + *s = soap_set_validation_fault(soap, "value range or content length violation", NULL); + break; + case SOAP_OCCURS: + *s = soap_set_validation_fault(soap, "occurrence constraint violation", NULL); + break; + case SOAP_FIXED: + *s = soap_set_validation_fault(soap, "value does not match the fixed value required", NULL); + break; + case SOAP_EMPTY: + *s = soap_set_validation_fault(soap, "empty value provided where a value is required", NULL); + break; + case SOAP_FD_EXCEEDED: + *s = "Maximum number of open connections was reached: increase FD_SETSIZE or define HAVE_POLL"; + break; + case SOAP_UTF_ERROR: + *s = "UTF content encoding error"; + break; + case SOAP_STOP: + *s = "Stopped: service request already handled by plugin (informative)"; + break; +#endif + case SOAP_EOF: +#ifndef WITH_NOIO + *s = soap_strerror(soap); /* *s = soap->msgbuf */ +#ifndef WITH_LEAN + if (strlen(soap->msgbuf) + 25 < sizeof(soap->msgbuf)) + { + (void)soap_memmove((void*)(soap->msgbuf + 25), sizeof(soap->tmpbuf) - 25, (const void*)soap->msgbuf, strlen(soap->msgbuf) + 1); + if (soap->is) +#if defined(__cplusplus) && !defined(WITH_COMPAT) + (void)soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End or bad std::istream: ", 25); +#else + (void)soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End at NUL buffer input: ", 25); +#endif + else + (void)soap_memcpy((void*)soap->msgbuf, sizeof(soap->msgbuf), (const void*)"End of file or no input: ", 25); + } +#endif + break; +#else + *s = "End of file or no input"; + break; +#endif + case SOAP_ERR: + *s = "An unspecified error occurred"; + break; + default: +#ifndef WITH_NOHTTP +#ifndef WITH_LEAN + if (soap->error >= 200 && soap->error < 600) + { + const char *t = http_error(soap, soap->error); + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), strlen(t) + 54), "Error %d: HTTP %d %s", soap->error, soap->error, t); + *s = soap->msgbuf; + } + else +#endif +#endif + { + (SOAP_SNPRINTF(soap->msgbuf, sizeof(soap->msgbuf), 26), "Error %d", soap->error); + *s = soap->msgbuf; + } + } +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send_fault(struct soap *soap) +{ + int status = soap->error; + if (status == SOAP_OK || status == SOAP_STOP) + return soap_closesock(soap); +#ifndef WITH_NOHTTP + if (status >= 200 && status <= 299) + return soap_send_empty_response(soap, status); +#endif + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error)); + soap->keep_alive = 0; /* error: close connection later by disabling keep-alive here */ + soap_set_fault(soap); + if (soap->error < 200 && soap->error != SOAP_FAULT) + soap->header = NULL; + if (status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout)) + { + int r = 1; +#ifndef WITH_NOIO + if (soap->fpoll && soap->fpoll(soap)) + { + r = 0; + } +#ifndef WITH_LEAN + else if (soap_valid_socket(soap->socket)) + { + r = tcp_select(soap, soap->socket, SOAP_TCP_SELECT_RCV | SOAP_TCP_SELECT_SND, 0); + if (r > 0) + { + int t; + if (!(r & SOAP_TCP_SELECT_SND) + || ((r & SOAP_TCP_SELECT_RCV) + && recv(soap->socket, (char*)&t, 1, MSG_PEEK) < 0)) + r = 0; + } + } +#endif +#endif + if (r > 0) + { + soap->error = SOAP_OK; + if (soap->version > 0) + { + soap->encodingStyle = NULL; /* no encodingStyle in Faults */ + soap_serializeheader(soap); + soap_serializefault(soap); + (void)soap_begin_count(soap); + if ((soap->mode & SOAP_IO_LENGTH)) + { + if (soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_putfault(soap) + || soap_body_end_out(soap) + || soap_envelope_end_out(soap)) + return soap_closesock(soap); + } + (void)soap_end_count(soap); + if (soap_response(soap, status) + || soap_envelope_begin_out(soap) + || soap_putheader(soap) + || soap_body_begin_out(soap) + || soap_putfault(soap) + || soap_body_end_out(soap) + || soap_envelope_end_out(soap) + || soap_end_send(soap)) + return soap_closesock(soap); + } + else + { + const char *s = *soap_faultstring(soap); + const char **d = soap_faultdetail(soap); + (void)soap_begin_count(soap); + if ((soap->mode & SOAP_IO_LENGTH)) + if (soap_element_begin_out(soap, "fault", 0, NULL) + || soap_outstring(soap, "reason", 0, (char*const*)&s, NULL, 0) + || soap_outliteral(soap, "detail", (char*const*)d, NULL) + || soap_element_end_out(soap, "fault")) + return soap_closesock(soap); + (void)soap_end_count(soap); + if (soap_response(soap, status) + || soap_element_begin_out(soap, "fault", 0, NULL) + || soap_outstring(soap, "reason", 0, (char*const*)&s, NULL, 0) + || soap_outliteral(soap, "detail", (char*const*)d, NULL) + || soap_element_end_out(soap, "fault") + || soap_end_send(soap)) + return soap_closesock(soap); + } + } + } + soap->error = status; + return soap_closesock(soap); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_fault(struct soap *soap, int check) +{ + int status = soap->status; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Check (%d) if receiving SOAP Fault (status = %d)\n", check, status)); + if (!check) + { + /* try getfault when no tag or tag mismatched at level 2, otherwise close and return SOAP_TAG_MISMATCH or HTTP error code */ + if (soap->error != SOAP_NO_TAG && (soap->error != SOAP_TAG_MISMATCH || soap->level != 2)) + { + if (soap->error == SOAP_TAG_MISMATCH && soap->level == 0) + { + soap->error = SOAP_OK; + if (!soap_element_begin_in(soap, "fault", 0, NULL)) + { + char *s = NULL, *d = NULL; + (void)soap_instring(soap, "reason", &s, NULL, 0, 1, 0, -1, NULL); + (void)soap_inliteral(soap, "detail", &d); + if (!soap_element_end_in(soap, "fault") && !soap_end_recv(soap)) + { + *soap_faultstring(soap) = s; + *soap_faultdetail(soap) = d; + if (status) + soap->error = status; + else + soap->error = SOAP_FAULT; + soap_set_fault(soap); + return soap_closesock(soap); + } + } + soap->error = SOAP_TAG_MISMATCH; + } + if (status && (status < 200 || status > 299)) + soap->error = status; + return soap_closesock(soap); + } + } + soap->error = SOAP_OK; + if (soap_getfault(soap)) + { + /* if check>0 and no SOAP Fault is present and no HTTP error then just return to parse request */ + if (check + && (status == 0 || (status >= 200 && status <= 299)) + && ((soap->error == SOAP_TAG_MISMATCH && soap->level == 2) || soap->error == SOAP_NO_TAG)) + return soap->error = SOAP_OK; + /* if check=0 and empty SOAP Body and encodingStyle is NULL and no HTTP error then just return */ + if (!check + && (status == 0 || (status >= 200 && status <= 299)) + && !soap->encodingStyle + && (soap->error == SOAP_NO_TAG && soap->level <= 2)) + return soap->error = SOAP_OK; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed with error %d at level %u tag '%s'\n", soap->error, soap->level, soap->tag)); + *soap_faultcode(soap) = (soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client"); + if (status) + soap->error = status; + else + soap->error = status = SOAP_NO_DATA; + soap_set_fault(soap); + } + else + { + const char *s = *soap_faultcode(soap); + if (!soap_match_tag(soap, s, "SOAP-ENV:Server") + || !soap_match_tag(soap, s, "SOAP-ENV:Receiver")) + { + status = SOAP_SVR_FAULT; + } + else if (!soap_match_tag(soap, s, "SOAP-ENV:Client") + || !soap_match_tag(soap, s, "SOAP-ENV:Sender")) + { + status = SOAP_CLI_FAULT; + } + else if (!soap_match_tag(soap, s, "SOAP-ENV:MustUnderstand")) + { + status = SOAP_MUSTUNDERSTAND; + } + else if (!soap_match_tag(soap, s, "SOAP-ENV:VersionMismatch")) + { + status = SOAP_VERSIONMISMATCH; + } + else + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Received SOAP Fault code %s\n", s)); + status = SOAP_FAULT; + } + if (!soap_body_end_in(soap)) + soap_envelope_end_in(soap); + } + (void)soap_end_recv(soap); + soap->error = status; + return soap_closesock(soap); +} + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_send_empty_response(struct soap *soap, int httpstatuscode) +{ + soap_mode m = soap->omode; + if (!(m & SOAP_IO_UDP)) + { + soap->count = 0; + if ((m & SOAP_IO) == SOAP_IO_CHUNK) + soap->omode = (m & ~SOAP_IO) | SOAP_IO_BUFFER; + (void)soap_response(soap, httpstatuscode); + (void)soap_end_send(soap); /* force end of sends */ + soap->error = SOAP_STOP; /* stops the server from returning another response */ + soap->omode = m; + } + return soap_closesock(soap); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOHTTP +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_recv_empty_response(struct soap *soap) +{ + soap->error = SOAP_OK; + if (!(soap->omode & SOAP_IO_UDP) && !(soap->omode & SOAP_ENC_PLAIN)) + { + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Receiving empty response\n")); + if (soap_begin_recv(soap) == SOAP_OK) + { + if (soap_http_skip_body(soap) || soap_end_recv(soap)) + return soap_closesock(soap); + } + else if (soap->error == 200 || soap->error == 201 || soap->error == 202) + { + soap->error = SOAP_OK; + } + } +#ifndef WITH_LEANER + else if ((soap->fprepareinitrecv && (soap->error = soap->fprepareinitrecv(soap))) + || (soap->fpreparefinalrecv && (soap->error = soap->fpreparefinalrecv(soap)))) + { + return soap->error; + } +#endif + return soap_closesock(soap); +} +#endif + +/******************************************************************************/ + +#ifndef WITH_NOIO +static const char* +soap_strerror(struct soap *soap) +{ + int err = soap->errnum; + *soap->msgbuf = '\0'; + if (err) + { +#ifndef WIN32 +# ifdef HAVE_STRERROR_R +# if !defined(_GNU_SOURCE) || (!_GNU_SOURCE && ((!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)) || defined(__ANDROID__) || !defined(__GLIBC__)) + err = strerror_r(err, soap->msgbuf, sizeof(soap->msgbuf)); /* XSI-compliant */ + if (err != 0) + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "unknown error"); +# else + return strerror_r(err, soap->msgbuf, sizeof(soap->msgbuf)); /* GNU-specific */ +# endif +# else + return strerror(err); +# endif +#else +#ifndef UNDER_CE + DWORD len; + *soap->msgbuf = '\0'; + len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)soap->msgbuf, (DWORD)sizeof(soap->msgbuf), NULL); +#else + DWORD i, len; + *soap->msgbuf = '\0'; + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, (LPTSTR)soap->msgbuf, (DWORD)(sizeof(soap->msgbuf)/sizeof(TCHAR)), NULL); + for (i = 0; i <= len; i++) + { + if (((TCHAR*)soap->msgbuf)[i] < 0x80) + soap->msgbuf[i] = (char)((TCHAR*)soap->msgbuf)[i]; + else + soap->msgbuf[i] = '?'; + } +#endif +#endif + } + else + { + if (soap->recv_maxlength && soap->count > soap->recv_maxlength) + { + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "max message length exceeded"); + } + else + { + int tt = soap->transfer_timeout, rt = soap->recv_timeout, st = soap->send_timeout; +#ifndef WITH_LEAN + int tu = ' ', ru = ' ', su = ' '; +#endif + soap_strcpy(soap->msgbuf, sizeof(soap->msgbuf), "message transfer interrupted"); + if (tt | rt || st) + soap_strcpy(soap->msgbuf + 28, sizeof(soap->msgbuf) - 28, " or timed out"); +#ifndef WITH_LEAN + if (tt < 0) + { + tt = -tt; + tu = 'u'; + } + if (rt < 0) + { + rt = -rt; + ru = 'u'; + } + if (st < 0) + { + st = -st; + su = 'u'; + } + if (tt) + { + size_t l = strlen(soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 43), " (%d%csec max transfer time)", tt, tu); + } + if (rt) + { + size_t l = strlen(soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 40), " (%d%csec max recv delay)", rt, ru); + } + if (st) + { + size_t l = strlen(soap->msgbuf); + (SOAP_SNPRINTF(soap->msgbuf + l, sizeof(soap->msgbuf) - l, 40), " (%d%csec max send delay)", st, su); + } +#endif + } + } + return soap->msgbuf; +} +#endif + +/******************************************************************************/ + +static int +soap_set_error(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML, int soaperror) +{ + *soap_faultcode(soap) = faultcode; + if (faultsubcodeQName) + *soap_faultsubcode(soap) = faultsubcodeQName; + *soap_faultstring(soap) = faultstring; + if (faultdetailXML && *faultdetailXML) + { + const char **s = soap_faultdetail(soap); + if (s) + *s = faultdetailXML; + } + return soap->error = soaperror; +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_sender_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror) +{ + return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Sender" : soap->version == 1 ? "SOAP-ENV:Client" : "at sender", NULL, faultstring, faultdetailXML, soaperror); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror) +{ + return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : soap->version == 1 ? "SOAP-ENV:Server" : "detected", NULL, faultstring, faultdetailXML, soaperror); +} + +/******************************************************************************/ + +static int +soap_copy_fault(struct soap *soap, const char *faultcode, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) +{ + char *r = NULL, *s = NULL, *t = NULL; + DBGFUN2("soap_copy_fault", "code=%s", faultcode ? faultcode : "(null)", "string=%s", faultstring ? faultstring : "(null)") + if (faultsubcodeQName) + r = soap_strdup(soap, faultsubcodeQName); + if (faultstring) + s = soap_strdup(soap, faultstring); + if (faultdetailXML) + t = soap_strdup(soap, faultdetailXML); + return soap_set_error(soap, faultcode, r, s, t, SOAP_FAULT); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_sender_fault(struct soap *soap, const char *faultstring, const char *faultdetailXML) +{ + return soap_sender_fault_subcode(soap, NULL, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_sender_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) +{ + return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Sender" : soap->version == 1 ? "SOAP-ENV:Client" : "at source", faultsubcodeQName, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_receiver_fault(struct soap *soap, const char *faultstring, const char *faultdetailXML) +{ + return soap_receiver_fault_subcode(soap, NULL, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_receiver_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML) +{ + return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : soap->version == 1 ? "SOAP-ENV:Server" : "is internal", faultsubcodeQName, faultstring, faultdetailXML); +} + +/******************************************************************************/ + +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_print_fault(struct soap *soap, FILE *fd) +{ + if (soap_check_state(soap)) + { + fprintf(fd, "Error: soap struct state not initialized\n"); + } + else if (soap->error) + { + const char **c, *v = NULL, *s, *d; + c = soap_faultcode(soap); + if (!*c) + { + soap_set_fault(soap); + c = soap_faultcode(soap); + } + if (soap->version == 2) + v = soap_fault_subcode(soap); + s = soap_fault_string(soap); + d = soap_fault_detail(soap); + fprintf(fd, "%s%d fault %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v ? v : "no subcode", s ? s : "[no reason]", d ? d : "[no detail]"); + } +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +#ifndef WITH_LEAN +#ifndef WITH_NOSTDLIB +#ifndef WITH_COMPAT +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_stream_fault(struct soap *soap, std::ostream& os) +{ + if (soap_check_state(soap)) + { + os << "Error: soap struct state not initialized\n"; + } + else if (soap->error) + { + const char **c, *v = NULL, *s, *d; + c = soap_faultcode(soap); + if (!*c) + { + soap_set_fault(soap); + c = soap_faultcode(soap); + } + if (soap->version == 2) + v = soap_fault_subcode(soap); + s = soap_fault_string(soap); + d = soap_fault_detail(soap); + os << (soap->version ? "SOAP 1." : "Error ") + << (soap->version ? (int)soap->version : soap->error) + << " fault " << *c + << "[" << (v ? v : "no subcode") << "]" + << std::endl + << "\"" << (s ? s : "[no reason]") << "\"" + << std::endl + << "Detail: " << (d ? d : "[no detail]") + << std::endl; + } +} +#endif +#endif +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_LEAN +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 +char* +SOAP_FMAC2 +soap_sprint_fault(struct soap *soap, char *buf, size_t len) +{ + if (soap_check_state(soap)) + { + soap_strcpy(buf, len, "Error: soap struct not initialized"); + } + else if (soap->error) + { + const char **c, *v = NULL, *s, *d; + c = soap_faultcode(soap); + if (!*c) + { + soap_set_fault(soap); + c = soap_faultcode(soap); + } + if (soap->version == 2) + v = soap_fault_subcode(soap); + if (!v) + v = "no subcode"; + s = soap_fault_string(soap); + if (!s) + s = "[no reason]"; + d = soap_fault_detail(soap); + if (!d) + d = "[no detail]"; + (SOAP_SNPRINTF(buf, len, strlen(*c) + strlen(v) + strlen(s) + strlen(d) + 72), "%s%d fault %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, *c, v, s, d); + } + else if (len > 0) + { + *buf = '\0'; + } + return buf; +} +#endif +#endif + +/******************************************************************************/ + +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_print_fault_location(struct soap *soap, FILE *fd) +{ +#ifndef WITH_LEAN + int i, j, c1, c2; + if (soap_check_state(soap) == SOAP_OK && soap->error && soap->error != SOAP_STOP && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= sizeof(soap->buf)) + { + i = (int)soap->bufidx - 1; + if (i <= 0) + i = 0; + c1 = soap->buf[i]; + soap->buf[i] = '\0'; + if ((int)soap->buflen >= i + 1024) + j = i + 1023; + else + j = (int)soap->buflen - 1; + c2 = soap->buf[j]; + soap->buf[j] = '\0'; + fprintf(fd, "%s%c\n\n", soap->buf, c1); + if (soap->bufidx < soap->buflen) + fprintf(fd, "%s\n", soap->buf + soap->bufidx); + soap->buf[i] = (char)c1; + soap->buf[j] = (char)c2; + } +#else + (void)soap; + (void)fd; +#endif +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +#ifndef WITH_LEAN +#ifndef WITH_NOSTDLIB +#ifndef WITH_COMPAT +SOAP_FMAC1 +void +SOAP_FMAC2 +soap_stream_fault_location(struct soap *soap, std::ostream& os) +{ + int i, j, c1, c2; + if (soap_check_state(soap) == SOAP_OK && soap->error && soap->error != SOAP_STOP && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= sizeof(soap->buf)) + { + i = (int)soap->bufidx - 1; + if (i <= 0) + i = 0; + c1 = soap->buf[i]; + soap->buf[i] = '\0'; + if ((int)soap->buflen >= i + 1024) + j = i + 1023; + else + j = (int)soap->buflen - 1; + c2 = soap->buf[j]; + soap->buf[j] = '\0'; + os << soap->buf << (char)c1 << std::endl << "" << std::endl; + if (soap->bufidx < soap->buflen) + os << soap->buf + soap->bufidx << std::endl; + soap->buf[i] = (char)c1; + soap->buf[j] = (char)c2; + } +} +#endif +#endif +#endif +#endif + +/******************************************************************************/ + +SOAP_FMAC1 +int +SOAP_FMAC2 +soap_register_plugin_arg(struct soap *soap, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void *arg) +{ + struct soap_plugin *p; + int err; + p = (struct soap_plugin*)SOAP_MALLOC(soap, sizeof(struct soap_plugin)); + if (!p) + return soap->error = SOAP_EOM; + p->id = NULL; + p->data = NULL; + p->fcopy = NULL; + p->fdelete = NULL; + err = fcreate(soap, p, arg); + if (!err && p->fdelete && p->id) + { + if (!soap_lookup_plugin(soap, p->id)) + { + p->next = soap->plugins; + soap->plugins = p; + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Registered '%s' plugin\n", p->id)); + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin with the same ID already registered\n", p->id)); + SOAP_FREE(soap, p); + return SOAP_OK; + } + DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin returned error %d or plugin ID not set or fdelete callback not set\n", p->id ? p->id : "plugin ID not set", err)); + SOAP_FREE(soap, p); + soap->error = err ? err : SOAP_PLUGIN_ERROR; + return soap->error; +} + +/******************************************************************************/ + +static void * +fplugin(struct soap *soap, const char *id) +{ + struct soap_plugin *p; + for (p = soap->plugins; p; p = p->next) + if (p->id == id || !strcmp(p->id, id)) + return p->data; + return NULL; +} + +/******************************************************************************/ + +SOAP_FMAC1 +void * +SOAP_FMAC2 +soap_lookup_plugin(struct soap *soap, const char *id) +{ + return soap->fplugin(soap, id); +} + +/******************************************************************************/ + +#ifdef __cplusplus +} +#endif + +/******************************************************************************\ + * + * C++ soap struct methods + * +\******************************************************************************/ + +#ifdef __cplusplus +soap::soap() +{ + soap_init(this); + /* no logs to prevent DEBUG mode leaks when the user calls a soap_init() on this context */ + soap_set_test_logfile(this, NULL); + soap_set_sent_logfile(this, NULL); + soap_set_recv_logfile(this, NULL); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::soap(soap_mode m) +{ + soap_init1(this, m); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::soap(soap_mode im, soap_mode om) +{ + soap_init2(this, im, om); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::soap(const struct soap& soap) +{ + soap_copy_context(this, &soap); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +struct soap& soap::operator=(const struct soap& soap) +{ + soap_done(this); + soap_copy_context(this, &soap); + return *this; +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +void soap::destroy() +{ + soap_destroy(this); + soap_end(this); +} +#endif + +/******************************************************************************/ + +#ifdef __cplusplus +soap::~soap() +{ + soap_done(this); +} +#endif + +/******************************************************************************/ diff --git a/connor_erp_mes/stdsoap2.h b/connor_erp_mes/stdsoap2.h new file mode 100644 index 0000000..b15c282 --- /dev/null +++ b/connor_erp_mes/stdsoap2.h @@ -0,0 +1,3720 @@ +/* + stdsoap2.h 2.8.91 + + gSOAP runtime engine + +gSOAP XML Web services tools +Copyright (C) 2000-2019, Robert van Engelen, Genivia Inc., All Rights Reserved. +This part of the software is released under ONE of the following licenses: +GPL, or the gSOAP public license, or Genivia's license for commercial use. +-------------------------------------------------------------------------------- +Contributors: + +Wind River Systems, Inc., for the following addition licensed under the gSOAP +public license: + - vxWorks compatible, enabled with compiler option -DVXWORKS +-------------------------------------------------------------------------------- +gSOAP public license. + +The contents of this file are subject to the gSOAP Public License Version 1.3 +(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.cs.fsu.edu/~engelen/soaplicense.html +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the License. + +The Initial Developer of the Original Code is Robert A. van Engelen. +Copyright (C) 2000-2019, Robert van Engelen, Genivia Inc., All Rights Reserved. +-------------------------------------------------------------------------------- +GPL license. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Author contact information: +engelen@genivia.com / engelen@acm.org + +This program is released under the GPL with the additional exemption that +compiling, linking, and/or using OpenSSL is allowed. +-------------------------------------------------------------------------------- +A commercial use license is available from Genivia, Inc., contact@genivia.com +-------------------------------------------------------------------------------- +*/ + +#define GSOAP_VERSION 20891 + +#ifdef WITH_SOAPDEFS_H +# include "soapdefs.h" /* include user-defined stuff in soapdefs.h */ +#endif + +#ifndef _THREAD_SAFE +# define _THREAD_SAFE +#endif + +#ifndef OPENSERVER +# ifndef _REENTRANT +# define _REENTRANT +# endif +#endif + +#ifdef _WIN32 +# ifndef WIN32 +# define WIN32 +# endif +#endif + +/* for legacy purposes we use WIN32 macro, even when WIN64 is supported */ +#ifdef _WIN64 +# ifndef WIN32 +# define WIN32 +# endif +#endif + +#ifdef WIN32 +# ifdef SOAP_STD_EXPORTS /* dllexport the API functions and classes */ +# ifndef SOAP_STD_API +# define SOAP_STD_API __declspec(dllexport) +# endif +# ifndef SOAP_CMAC +# define SOAP_CMAC SOAP_STD_API /* export soap struct and generated classes */ +# endif +# ifndef SOAP_FMAC1 +# define SOAP_FMAC1 SOAP_STD_API /* export stdsoap2.cpp API */ +# endif +# ifndef SOAP_FMAC3 +# define SOAP_FMAC3 SOAP_STD_API /* export soapC.cpp serializers API */ +# endif +# ifndef SOAP_FMAC5 +# define SOAP_FMAC5 SOAP_STD_API /* export soapClient.cpp and soapServer.cpp API */ +# endif +# endif +#endif + +#ifndef SOAP_FMAC1 /* stdsoap2.h declaration macro */ +# define SOAP_FMAC1 +#endif + +#ifndef SOAP_FMAC2 /* stdsoap2.h declaration macro */ +# define SOAP_FMAC2 +#endif + +#ifndef SOAP_FMAC3 /* (de)serializer declaration macro */ +# define SOAP_FMAC3 +#endif + +#ifndef SOAP_FMAC3S /* string converter for (de)serializer declaration macro */ +# define SOAP_FMAC3S SOAP_FMAC3 +#endif + +#ifndef SOAP_FMAC4 /* (de)serializer declaration macro */ +# define SOAP_FMAC4 +#endif + +#ifndef SOAP_FMAC4S /* string converter for (de)serializer declaration macro */ +# define SOAP_FMAC4S SOAP_FMAC4 +#endif + +#ifndef SOAP_FMAC5 /* stub/skeleton declaration macro */ +# define SOAP_FMAC5 +#endif + +#ifndef SOAP_FMAC6 /* stub/skeleton declaration macro */ +# define SOAP_FMAC6 +#endif + +#ifndef SOAP_CMAC /* class declaration macro */ +# define SOAP_CMAC +#endif + +#ifndef SOAP_NMAC /* namespace table declaration macro */ +# define SOAP_NMAC +#endif + +#ifndef SOAP_SOURCE_STAMP +# define SOAP_SOURCE_STAMP(str) +#endif + +#ifndef STDSOAP_H +#define STDSOAP_H + +#define SOAP_XSTRINGIFY(s) SOAP_STRINGIFY(s) +#define SOAP_STRINGIFY(s) #s + +#if defined(SOAPDEFS_H) && !defined(WITH_SOAPDEFS_H) +# include SOAP_XSTRINGIFY(SOAPDEFS_H) /* include user-defined "SOAPDEFS_H" */ +#endif + +#if defined(__vxworks) || defined(__VXWORKS__) +# ifndef VXWORKS +# define VXWORKS +# endif +#endif + +#ifdef _WIN32_WCE +# ifndef UNDER_CE +# define UNDER_CE _WIN32_WCE +# endif +#endif + +#ifdef UNDER_CE +# ifndef WIN32 +# define WIN32 +# endif +#endif + +#ifdef __BORLANDC__ +# ifdef __clang__ +# ifdef _WIN32 +# ifndef WIN32 +# define WIN32 +# endif +# endif +# else +# ifdef __WIN32__ +# ifndef WIN32 +# define WIN32 +# endif +# endif +# endif +#endif + +#if defined(__CYGWIN__) || defined(__CYGWIN32__) +# ifndef CYGWIN +# define CYGWIN +# endif +#endif + +#ifdef __SYMBIAN32__ +# define SYMBIAN +# undef WIN32 +#endif + +#if defined(__hpux) +# ifndef HP_UX +# define HP_UX +# endif +#endif + +#if defined(__digital__) && defined(__unix__) +# ifndef TRU64 +# define TRU64 +# endif +#endif + +#ifdef __MVS__ +# ifndef OS390 +# define OS390 +# endif +#endif + +#if defined(__sun) && defined(__SVR4) +# ifndef SUN_OS +# define SUN_OS +# endif +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +# if defined(UNDER_CE) +# define SOAP_BUFLEN (2048) +# define SOAP_PTRHASH (32) +# define SOAP_IDHASH (19) +# define SOAP_BLKLEN (32) +# define SOAP_TAGLEN (256) +# define SOAP_HDRLEN (1024) +# define SOAP_MAXDIMS (4) +# define HAVE_SSCANF +# elif defined(CYGWIN) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_INTTYPES_H +# define HAVE_LOCALE_H +# define HAVE_SOCKLEN_T +# elif defined(WIN32) +# ifdef __BORLANDC__ +# ifdef __clang__ +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_STRTOL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_GMTIME +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define SOAP_LONG_FORMAT "%lld" +# define SOAP_ULONG_FORMAT "%llu" +# else +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_STRTOL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_GMTIME +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define SOAP_LONG_FORMAT "%I64d" +# define SOAP_ULONG_FORMAT "%I64u" +# endif +# else +# if _MSC_VER >= 1400 +# define HAVE_SNPRINTF +# endif +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_STRTOL +# define HAVE_STRTOUL +# if _MSC_VER >= 1300 +# define HAVE_STRTOLL /* use _strtoi64 */ +# define HAVE_STRTOULL /* use _strtoui64 */ +# endif +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_GMTIME +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define SOAP_LONG_FORMAT "%I64d" +# define SOAP_ULONG_FORMAT "%I64u" +# define HAVE_LOCALE_H +# endif +# elif defined(__APPLE__) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRLCPY +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_SSCANF_L +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_TM_GMTOFF +# define HAVE_GETTIMEOFDAY +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_TIMEGM +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_INTTYPES_H +# define HAVE_LOCALE_H +# define HAVE_XLOCALE_H +# define HAVE_RANDOM +# define HAVE_SOCKLEN_T +# elif defined(_AIX43) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_LOCALE_H +# define HAVE_SOCKLEN_T +# elif defined(_AIX41) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_LOCALE_H +# elif defined(HP_UX) +# include +# if 0 /* enable if __strtoll and __strtoull are available */ +extern intmax_t __strtoll(const char*, char**, int); +extern intmax_t __strtoull(const char*, char**, int); +# define strtoll __strtoll +# define strtoull __strtoull +# endif +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_ISNAN +# define HAVE_LOCALE_H +# elif defined(FREEBSD) || defined(__FreeBSD__) || defined(OPENBSD) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRLCPY +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOD_L +# define HAVE_SSCANF_L +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_GETTIMEOFDAY +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define SOAP_LONG_FORMAT "%qd" +# define SOAP_ULONG_FORMAT "%qu" +# define HAVE_ISNAN +# define HAVE_ISINF +# define HAVE_LOCALE_H +# define HAVE_XLOCALE_H +# define HAVE_RANDOM +# define HAVE_SOCKLEN_T +# elif defined(__VMS) +# include +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# elif defined(TRU64) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_GETTIMEOFDAY +# define HAVE_SYS_TIMEB_H +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define __USE_STD_IOSTREAM +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define SOAP_LONG_FORMAT "%ld" +# define SOAP_ULONG_FORMAT "%lu" +# define HAVE_LOCALE_H +# elif defined(__GLIBC__) || defined(__GNU__) || defined(__GNUC__) +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_SYS_TIMEB_H +# define HAVE_GETTIMEOFDAY +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_TIMEGM +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_ISNAN +# define HAVE_ISINF +# if !defined(__GNUC__) || __GNUC__ >= 4 /* gcc 3 and earlier often refuse to compile _l functions */ +# define HAVE_STRTOD_L +# define HAVE_SSCANF_L +# define HAVE_LOCALE_H +# endif +# define HAVE_SOCKLEN_T +# elif defined(MAC_CARBON) +# define WITH_NOIO +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# elif defined(SYMBIAN) +# define WITH_LEAN +# define WITH_NONAMESPACES +# define HAVE_STRTOD /* use STRTOD since sscanf doesn't seem to work */ +# include +# include +# elif defined(VXWORKS) +# ifdef _WRS_KERNEL +# define _POSIX_THREADS 1 +# endif +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_GMTIME +# define HAVE_LOCALTIME +# define HAVE_MKTIME +# elif defined(OS390) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_SOCKLEN_T +# elif defined(AS400) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# elif defined(__QNX__) || defined(QNX) +/* QNX does not have a working version of strtof */ +# undef HAVE_STRTOF +# define HAVE_POLL +# define HAVE_SNPRINTF +# define HAVE_STRLCPY +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_GETTIMEOFDAY +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# define HAVE_SOCKLEN_T +# elif defined(SUN_OS) +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# else /* Default assumptions for supported library functions when not including config.h */ +# ifndef WITH_C_LOCALE +# ifndef WITH_NO_C_LOCALE +# define WITH_NO_C_LOCALE /* turn locale support off by default */ +# endif +# endif +# define HAVE_SNPRINTF +# define HAVE_STRRCHR +# define HAVE_STRTOD +# define HAVE_SSCANF +# define HAVE_STRTOL +# define HAVE_STRTOUL +# define HAVE_STRTOLL +# define HAVE_STRTOULL +# define HAVE_SYS_TIMEB_H +# define HAVE_FTIME +# define HAVE_RAND_R +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GMTIME_R +# define HAVE_ASCTIME_R +# define HAVE_LOCALTIME_R +# define HAVE_STRERROR_R +# define HAVE_LOCALE_H +# ifdef MB_LEN_MAX +# define HAVE_WCTOMB +# define HAVE_MBTOWC +# endif +# endif +#endif + +#ifdef WITH_LEANER +# ifndef WITH_LEAN +# define WITH_LEAN +# endif +#endif + +/* gSOAP 2.7.15 and higher: always use FAST and retain CDATA in literal XML, unless WITH_LEAN or WITH_NOCDATA */ +#ifndef WITH_LEAN +# ifndef WITH_FAST +# define WITH_FAST +# endif +# ifndef WITH_NOCDATA +# ifndef WITH_CDATA +# define WITH_CDATA +# endif +# endif +#endif + +#if !defined(__cplusplus) +/* allowing empty struct/union in C is a GNU extension */ +# if !defined(__GNU__) && !defined(__GNUC__) +# define WITH_NOEMPTYSTRUCT +# endif +#endif + +/* silence clang's C99 variadic macro warnings */ +#ifdef __clang__ +# pragma clang diagnostic ignored "-Wvariadic-macros" +#endif + +#if defined(WITH_PURE_VIRTUAL) +# define SOAP_PURE_VIRTUAL = 0 +# define SOAP_PURE_VIRTUAL_COPY = 0 +#elif defined(WITH_DEFAULT_VIRTUAL) +# define SOAP_PURE_VIRTUAL { return SOAP_NO_METHOD; } +# define SOAP_PURE_VIRTUAL_COPY +#else +# define SOAP_PURE_VIRTUAL +# define SOAP_PURE_VIRTUAL_COPY +#endif + +/* older OpenVMS TCP/IP stacks cannot handle 65536 bytes */ +#ifdef __VMS +# ifndef SOAP_BUFLEN +# define SOAP_BUFLEN (65535) +# endif +#endif + +/* small buffer, to accelerate base64 and hex binary output */ +#ifndef SOAP_BINARY_BUFLEN +# define SOAP_BINARY_BUFLEN (128) +#endif + +/* if we have locale.h then we should use it WITH_C_LOCALE enabled to avoid decimal point conversion issues */ +#ifdef HAVE_LOCALE_H +# ifndef WITH_NO_C_LOCALE +# ifndef WITH_C_LOCALE +# define WITH_C_LOCALE +# endif +# endif +#endif + +/* MinGW does not support uselocale() and xlocale.h and gettimeofday() */ +#if defined(__MINGW32__) || defined(__MINGW64__) +# if !defined(WITH_NO_C_LOCALE) +# define WITH_NO_C_LOCALE +# endif +# undef HAVE_GETTIMEOFDAY +#endif + +/* user can set WITH_NO_C_LOCALE to force removal of locale (e.g. in case of compiler errors) */ +#ifdef WITH_NO_C_LOCALE +# undef WITH_C_LOCALE +#endif + +#ifndef WITH_NOSTDLIB +# include +# include +# include +# if !defined(HAVE_CONFIG_H) || defined(HAVE_CTYPE_H) +# include +# endif +# if !defined(HAVE_CONFIG_H) || defined(HAVE_LIMITS_H) +# include /* for MB_LEN_MAX */ +# endif +# if !defined(HAVE_CONFIG_H) || defined(HAVE_FLOAT_H) +# include /* for INFINITY */ +# endif +# if !defined(HAVE_CONFIG_H) || defined(HAVE_MATH_H) +# include /* for isnan() and isinf() */ +# endif +#endif + +/* force inclusion of xlocale.h when WITH_INCLUDE_XLOCALE_H is defined by the user for systems that require xlocale.h */ +#ifdef WITH_INCLUDE_XLOCALE_H +# ifndef HAVE_XLOCALE_H +# define HAVE_XLOCALE_H +# endif +#endif + +#ifdef WITH_C_LOCALE +# include +# if defined(WIN32) && !defined(CYGWIN) +# define SOAP_LOCALE_T _locale_t +# define SOAP_LOCALE(soap) ((soap)->c_locale ? (soap)->c_locale : ((soap)->c_locale = _create_locale(LC_ALL, "C"))) +# define SOAP_FREELOCALE(soap) (void)((soap)->c_locale && (_free_locale((soap)->c_locale), ((soap)->c_locale = NULL))) +# else +# if defined(HAVE_XLOCALE_H) +# include +# endif +# define SOAP_LOCALE_T locale_t +# define SOAP_LOCALE(soap) ((soap)->c_locale ? (soap)->c_locale : ((soap)->c_locale = newlocale(LC_ALL_MASK, "C", NULL))) +# define SOAP_FREELOCALE(soap) (void)((soap)->c_locale && (freelocale((soap)->c_locale), ((soap)->c_locale = NULL))) +# if defined(CYGWIN) +# undef HAVE_STRTOF_L /* Cygwin does not support strtof_l strtod_l */ +# undef HAVE_STRTOD_L +# endif +# endif +#else +# undef HAVE_STRTOF_L +# undef HAVE_STRTOD_L +# undef HAVE_SSCANF_L +#endif + +#ifdef TANDEM_NONSTOP /* Support for Guardian */ +# define SOAP_BUFLEN (32767) +/*# define WITH_NOSTDLIB */ /* uncommment to remove stdlib dependences */ +# define WITH_NOIO /* no IO dependences, e.g. remove TCP/IP */ +# define int32_t int +# define int64_t long long +# define LONG64 long long +# define ULONG64 unsigned long long +# define DBL_PINFTY (1.1579208923716189e77) +# undef HAVE_WCTOMB +# undef HAVE_MBTOWC +# undef HAVE_GMTIME_R +# undef HAVE_ASCTIME_R +# undef HAVE_LOCALTIME_R +# undef HAVE_SNPRINTF +# define SOAP_BUFLEN (32767) +# define SOAP_SOCKET short +#pragma nolist +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# define INET_ERROR 4294967295 +#pragma list +#elif defined(__TANDEM) /* Support for OSS */ +# define int32_t int +# define SOAP_BUFLEN (32767) +#endif + +#ifdef WITH_NTLM +# include +#endif + +#ifdef HAVE_POLL +# include +#endif + +#ifdef __cplusplus +# include +# include +# ifndef WITH_COMPAT +# include +# include +# endif +#endif + +#ifdef WITH_NOHTTP +# ifndef WITH_NOIO +# define WITH_NOIO +# undef WITH_COOKIES +# endif +#endif + +/* Suggestion when SOAP_FD_EXCEEDED error occurs: + Some systems allow increasing FD_SETSIZE before including sys/types.h: +#define FD_SETSIZE (2048) +*/ + +#ifndef UNDER_CE +# ifndef WITH_NOIO +# include +# include +# endif +# ifndef WITH_LEAN +# ifdef HAVE_SYS_TIMEB_H +# include /* for ftime() */ +# endif +# include +# endif +#endif + +#ifdef OPENSERVER +# include +# include +# include + extern int h_errno; +#endif + +#ifdef HAVE_GETTIMEOFDAY +# ifndef WIN32 +# ifdef VXWORKS +# ifdef _WRS_KERNEL +# include +# endif +# else +# include /* for timeval and gettimeofday() */ +# endif +# endif +#endif + +#ifndef WITH_NOIO +# ifndef WIN32 +# include +# ifdef VXWORKS +# include +# include +# ifndef _WRS_KERNEL +# include +# endif +# else +# ifndef SYMBIAN +# include +# endif +# endif +# ifdef SUN_OS +# include /* SUN */ +# include /* only needed with SUN < 2.8 ? */ +# endif +# ifdef VXWORKS +# ifdef _WRS_KERNEL +# include +# endif +# endif +# include +# ifdef OS390 +# include +# else +# include /* TCP_NODELAY, TCP_FASTOPEN */ +# endif +# include +# endif +#endif + +#ifdef WIN32 +# define SOAP_WINSOCKINT int +#else +# define SOAP_WINSOCKINT size_t +#endif + +#ifdef WIN32 +# undef WITH_SELF_PIPE +#endif + +#if defined(WITH_IPV6_V6ONLY) +# ifndef WITH_IPV6 +# define WITH_IPV6 +# endif +#endif + +#ifdef WIN32 +# ifndef UNDER_CE +# include +# include +# endif +// When you get macro redefinition errors when compiling the code below, then: +// a) try arrange your includes so is included after "stdsoap2.h" +// b) or define _WINSOCKAPI_ first: +// #define _WINSOCKAPI_ // stops windows.h including winsock.h +// #include +// #include "stdsoap2.h" +// c) or compile with the -DWIN32_LEAN_AND_MEAN switch +# include // Visual Studio 2005 users: install Platform SDK (R2) +# include +// # define _WSPIAPI_COUNTOF // DEV NOTE: enble to fix problems with VC6 +// # include +# include // DEV NOTE: replaces older wspiapi.h above +# ifdef WITH_IPV6 +# define SOAP_GAI_STRERROR gai_strerrorA +# endif +#else +# ifdef VXWORKS +# include +# include +# include +# endif +# ifndef WITH_NOIO +# include +# include +# include +# include +# ifdef _AIX41 +# include +# endif +# endif +#endif + +#ifdef WITH_FASTCGI +# include +#endif + +#ifdef WITH_OPENSSL +# ifdef __VMS +# pragma names save +# pragma names uppercase +# endif +# undef WITH_GNUTLS +# define OPENSSL_NO_KRB5 +# include +# include +# include +# include +# include +# include +# include +# include +# ifndef ALLOW_OLD_VERSIONS +# if (OPENSSL_VERSION_NUMBER < 0x00905100L) +# error "Must use OpenSSL 0.9.6 or later" +# endif +# endif +# ifdef __VMS +# pragma names restore +# endif +#endif + +#ifdef WITH_GNUTLS +# include +# include +# if GNUTLS_VERSION_NUMBER < 0x020b00 +/* deprecated since GNUTLS 2.11.0 */ +# include +# endif +# ifndef HAVE_PTHREAD_H +# ifdef _POSIX_THREADS +# define HAVE_PTHREAD_H /* make GNUTLS thread safe */ +# endif +# endif +#endif + +#ifdef WITH_SYSTEMSSL +# include +#endif + +#ifdef WITH_GZIP +# ifndef WITH_ZLIB +# define WITH_ZLIB +# endif +#endif + +#ifdef WITH_CASEINSENSITIVETAGS +# define SOAP_STRCMP soap_tag_cmp /* case insensitive XML element/attribute names */ +#else +# define SOAP_STRCMP strcmp /* case sensitive XML element/attribute names */ +#endif + +#ifdef WITH_ZLIB +# include +#endif + +/* #define DEBUG */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and internal operations (in file TEST.log) */ + +/* #define DEBUG_STAMP */ /* Uncomment to debug sending (in file SENT.log) receiving (in file RECV.log) and time-stamped operations (in file TEST.log) */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Portability (X/Open, BSD sockets etc): define SOAP_SOCKLEN_T as socklen_t or int or ... */ +#if defined(HAVE_SOCKLEN_T) +# define SOAP_SOCKLEN_T socklen_t +#elif defined(_AIX) || defined(AIX) || defined(HP_UX) +# if defined(_AIX43) +# define SOAP_SOCKLEN_T socklen_t +# else +# define SOAP_SOCKLEN_T int +# endif +#elif defined(SOCKLEN_T) +# define SOAP_SOCKLEN_T SOCKLEN_T +#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(__ANDROID__) || !defined(_GNU_SOURCE) || (!_GNU_SOURCE && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 +# define SOAP_SOCKLEN_T socklen_t +#elif defined(IRIX) || defined(WIN32) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS) +# define SOAP_SOCKLEN_T int +#elif !defined(SOAP_SOCKLEN_T) +# define SOAP_SOCKLEN_T socklen_t +#endif + +/* AIX DCE threads portability: define SOAP_FUNC_R_ERR gmtime_r and localtime_r err ret val as -1 */ +#ifdef _AIX32_THREADS +# define SOAP_FUNC_R_ERR (-1) +#elif !defined(SOAP_FUNC_R_ERR) +# define SOAP_FUNC_R_ERR (NULL) +#endif + +#ifndef SOAP_SOCKET +# ifdef WIN32 +# define SOAP_SOCKET SOCKET +# define soap_closesocket(n) closesocket(n) +# else +# define SOAP_SOCKET int +# define soap_closesocket(n) close(n) +# endif +#endif + +#define SOAP_INVALID_SOCKET ((SOAP_SOCKET)-1) +#define soap_valid_socket(sk) ((sk) != SOAP_INVALID_SOCKET) + +#define SOAP_SHUT_WR (1) +#define SOAP_SHUT_RDWR (2) + +#ifndef SOAP_GAI_STRERROR +# define SOAP_GAI_STRERROR gai_strerror +#endif + +#ifndef FD_SETSIZE +# define FD_SETSIZE (1024) +#endif + +#ifdef WITH_LEAN +# define SOAP_CHK_EOF SOAP_EOF +#else +# define SOAP_CHK_EOF (soap->error ? soap->error : SOAP_EOF) +#endif + +#ifdef __cplusplus +# ifndef __STDC_FORMAT_MACROS +# define __STDC_FORMAT_MACROS +# endif +#endif + +#if defined(SYMBIAN) +# warning "Symbian build: removing 64 bit integer support" +# define LONG64 long +# define ULONG64 unsigned LONG64 +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%ld" +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%lu" +# endif +#elif !defined(WIN32) || defined(CYGWIN) || defined(__GLIBC__) || defined(__GNU__) || defined(__GNUC__) +# ifndef LONG64 +# if defined(HAVE_INTTYPES_H) +# include +# define LONG64 int64_t +# define ULONG64 uint64_t +# if defined(PRId64) && defined(PRIu64) +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%" PRId64 +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%" PRIu64 +# endif +# endif +# elif defined(HAVE_SYS_INTTYPES_H) +# include +# define LONG64 int64_t +# define ULONG64 uint64_t +# if defined(PRId64) && defined(PRIu64) +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%" PRId64 +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%" PRIu64 +# endif +# endif +# elif defined(HAVE_STDINT_H) +# include +# define LONG64 int64_t +# define ULONG64 uint64_t +# if defined(PRId64) && defined(PRIu64) +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%" PRId64 +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%" PRIu64 +# endif +# endif +# elif defined(CYGWIN) || defined(__GLIBC__) +# include +# if (__WORDSIZE == 64) +# define LONG64 int64_t +# define ULONG64 uint64_t +# ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%ld" +# endif +# ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%lu" +# endif +# else +# define LONG64 long long +# define ULONG64 unsigned LONG64 +# endif +# else +# define LONG64 long long +# define ULONG64 unsigned LONG64 +# endif +# endif +#elif defined(UNDER_CE) +# define LONG64 __int64 +# define ULONG64 unsigned LONG64 +#elif defined(__BORLANDC__) +# define LONG64 __int64 +# define ULONG64 unsigned LONG64 +#endif + +#ifndef SOAP_LONG_FORMAT +# define SOAP_LONG_FORMAT "%lld" /* printf format for 64 bit long long ints */ +#endif + +#ifndef SOAP_ULONG_FORMAT +# define SOAP_ULONG_FORMAT "%llu" /* printf format for unsigned 64 bit long long ints */ +#endif + +#if defined(WIN32) && !defined(CYGWIN) +# define soap_int32 __int32 +#elif defined(SYMBIAN) +# define soap_int32 long +#elif defined(_AIX) || defined(AIX) +# if defined(_AIX43) +# define soap_int32 int32_t +# else +# define soap_int32 signed int +# endif +#else +# define soap_int32 int32_t +#endif + +#ifdef WIN32 +# define SOAP_ERANGE ERANGE +# define SOAP_EINTR WSAEINTR +# define SOAP_EAGAIN WSAEWOULDBLOCK +# define SOAP_EWOULDBLOCK WSAEWOULDBLOCK +# define SOAP_EINPROGRESS WSAEINPROGRESS +# define SOAP_EADDRINUSE WSAEADDRINUSE +# define SOAP_ECONNREFUSED WSAECONNREFUSED +#else +# ifdef ERANGE +# define SOAP_ERANGE ERANGE +# else +# define SOAP_ERANGE (34) +# endif +# define SOAP_EINTR EINTR +# define SOAP_EAGAIN EAGAIN +# define SOAP_EADDRINUSE EADDRINUSE +# define SOAP_ECONNREFUSED ECONNREFUSED +# ifdef SYMBIAN +# define SOAP_EWOULDBLOCK 9898 +# define SOAP_EINPROGRESS 9899 +# else +# define SOAP_EWOULDBLOCK EWOULDBLOCK +# define SOAP_EINPROGRESS EINPROGRESS +# endif +#endif + +#ifdef WIN32 +# ifdef UNDER_CE +# define soap_errno GetLastError() +# define soap_socket_errno(s) GetLastError() +# define soap_reset_errno SetLastError(0) +# else +# define soap_errno GetLastError() +# define soap_socket_errno(s) WSAGetLastError() +# define soap_reset_errno SetLastError(0) +# endif +#else +# ifndef WITH_NOIO +# define soap_errno errno +# define soap_socket_errno(s) errno +# define soap_reset_errno (errno = 0) +# else +# define soap_errno 0 +# define soap_socket_errno(s) 0 +# define soap_reset_errno +# endif +#endif + +#ifndef SOAP_BUFLEN +# if !defined(WITH_LEAN) +# define SOAP_BUFLEN (65536) /* buffer length for socket packets, so don't make this too small */ +# else +# define SOAP_BUFLEN (2048) /* lean size */ +# endif +#endif +#ifndef SOAP_LABLEN +# define SOAP_LABLEN (256) /* initial look-aside buffer length */ +#endif +#ifndef SOAP_PTRBLK +# define SOAP_PTRBLK (32) /* block allocation for pointer hash table chains */ +#endif +#ifndef SOAP_PTRHASH +# ifndef WITH_LEAN +# define SOAP_PTRHASH (4096) /* size of pointer analysis hash table (must be power of 2) */ +# else +# define SOAP_PTRHASH (32) +# endif +#endif +#ifndef SOAP_IDHASH +# ifndef WITH_LEAN +# define SOAP_IDHASH (1999) /* prime size of hash table for parsed id/ref */ +# else +# define SOAP_IDHASH (19) /* 19, 199 */ +# endif +#endif +#ifndef SOAP_BLKLEN +# ifndef WITH_LEAN +# define SOAP_BLKLEN (256) /* to collect long strings and XML attributes */ +# else +# define SOAP_BLKLEN (32) +# endif +#endif +#ifndef SOAP_TAGLEN +# ifndef WITH_LEAN +# define SOAP_TAGLEN (1024) /* maximum length of XML element tag/attribute name or host/path name + 1 */ +# else +# define SOAP_TAGLEN (256) +# endif +#endif +#ifndef SOAP_HDRLEN +# ifndef WITH_LEAN +# define SOAP_HDRLEN (8192) /* maximum length of HTTP header line (must be >=4096 to read cookies) */ +# else +# define SOAP_HDRLEN (1024) +# endif +#endif +#ifndef SOAP_TMPLEN +# ifndef WITH_LEAN +# define SOAP_TMPLEN (2048) /* maximum length of msgbuf and tmpbuf short message buffers, must be >=1024 */ +# else +# define SOAP_TMPLEN (1024) +# endif +#endif +#ifndef SOAP_MAXDIMS +# ifndef WITH_LEAN +# define SOAP_MAXDIMS (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */ +# else +# define SOAP_MAXDIMS (4) +# endif +#endif +#ifndef SOAP_MAXPTRS +# ifndef WITH_LEAN +# define SOAP_MAXPTRS (4) /* maximum depth + 1 of id-ref deserialized pointer types (int* has depth 0, int*** has depth 2) */ +# else +# define SOAP_MAXPTRS (2) +# endif +#endif + +#ifndef SOAP_MAXALLOCSIZE +# define SOAP_MAXALLOCSIZE (0) /* max size that malloc() can handle, zero for no limit */ +#endif + +#ifndef SOAP_MAXLOGS +# define SOAP_MAXLOGS (3) /* max number of debug logs per struct soap environment */ +# define SOAP_INDEX_RECV (0) +# define SOAP_INDEX_SENT (1) +# define SOAP_INDEX_TEST (2) +#endif + +/* Tag name of multiref elements in SOAP 1.1 encoding */ +#ifndef SOAP_MULTIREFTAG +# define SOAP_MULTIREFTAG "id" +#endif + +/* href-id value base name in multiref SOAP encoding */ +#ifndef SOAP_BASEREFNAME +# define SOAP_BASEREFNAME "_" +#endif + +/* Max number of EINTR interrupts to ignore while poll/select for pending activity on a socket */ +/* Each EINTR ignored may increase the I/O blocking time by at most one second */ +#ifndef SOAP_MAXEINTR +# define SOAP_MAXEINTR (10) +#endif + +/* SOAP_MAXKEEPALIVE: Max iterations in soap_serve() to keep server connection alive */ +#ifndef SOAP_MAXKEEPALIVE +# define SOAP_MAXKEEPALIVE (100) +#endif + +/* SOAP_MAXARRAYSIZE: Trusted total max size of an inbound SOAP Array. + Arrays of larger size are not pre-allocated, but deserialized + on an element-by-element basis until XML validation contrains kick in. + This macro only affects the efficiency of parsing SOAP arrays. +*/ +#ifndef SOAP_MAXARRAYSIZE +# define SOAP_MAXARRAYSIZE (100000) +#endif + +/* SOAP_MAXDIMESIZE: Trusted max size of inbound DIME data. + Increase if necessary to allow larger attachments, or decrease when server + resources are limited. This is to deny senders to allocate more than 8 MB + at the receiver without actually sending the whole message. +*/ +#ifndef SOAP_MAXDIMESIZE +# define SOAP_MAXDIMESIZE (8*1048576) /* 8 MB */ +#endif + +/* SOAP_MAXINFLATESIZE: Trusted inflated content size. + Larger content is subject to the SOAP_MINDEFLATERATIO constraint. + If SOAP_MINDEFLATERATIO is 1.0, SOAP_MAXINFLATESIZE is always the max + size of uncompressed content. +*/ +#ifndef SOAP_MAXINFLATESIZE +# define SOAP_MAXINFLATESIZE (1*1048576) /* 1 MB */ +#endif + +/* SOAP_MINDEFLATERATIO: Trusted deflation ratio after SOAP_MAXINFLATESIZE is reached. + Trust when compressed / deflated > SOAP_MINDEFLATERATIO + Sets a ratio > 0.00096899224806 (1032:1) + According to the zlib site: the limit (1032:1) comes from the fact that one + length/distance pair can represent at most 258 output bytes. A length + requires at least one bit and a distance requires at least one bit, so two + bits in can give 258 bytes out, or eight bits in give 1032 bytes out. A + dynamic block has no length restriction, so you could get arbitrarily close + to the limit of 1032:1. +*/ +#ifndef SOAP_MINDEFLATERATIO +# define SOAP_MINDEFLATERATIO (1.0/1032.0) /* ratio of deflated/inflated */ +#endif + +/* maximum XML nesting depth level allowed for inbound XML parsing, must be greater than zero (0) */ +#ifndef SOAP_MAXLEVEL +# define SOAP_MAXLEVEL (10000) +#endif + +/* maximum string content length if not already constrained by XML schema validation maxLength constraints, zero or negative means unlimited string lengths are allowed unless restricted by XML schema maxLength */ +#ifndef SOAP_MAXLENGTH +# define SOAP_MAXLENGTH (0) +#endif + +/* maximum number of array or container elements, must be greater than zero (0) */ +#ifndef SOAP_MAXOCCURS +# define SOAP_MAXOCCURS (100000) +#endif + +#ifdef VXWORKS +# ifdef WMW_RPM_IO +# include "httpLib.h" +# endif +# ifdef __INCmathh +# include +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +# ifndef soap_isnan +# define soap_isnan(num) isNan(num) +# endif +# endif +# ifdef WM_SECURE_KEY_STORAGE +# include +# endif +#endif + +#ifdef WIN32 +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +# define soap_isnan(n) _isnan(n) +# ifndef HAVE_ISINF +# define HAVE_ISINF +# endif +# define soap_isinf(n) (!_finite(n)) +#endif + +#ifdef SUN_OS +# define HAVE_ISNAN +#endif + +#ifdef __APPLE__ +# ifndef HAVE_ISNAN +# define HAVE_ISNAN +# endif +# ifndef HAVE_ISINF +# define HAVE_ISINF +# endif +#endif + +#if !defined(HAVE_ISNAN) && (defined(_MATH_H) || defined(_MATH_INCLUDED)) +# define HAVE_ISNAN +#endif + +union soap_double_nan {struct {unsigned int n1, n2;} iv; double dv; float fv;}; +extern const union soap_double_nan soap_double_nan; +extern const char soap_base64o[], soap_base64i[]; + +#ifdef VXWORKS +# ifndef FLT_MAX +# define FLT_MAX _ARCH_FLT_MAX +# endif +# ifndef DBL_MAX +# define DBL_MAX _ARCH_DBL_MAX +# endif +#endif + +#ifndef FLT_NAN +# define FLT_NAN (soap_double_nan.fv) +#endif + +#ifndef FLT_PINFTY +# if defined(INFINITY) +# define FLT_PINFTY INFINITY +# elif defined(FLT_MAX) +# define FLT_PINFTY FLT_MAX +# elif defined(HUGE_VALF) +# define FLT_PINFTY (float)HUGE_VALF +# elif defined(HUGE_VAL) +# define FLT_PINFTY (float)HUGE_VAL +# elif defined(FLOAT_MAX) +# define FLT_PINFTY FLOAT_MAX +# else +# define FLT_PINFTY (3.40282347e+38F) +# endif +#endif + +#ifndef FLT_NINFTY +# define FLT_NINFTY (-FLT_PINFTY) +#endif + +#ifndef DBL_NAN +# define DBL_NAN (soap_double_nan.dv) +#endif + +#ifndef DBL_PINFTY +# if defined(INFINITY) +# define DBL_PINFTY INFINITY +# elif defined(DBL_MAX) +# define DBL_PINFTY DBL_MAX +# elif defined(HUGE_VALF) +# define DBL_PINFTY (double)HUGE_VALF +# elif defined(HUGE_VAL) +# define DBL_PINFTY (double)HUGE_VAL +# elif defined(DOUBLE_MAX) +# define DBL_PINFTY DOUBLE_MAX +# else +# define DBL_PINFTY (1.7976931348623157e+308) +# endif +#endif + +#ifndef DBL_NINFTY +# define DBL_NINFTY (-DBL_PINFTY) +#endif + +#ifndef soap_isnan +# ifdef HAVE_ISNAN +# define soap_isnan(n) isnan(n) +# else +# define soap_isnan(n) ((n) != (n)) +# endif +#endif + +#ifndef soap_isinf +# ifdef HAVE_ISINF +# define soap_isinf(n) isinf(n) +# else +# define soap_isinf(n) (!soap_isnan(n) && soap_isnan((n) - (n))) +# endif +#endif + +#define soap_ispinfd(n) ((n) > 0 && soap_isinf(n)) +#define soap_ispinff(n) ((n) > 0 && soap_isinf(n)) +#define soap_isninfd(n) ((n) < 0 && soap_isinf(n)) +#define soap_isninff(n) ((n) < 0 && soap_isinf(n)) + +/* Safer str & mem functions */ + +/* The gSOAP code uses guards to ensure that these functions are well behaved + and do not raise errors. Therefore, the WIN _s functions should never + execute the "invalid parameter handler". +*/ + +/* use safer snprintf if possible or guard sprintf against overrun (assumes no variadic macros) */ +# ifdef HAVE_SNPRINTF +# if _MSC_VER >= 1400 +# define SOAP_SNPRINTF(buf, len, num) void)_snprintf_s((buf), (len), _TRUNCATE +# define SOAP_SNPRINTF_SAFE(buf, len) void)_snprintf_s((buf), (len), _TRUNCATE +# else +# define SOAP_SNPRINTF(buf, len, num) void)snprintf((buf), (len) +# define SOAP_SNPRINTF_SAFE(buf, len) void)snprintf((buf), (len) +# endif +# else +# define SOAP_SNPRINTF(buf, len, num) (len) <= (num)) ? (void)((buf)[0] = '\0') : (void)sprintf((buf) +# define SOAP_SNPRINTF_SAFE(buf, len) void)sprintf((buf) +# endif + +/* copy string (truncating the result, strings must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_strcpy(buf, len, src) (void)strncpy_s((buf), (len), (src), _TRUNCATE) +#elif defined(HAVE_STRLCPY) +# define soap_strcpy(buf, len, src) (void)strlcpy((buf), (src), (len)) +#else +# define soap_strcpy(buf, len, src) (void)(strncpy((buf), (src), (len)), (buf)[(len) - 1] = '\0') +#endif + +/* concat string (truncating the result, strings must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_strcat(buf, len, src) (void)strncat_s((buf), (len), (src), _TRUNCATE) +#elif defined(HAVE_STRLCAT) +# define soap_strcat(buf, len, src) (void)strlcat((buf), (src), (len)) +#else +SOAP_FMAC1 void SOAP_FMAC2 soap_strcat(char *buf, size_t len, const char *src); +#endif + +/* copy string up to num chars (sets string to empty on overrun and returns nonzero, zero if OK) */ +#if _MSC_VER >= 1400 +# define soap_strncpy(buf, len, src, num) ((buf) == NULL || ((size_t)(len) > (size_t)(num) ? strncpy_s((buf), (len), (src), (num)) : ((buf)[0] = '\0', 1))) +#else +# define soap_strncpy(buf, len, src, num) ((buf) == NULL || ((size_t)(len) > (size_t)(num) ? (strncpy((buf), (src), (num)), (buf)[(size_t)(num)] = '\0') : ((buf)[0] = '\0', 1))) +#endif + +/* concat string up to n chars (leaves destination intact on overrun and returns nonzero, zero if OK) */ +#if _MSC_VER >= 1400 +# define soap_strncat(buf, len, src, num) ((buf) == NULL || ((size_t)(len) > strlen((buf)) + (size_t)(num) ? strncat_s((buf), (len), (src), (num)) : 1)) +#else +SOAP_FMAC1 int SOAP_FMAC2 soap_strncat(char *buf, size_t len, const char *src, size_t num); +#endif + +/* copy memory (returns SOAP_ERANGE on overrun, zero if OK, pointers must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_memcpy(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? memcpy_s((buf), (len), (src), (num)) : SOAP_ERANGE) +#else +# define soap_memcpy(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? !memcpy((buf), (src), (num)) : SOAP_ERANGE) +#endif + +/* move memory (returns SOAP_ERANGE on overrun, zero if OK, pointers must not be NULL) */ +#if _MSC_VER >= 1400 +# define soap_memmove(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? memmove_s((buf), (len), (src), (num)) : SOAP_ERANGE) +#else +# define soap_memmove(buf, len, src, num) ((size_t)(len) >= (size_t)(num) ? !memmove((buf), (src), (num)) : SOAP_ERANGE) +#endif + +/* gSOAP status and error codes */ + +typedef soap_int32 soap_status; + +#define SOAP_EOF EOF +#define SOAP_OK 0 +#define SOAP_CLI_FAULT 1 +#define SOAP_SVR_FAULT 2 +#define SOAP_TAG_MISMATCH 3 +#define SOAP_TYPE 4 +#define SOAP_SYNTAX_ERROR 5 +#define SOAP_NO_TAG 6 +#define SOAP_IOB 7 +#define SOAP_MUSTUNDERSTAND 8 +#define SOAP_NAMESPACE 9 +#define SOAP_USER_ERROR 10 +#define SOAP_FATAL_ERROR 11 /* deprecated */ +#define SOAP_FAULT 12 +#define SOAP_NO_METHOD 13 +#define SOAP_NO_DATA 14 +#define SOAP_GET_METHOD 15 +#define SOAP_PUT_METHOD 16 +#define SOAP_PATCH_METHOD 17 +#define SOAP_DEL_METHOD 18 +#define SOAP_HTTP_METHOD 19 +#define SOAP_EOM 20 +#define SOAP_MOE 21 +#define SOAP_HDR 22 +#define SOAP_NULL 23 +#define SOAP_DUPLICATE_ID 24 +#define SOAP_MISSING_ID 25 +#define SOAP_HREF 26 +#define SOAP_UDP_ERROR 27 +#define SOAP_TCP_ERROR 28 +#define SOAP_HTTP_ERROR 29 +#define SOAP_SSL_ERROR 30 +#define SOAP_ZLIB_ERROR 31 +#define SOAP_DIME_ERROR 32 +#define SOAP_DIME_HREF 33 +#define SOAP_DIME_MISMATCH 34 +#define SOAP_DIME_END 35 +#define SOAP_MIME_ERROR 36 +#define SOAP_MIME_HREF 37 +#define SOAP_MIME_END 38 +#define SOAP_VERSIONMISMATCH 39 +#define SOAP_PLUGIN_ERROR 40 +#define SOAP_DATAENCODINGUNKNOWN 41 /* unused */ +#define SOAP_REQUIRED 42 +#define SOAP_PROHIBITED 43 +#define SOAP_OCCURS 44 +#define SOAP_LENGTH 45 +#define SOAP_PATTERN 46 +#define SOAP_FD_EXCEEDED 47 +#define SOAP_UTF_ERROR 48 +#define SOAP_NTLM_ERROR 49 +#define SOAP_LEVEL 50 +#define SOAP_FIXED 51 +#define SOAP_EMPTY 52 +#define SOAP_END_TAG 53 +#define SOAP_ERR 99 + +#define soap_xml_error_check(e) \ + ((e) == SOAP_TAG_MISMATCH || \ + (e) == SOAP_NO_TAG || \ + (e) == SOAP_IOB || \ + (e) == SOAP_SYNTAX_ERROR || \ + (e) == SOAP_NAMESPACE || \ + (e) == SOAP_TYPE || \ + (e) == SOAP_DUPLICATE_ID || \ + (e) == SOAP_MISSING_ID || \ + (e) == SOAP_REQUIRED || \ + (e) == SOAP_PROHIBITED || \ + (e) == SOAP_OCCURS || \ + (e) == SOAP_LENGTH || \ + (e) == SOAP_LEVEL || \ + (e) == SOAP_PATTERN || \ + (e) == SOAP_NULL || \ + (e) == SOAP_HREF || \ + (e) == SOAP_FIXED || \ + (e) == SOAP_EMPTY || \ + (e) == SOAP_END_TAG || \ + (e) == SOAP_UTF_ERROR) + +#define soap_soap_error_check(e) \ + ((e) == SOAP_CLI_FAULT || \ + (e) == SOAP_SVR_FAULT || \ + (e) == SOAP_VERSIONMISMATCH || \ + (e) == SOAP_MUSTUNDERSTAND || \ + (e) == SOAP_FAULT || \ + (e) == SOAP_NO_METHOD || \ + (e) == SOAP_DATAENCODINGUNKNOWN) + +#define soap_http_error_check(e) \ + ((e) == SOAP_HTTP_ERROR || \ + (e) == SOAP_NO_DATA || \ + ((e) >= SOAP_GET_METHOD && (e) <= SOAP_HTTP_METHOD) || \ + ((e) >= 100 && (e) < 600)) + +#define soap_dime_error_check(e) \ + ((e) == SOAP_DIME_ERROR || \ + (e) == SOAP_DIME_HREF || \ + (e) == SOAP_DIME_MISMATCH || \ + (e) == SOAP_DIME_END) + +#define soap_mime_error_check(e) \ + ((e) == SOAP_MIME_ERROR || \ + (e) == SOAP_MIME_HREF || \ + (e) == SOAP_MIME_END) + +#define soap_tcp_error_check(e) \ + ((e) == SOAP_EOF || \ + (e) == SOAP_TCP_ERROR) + +#define soap_udp_error_check(e) \ + ((e) == SOAP_EOF || \ + (e) == SOAP_UDP_ERROR) + +#define soap_ssl_error_check(e) ((e) == SOAP_SSL_ERROR) + +#define soap_zlib_error_check(e) ((e) == SOAP_ZLIB_ERROR) + +/* gSOAP HTTP response status codes 100 to 599 are reserved */ + +/* Codes 600 to 999 are user definable */ + +/* Exceptional gSOAP HTTP server response status codes >= 1000 */ + +#define SOAP_STOP 1000 /* No HTTP response should follow after SOAP_STOP is issued */ +#define SOAP_FORM 1001 /* Request (form) data is present, no HTTP response should follow */ +#define SOAP_HTML 1002 /* Custom HTML response */ +#define SOAP_FILE 1200 /* Custom file-based response with soap::http_content and optional http status */ + +/* gSOAP HTTP method codes (client) */ + +typedef int soap_http_command; + +#define SOAP_POST 2000 /* POST request */ +#define SOAP_POST_FILE 2001 /* Custom file-based POST request */ +#define SOAP_GET 2002 /* GET request */ +#define SOAP_PUT 2003 /* PUT request */ +#define SOAP_PATCH 2004 /* PATCH request */ +#define SOAP_DEL 2005 /* DELETE request */ +#define SOAP_HEAD 2006 /* HEAD request */ +#define SOAP_OPTIONS 2007 /* OPTIONS request */ +#define SOAP_CONNECT 2008 /* CONNECT request */ + +/* gSOAP DIME */ + +#define SOAP_DIME_CF 0x01 +#define SOAP_DIME_ME 0x02 +#define SOAP_DIME_MB 0x04 +#define SOAP_DIME_VERSION 0x08 /* DIME version 1 */ +#define SOAP_DIME_MEDIA 0x10 +#define SOAP_DIME_ABSURI 0x20 + +/* gSOAP ZLIB */ + +#define SOAP_ZLIB_NONE 0x00 +#define SOAP_ZLIB_DEFLATE 0x01 +#define SOAP_ZLIB_INFLATE 0x02 +#define SOAP_ZLIB_GZIP 0x02 + +/* gSOAP transport, connection, and content encoding modes */ + +typedef soap_int32 soap_mode; + +#define SOAP_IO 0x00000003 /* IO mask */ +#define SOAP_IO_FLUSH 0x00000000 /* out: flush output immediately, no buffering */ +#define SOAP_IO_BUFFER 0x00000001 /* out: buffer output in packets of size SOAP_BUFLEN */ +#define SOAP_IO_STORE 0x00000002 /* out: store entire output to determine length for transport */ +#define SOAP_IO_CHUNK 0x00000003 /* out: use HTTP chunked transfer AND buffer packets */ + +#define SOAP_IO_UDP 0x00000004 /* in/out: enable UDP instead of TCP */ +#define SOAP_IO_LENGTH 0x00000008 /* out: calc message length (internal) */ +#define SOAP_IO_KEEPALIVE 0x00000010 /* out: keep connection alive */ + +#define SOAP_ENC 0x00000FFF /* IO and ENC mask */ +#define SOAP_ENC_LATIN 0x00000020 /* in: accept iso-8859-1 */ +#define SOAP_ENC_PLAIN 0x00000040 /* out: plain (XML or other) body, no HTTP header */ +#define SOAP_ENC_XML 0x00000040 /* deprecated, alias for SOAP_ENC_PLAIN */ +#define SOAP_ENC_DIME 0x00000080 +#define SOAP_ENC_MIME 0x00000100 +#define SOAP_ENC_MTOM 0x00000200 +#define SOAP_ENC_ZLIB 0x00000400 +#define SOAP_ENC_SSL 0x00000800 + +#define SOAP_XML_STRICT 0x00001000 /* in: strict validation */ +#define SOAP_XML_INDENT 0x00002000 /* out: emit indented XML */ +#define SOAP_XML_IGNORENS 0x00004000 /* in: ignore namespaces */ +#define SOAP_XML_DEFAULTNS 0x00008000 /* out: emit xmlns="..." */ +#define SOAP_XML_CANONICAL 0x00010000 /* out: exc-C14N exclusive canonical XML */ +#define SOAP_XML_TREE 0x00020000 /* in/out: XML tree (no id/ref) */ +#define SOAP_XML_NIL 0x00040000 /* out: all NULLs as xsi:nil */ +#define SOAP_XML_NOTYPE 0x00080000 /* out: do not add xsi:type */ + +#define SOAP_DOM_TREE 0x00100000 /* see DOM manual */ +#define SOAP_DOM_NODE 0x00200000 +#define SOAP_DOM_ASIS 0x00400000 + +#define SOAP_XML_CANONICAL_NA 0x00800000 /* out: (exc) C14N not QName aware */ + +#define SOAP_C_NOIOB 0x01000000 /* don't fault on array index out of bounds (just ignore) */ +#define SOAP_C_UTFSTRING 0x02000000 /* (de)serialize strings with UTF8 content */ +#define SOAP_C_MBSTRING 0x04000000 /* (de)serialize strings with multi-byte content */ +#define SOAP_C_NILSTRING 0x08000000 /* serialize empty strings as nil (omitted) */ + +#define SOAP_XML_DOM 0x10000000 /* enable internal DOM */ +#define SOAP_XML_GRAPH 0x20000000 /* force id-ref XML graph */ + +#define SOAP_MIME_POSTCHECK 0x40000000 /* MIME flag (internal) */ + +#define SOAP_SEC_WSUID 0x80000000 /* Add Body wsu:Id flag (internal) */ + +/* WITH_XMLNS backward compatibility: always use XML default namespaces */ +#ifdef WITH_XMLNS +# define SOAP_IO_DEFAULT (SOAP_IO_FLUSH | SOAP_XML_DEFAULTNS) +#else +# define SOAP_IO_DEFAULT SOAP_IO_FLUSH +#endif + +/* SSL client/server authentication settings */ + +#define SOAP_SSL_NO_AUTHENTICATION (0x0000) /* no authentication */ +#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION (0x0001) /* client requires server to authenticate */ +#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION (0x0002) /* server requires client to authenticate */ +#define SOAP_SSL_SKIP_HOST_CHECK (0x0004) /* client skips common name check against host name */ +#define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE (0x0008) /* allow self-signed and expired certificates and those w/o CRL */ +#define SOAP_SSL_NO_DEFAULT_CA_PATH (0x0010) /* don't use SSL_CTX_set_default_verify_paths */ +#define SOAP_SSL_RSA (0x0020) /* use RSA */ +#define SOAP_SSLv3 (0x0080) /* enable SSL v3 */ +#define SOAP_TLSv1_0 (0x0100) /* enable TLS v1.0 */ +#define SOAP_TLSv1_1 (0x0200) /* enable TLS v1.1 */ +#define SOAP_TLSv1_2 (0x0400) /* enable TLS v1.2 */ +#define SOAP_TLSv1_3 (0x0800) /* enable TLS v1.3 */ +#define SOAP_TLSv1 (SOAP_TLSv1_0 | SOAP_TLSv1_1 | SOAP_TLSv1_2 | SOAP_TLSv1_3) +#define SOAP_SSLv3_TLSv1 (SOAP_SSLv3 | SOAP_TLSv1) + +#define SOAP_SSL_CLIENT (0x8000) /* client context flag for internal use */ + +#define SOAP_SSL_DEFAULT SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION + +typedef unsigned short soap_ssl_flags; + +/* state */ + +#define SOAP_NONE 0 +#define SOAP_INIT 1 +#define SOAP_COPY 2 + +#define soap_check_state(soap) (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY)) + +/* parts */ + +#define SOAP_END 0 +#define SOAP_BEGIN_SEND 1 +#define SOAP_BEGIN_RECV 2 +#define SOAP_IN_ENVELOPE 3 +#define SOAP_IN_HEADER 4 +#define SOAP_END_HEADER 5 +#define SOAP_NO_BODY 6 +#define SOAP_IN_BODY 7 +#define SOAP_END_BODY 8 +#define SOAP_END_ENVELOPE 9 + +/* events */ + +#define SOAP_SEC_BEGIN 1 +#define SOAP_SEC_SIGN 2 +#define SOAP_SEC_DECRYPT 3 + +/* DEBUG macros */ + +#ifdef DEBUG_STAMP +# ifndef DEBUG +# define DEBUG +# endif +#endif + +#ifdef DEBUG +# ifndef SOAP_DEBUG +# define SOAP_DEBUG +# endif +# ifndef SOAP_MEM_DEBUG +# define SOAP_MEM_DEBUG +# endif +#endif + +#ifdef SOAP_MEM_DEBUG +# ifndef SOAP_MALLOC +# define SOAP_MALLOC(soap, size) soap_track_malloc((soap), __FILE__, __LINE__, (size)) +# endif +# ifndef SOAP_FREE +# define SOAP_FREE(soap, ptr) soap_track_free((soap), __FILE__, __LINE__, (void*)(ptr)) +# endif +#endif + +#ifndef SOAP_MALLOC /* use libc malloc */ +# define SOAP_MALLOC(soap, size) malloc((size)) +#endif + +#ifndef SOAP_FREE /* use libc free */ +# define SOAP_FREE(soap, ptr) free((void*)(ptr)) +#endif + +#ifndef SOAP_MALLOC_UNMANAGED /* use libc malloc to alloc soap context with soap_new() */ +# define SOAP_MALLOC_UNMANAGED(size) malloc((size)) +#endif + +#ifndef SOAP_FREE_UNMANAGED /* use libc free to free soap context with soap_free() */ +# define SOAP_FREE_UNMANAGED(ptr) free((void*)(ptr)) +#endif + +#ifndef SOAP_NOTHROW +# if defined(__GNUC__) && (__GNUC__ <= 2) +# define SOAP_NOTHROW +# elif defined(WITH_LEAN) || defined(WITH_COMPAT) +# define SOAP_NOTHROW +# else +# define SOAP_NOTHROW (std::nothrow) +# endif +#endif + +#if defined(__BORLANDC__) && !defined(__clang__) +/* Embarcadero Classic compiler special case */ +# ifndef SOAP_NEW +# define SOAP_NEW(soap, type) new SOAP_NOTHROW (type) +# endif +# ifndef SOAP_NEW_ARRAY +# define SOAP_NEW_ARRAY(soap, type, n) new SOAP_NOTHROW (type[n]) +# endif +# ifndef SOAP_PLACEMENT_NEW +# define SOAP_PLACEMENT_NEW(soap, buf, type) new (buf) (type) +# endif +#elif (defined(__GNUC__) && (__GNUC__ <= 2)) || defined(__clang__) || defined(_AIX) || defined(AIX) +/* old form w/o parenthesis, soap context may be NULL */ +# ifndef SOAP_NEW +# define SOAP_NEW(soap, type) new SOAP_NOTHROW type +# endif +# ifndef SOAP_NEW_ARRAY +# define SOAP_NEW_ARRAY(soap, type, n) new SOAP_NOTHROW type[n] +# endif +# ifndef SOAP_PLACEMENT_NEW +# define SOAP_PLACEMENT_NEW(soap, buf, type) new (buf) type +# endif +#else +/* new form with parenthesis for (type) but not type[n], soap context may be NULL */ +# ifndef SOAP_NEW +# define SOAP_NEW(soap, type) new SOAP_NOTHROW (type) +# endif +# ifndef SOAP_NEW_ARRAY +# define SOAP_NEW_ARRAY(soap, type, n) new SOAP_NOTHROW type[n] +# endif +# ifndef SOAP_PLACEMENT_NEW +# define SOAP_PLACEMENT_NEW(soap, buf, type) new (buf) (type) +# endif +#endif + +#ifndef SOAP_DELETE /* use C++ delete operator, soap context may be NULL */ +# define SOAP_DELETE(soap, obj, type) delete obj +#endif + +#ifndef SOAP_DELETE_ARRAY /* use C++ delete[] operator, soap context may be NULL */ +# define SOAP_DELETE_ARRAY(soap, obj, type) delete[] obj +#endif + +#ifndef SOAP_NEW_UNMANAGED /* use C++ unmanaged new operator for soap_new() and soap::copy() */ +# define SOAP_NEW_UNMANAGED(soap) new SOAP_NOTHROW soap +#endif + +#ifndef SOAP_DELETE_UNMANAGED /* use C++ unmanaged delete operator for soap_free() */ +# define SOAP_DELETE_UNMANAGED(soap) delete soap +#endif + +#ifdef SOAP_DEBUG +# ifndef SOAP_MESSAGE +# define SOAP_MESSAGE fprintf +# endif +# ifndef DBGLOG +# ifdef DEBUG_STAMP +# ifdef WIN32 +# define DBGLOG(DBGFILE, CMD) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ + SYSTEMTIME _localTime;\ + ::GetLocalTime(&_localTime); \ + fprintf(fdebug, "%02d%02d%02d %02d:%02d:%02d.%03d|", (int)_localTime.wYear%100, (int)_localTime.wMonth, (int)_localTime.wDay, (int)_localTime.wHour, (int)_localTime.wMinute, (int)_localTime.wSecond, (int)_localTime.wMilliseconds);\ + CMD;\ + fflush(fdebug);\ + }\ + }\ +} +# else +# define DBGLOG(DBGFILE, CMD) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ + struct timeval _tv;\ + struct tm _tm;\ + gettimeofday(&_tv, NULL);\ + localtime_r(&_tv.tv_sec, &_tm);\ + fprintf(fdebug, "%02d%02d%02d %02d:%02d:%02d.%06ld|", (int)_tm.tm_year%100, (int)_tm.tm_mon+1, (int)_tm.tm_mday, (int)_tm.tm_hour, (int)_tm.tm_min, (int)_tm.tm_sec, (long)_tv.tv_usec);\ + CMD;\ + fflush(fdebug);\ + }\ + }\ +} +# endif +# else +# define DBGLOG(DBGFILE, CMD) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { FILE *fdebug = soap->fdebug[SOAP_INDEX_##DBGFILE];\ + CMD;\ + fflush(fdebug);\ + }\ + }\ +} +# endif +# endif +# ifndef DBGMSG +# define DBGMSG(DBGFILE, MSG, LEN) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile((struct soap*)soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { fwrite((void*)(MSG), 1, (size_t)(LEN), soap->fdebug[SOAP_INDEX_##DBGFILE]);\ + fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ + }\ + }\ +} +# endif +# ifndef DBGFUN +# define DBGFUN(FNAME) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s()\n", __FILE__, __LINE__, FNAME)) +# define DBGFUN1(FNAME, FMT, ARG) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT ")\n", __FILE__, __LINE__, FNAME, (ARG))) +# define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT1 ", " FMT2 ")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2))) +# define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT1 ", " FMT2 ", " FMT3 ")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2), (ARG3))) +# define DBGFUN4(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3, FMT4, ARG4) DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%s(%d): %s(" FMT1 ", " FMT2 ", " FMT3 ", " FMT4 ")\n", __FILE__, __LINE__, FNAME, (ARG1), (ARG2), (ARG3), (ARG4))) +# endif +# ifndef DBGHEX +# define DBGHEX(DBGFILE, MSG, LEN) \ +{ if (soap)\ + { if (!soap->fdebug[SOAP_INDEX_##DBGFILE])\ + soap_open_logfile(soap, SOAP_INDEX_##DBGFILE);\ + if (soap->fdebug[SOAP_INDEX_##DBGFILE])\ + { int i; char *s;\ + for (s = (char*)(MSG), i = (LEN); i; i--)\ + fprintf(soap->fdebug[SOAP_INDEX_##DBGFILE], "%2.2X ", (int)*s++&0xFF);\ + fflush(soap->fdebug[SOAP_INDEX_##DBGFILE]);\ + }\ + }\ +} +# endif +#else +# define DBGLOG(DBGFILE, CMD) +# define DBGMSG(DBGFILE, MSG, LEN) +# define DBGFUN(FNAME) +# define DBGFUN1(FNAME, FMT, ARG) +# define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2) +# define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3) +# define DBGFUN4(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3, FMT4, ARG4) +# define DBGHEX(DBGFILE, MSG, LEN) +#endif + +/* UCS-4 requires 32 bits (0-7FFFFFFF, the sign bit is used by gSOAP to distinguish XML entities) */ +typedef soap_int32 soap_wchar; + +/* forward declaration */ +struct SOAP_CMAC soap; + +/* namespace table row */ +struct SOAP_CMAC Namespace +{ + const char *id; + const char *ns; + const char *in; + char *out; +}; + +/* namespace stack */ +struct soap_nlist +{ + struct soap_nlist *next; + unsigned int level; /* nesting depth level */ + short index; /* corresponding entry in ns mapping table */ + const char *ns; /* only set when parsed ns URI is not in the ns mapping table */ + char id[1]; /* the actual string value flows into the allocated region id[0...] below this struct */ +}; + +/* block header, the data flows into the allocated region below this struct */ +struct soap_bhead +{ + struct soap_bhead *next; + size_t size; +}; + +/* block stack for nested block allocations */ +struct soap_blist +{ + struct soap_blist *next; + struct soap_bhead *head; + size_t size; + size_t item; +}; + +/* pointer serialization management */ +struct soap_plist +{ + struct soap_plist *next; + const void *ptr; + void *dup; + const void *array; /* array pointer */ + int size; /* array size */ + int type; + int id; + char mark1; /* 0=single-ref, 1=embedded-multi-ref (SOAP1.1), 2=multi-ref, 3=attachment */ + char mark2; +}; + +/* block allocation for pointer serialization management */ +struct soap_pblk +{ + struct soap_pblk *next; + struct soap_plist plist[SOAP_PTRBLK]; +}; + +#ifdef SOAP_MEM_DEBUG +/* malloc/free tracking for debugging */ +struct soap_mlist +{ + struct soap_mlist *next; + const void *ptr; + const char *file; + int line; + short live; +}; +#endif + +/* class allocation list */ +struct soap_clist +{ + struct soap_clist *next; + void *ptr; + int type; + int size; /* array size */ + int (*fdelete)(struct soap*, struct soap_clist*); +}; + +/* attributes */ +struct soap_attribute +{ + struct soap_attribute *next; + short flag; /* soap_set_attr: 1 = normal, 2 = utf content */ + char *value; + size_t size; + const char *ns; + short visible; + char name[1]; /* the actual name string flows into the allocated region below this struct */ +}; + +#if !defined(WITH_LEAN) || defined(WITH_COOKIES) +struct soap_cookie +{ + struct soap_cookie *next; + char *name; + char *value; + char *domain; + char *path; + ULONG64 expire; /* client-side: local time to expire (value cast to time_t) */ + long maxage; /* server-side: seconds to expire */ + unsigned int version; + short secure; + short session; /* server-side */ + short env; /* server-side: got cookie from client and should not be (re)send */ + short modified; /* server-side: client cookie was modified and should be send */ +}; +#endif + +SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_next_multipart(struct soap_multipart*); + +#ifdef __cplusplus + +class soap_multipart_iterator +{ + public: + struct soap_multipart *content; + bool operator==(const soap_multipart_iterator& iter) const + { return (bool)(content == iter.content); } + bool operator!=(const soap_multipart_iterator& iter) const + { return (bool)(content != iter.content); } + struct soap_multipart& operator*() const + { return *content; } + struct soap_multipart *operator->() const + { return content; } + soap_multipart_iterator& operator++() + { content = soap_next_multipart(content); return *this; } + soap_multipart_iterator operator++(int) + { soap_multipart_iterator iter(*this); content = soap_next_multipart(content); return iter; } + soap_multipart_iterator() : content(NULL) + { } + soap_multipart_iterator(struct soap_multipart *p) : content(p) + { } +}; + +#endif + +#ifndef WITH_LEANER +struct soap_dime +{ + size_t count; + size_t size; + size_t chunksize; + size_t buflen; + char flags; + char *ptr; + const char *id; + const char *type; + const char *options; + struct soap_multipart *list; /* list of DIME attachments received */ + struct soap_multipart *first, *last; /* temporary in/out queue */ +#ifdef __cplusplus + soap_multipart_iterator begin() + { soap_multipart_iterator iter(list); return iter; }; + soap_multipart_iterator end() + { soap_multipart_iterator iter(NULL); return iter; }; +#endif +}; +#endif + +#ifndef WITH_LEANER +struct soap_mime +{ + char *boundary; /* MIME boundary */ + const char *start; /* MIME start ID */ + struct soap_multipart *list; /* list of MIME attachments received */ + struct soap_multipart *first, *last; /* temporary in/out queue */ +#ifdef __cplusplus + soap_multipart_iterator begin() + { soap_multipart_iterator iter(list); return iter; }; + soap_multipart_iterator end() + { soap_multipart_iterator iter(NULL); return iter; }; +#endif +}; +#endif + +#ifndef WITH_LEANER +/* RFC2045 MIME content transfer encodings */ +enum soap_mime_encoding +{ + SOAP_MIME_NONE, + SOAP_MIME_7BIT, + SOAP_MIME_8BIT, + SOAP_MIME_BINARY, + SOAP_MIME_QUOTED_PRINTABLE, + SOAP_MIME_BASE64, + SOAP_MIME_IETF_TOKEN, + SOAP_MIME_X_TOKEN +}; +#endif + +#ifndef WITH_LEANER +/* DIME/MIME multipart list */ +struct soap_multipart +{ + struct soap_multipart *next; + const char *ptr; /* points to raw data content */ + size_t size; /* size of data content */ + const char *id; /* DIME/MIME content ID or form data name */ + const char *type; /* DIME/MIME type (MIME type format) */ + const char *options; /* DIME options */ + enum soap_mime_encoding encoding; /* MIME Content-Transfer-Encoding */ + const char *location; /* MIME Content-Location (optional) */ + const char *description; /* MIME Content-Description (optional) */ +#ifdef __cplusplus + typedef soap_multipart_iterator iterator; +#endif +}; +#endif + +#ifndef WITH_LEANER +/* attachment DIME and MTOM XOP forwarding */ +struct soap_xlist +{ + struct soap_xlist *next; + unsigned char **ptr; + int *size; + char *id; + char **type; + char **options; +}; +#endif + +/******************************************************************************/ + +#ifndef WITH_LEANER + +/* dom.c[pp] functions (optional, compile and link dom.c[pp] */ +struct SOAP_CMAC soap_dom_element; +struct SOAP_CMAC soap_dom_attribute; + +/* soap_dom_element construction */ + +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_new(struct soap *soap, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_new_w(struct soap *soap, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_set(struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_set_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag); + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att(struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt(struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth_elt(struct soap_dom_element *elt, const char *ns, const char *tag, size_t n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth_elt_w(struct soap_dom_element *elt, const char *ns, const wchar_t *tag, size_t n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_nth(struct soap_dom_element *elt, size_t n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_att(struct soap_dom_element *elt, const struct soap_dom_attribute *node); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_elt(struct soap_dom_element *elt, const struct soap_dom_element *node); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_atts(struct soap_dom_element *elt, const struct soap_dom_attribute *atts); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_add_elts(struct soap_dom_element *elt, const struct soap_dom_element *elts); + +/* soap_dom_element assignment */ + +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_bool(struct soap_dom_element *elt, LONG64 b); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_int(struct soap_dom_element *elt, LONG64 n); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_double(struct soap_dom_element *elt, double x); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_text(struct soap_dom_element *elt, const char *text); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_text_w(struct soap_dom_element *elt, const wchar_t *text); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_node(struct soap_dom_element *elt, const void *node, int type); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_copy(struct soap_dom_element *elt, const struct soap_dom_element *node); + +/* soap_dom_element properties */ + +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_match(const struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_match_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *patt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_ns(const struct soap_dom_element *elt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_tag(const struct soap_dom_element *elt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_is_true(const struct soap_dom_element *elt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_is_false(const struct soap_dom_element *elt); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_get_int(const struct soap_dom_element *elt); +SOAP_FMAC1 long SOAP_FMAC2 soap_elt_get_long(const struct soap_dom_element *elt); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_elt_get_LONG64(const struct soap_dom_element *elt); +SOAP_FMAC1 double SOAP_FMAC2 soap_elt_get_double(const struct soap_dom_element *elt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_elt_get_text(const struct soap_dom_element *elt); +SOAP_FMAC1 const void * SOAP_FMAC2 soap_elt_get_node(const struct soap_dom_element *elt, int type); +SOAP_FMAC1 int SOAP_FMAC2 soap_elt_get_type(const struct soap_dom_element *elt, const void **node); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_parent(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_depth(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_index(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_len(const struct soap_dom_element *elt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_nth(const struct soap_dom_element *elt); + +/* soap_dom_attribute construction */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_new(struct soap *soap, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_new_w(struct soap *soap, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_set(struct soap_dom_attribute *att, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_set_w(struct soap_dom_attribute *att, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_add(struct soap_dom_attribute *att, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_add_w(struct soap_dom_attribute *att, const char *ns, const wchar_t *tag); + +/* soap_dom_attribute assignment */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_bool(struct soap_dom_attribute *att, LONG64 b); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_int(struct soap_dom_attribute *att, LONG64 n); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_double(struct soap_dom_attribute *att, double x); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_text(struct soap_dom_attribute *att, const char *text); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_text_w(struct soap_dom_attribute *att, const wchar_t *text); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_copy(struct soap_dom_attribute *att, const struct soap_dom_attribute *node); + +/* soap_dom_attribute properties */ + +SOAP_FMAC1 int SOAP_FMAC2 soap_att_match(const struct soap_dom_attribute *att, const char *ns, const char *patt); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_match_w(const struct soap_dom_attribute *att, const char *ns, const wchar_t *patt); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_ns(const struct soap_dom_attribute *att); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_tag(const struct soap_dom_attribute *att); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_is_true(const struct soap_dom_attribute *att); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_is_false(const struct soap_dom_attribute *att); +SOAP_FMAC1 int SOAP_FMAC2 soap_att_get_int(const struct soap_dom_attribute *att); +SOAP_FMAC1 long SOAP_FMAC2 soap_att_get_long(const struct soap_dom_attribute *att); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_att_get_LONG64(const struct soap_dom_attribute *att); +SOAP_FMAC1 double SOAP_FMAC2 soap_att_get_double(const struct soap_dom_attribute *att); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_att_get_text(const struct soap_dom_attribute *att); + +/* DOM local traversal */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_first(struct soap_dom_element *elt); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_next(const struct soap_dom_attribute *att); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_first(struct soap_dom_element *elt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_next(const struct soap_dom_element *elt); + +/* DOM local retrieval */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_get(const struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_get_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get(const struct soap_dom_element *elt, const char *ns, const char *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_w(const struct soap_dom_element *elt, const char *ns, const wchar_t *tag); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_next(const struct soap_dom_element *elt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_get_nth(struct soap_dom_element *elt, size_t n); + +/* DOM local search */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_find(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_att_find_next(const struct soap_dom_attribute *att, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_next(const struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_type(struct soap_dom_element *elt, const char *ns, const char *patt, int type); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_elt_find_next_type(const struct soap_dom_element *elt, const char *ns, const char *patt, int type); + +/* DOM size of local search results */ + +SOAP_FMAC1 size_t SOAP_FMAC2 soap_att_size(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_size(struct soap_dom_element *elt, const char *ns, const char *patt); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_elt_size_type(struct soap_dom_element *elt, const char *ns, const char *patt, int type); + +/* DOM deep traversal */ + +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dom_next_attribute(const struct soap_dom_attribute *att); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_next_element(const struct soap_dom_element *elt, const struct soap_dom_element *end); + +/* DOM deep search */ + +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_find(struct soap_dom_element *begin, const struct soap_dom_element *end, const char *ns, const char *patt, int type); +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dom_find_next(const struct soap_dom_element *elt, const struct soap_dom_element *end, const char *ns, const char *patt, int type); + +#endif + +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +#ifndef WITH_LEANER +#ifdef __cplusplus +class SOAP_CMAC soap_dom_attribute_iterator +{ + public: + struct soap_dom_attribute *iter; + const char *nstr; + const char *name; + bool operator==(const soap_dom_attribute_iterator&) const; + bool operator!=(const soap_dom_attribute_iterator&) const; + struct soap_dom_attribute& operator*() const; + struct soap_dom_attribute *operator->() const; + soap_dom_attribute_iterator& operator++(); + soap_dom_attribute_iterator operator++(int); + soap_dom_attribute_iterator(); + soap_dom_attribute_iterator(struct soap_dom_attribute*); + ~soap_dom_attribute_iterator(); +}; +#endif +#endif + +#ifndef WITH_LEANER +struct SOAP_CMAC soap_dom_attribute +{ + struct soap_dom_attribute *next; + const char *nstr; + const char *name; + const char *text; + struct soap *soap; +#ifdef __cplusplus + typedef soap_dom_attribute_iterator iterator; + soap_dom_attribute(struct soap *soap = NULL); + soap_dom_attribute(const soap_dom_attribute& att); + soap_dom_attribute(struct soap *soap, const char *tag); + soap_dom_attribute(struct soap *soap, const wchar_t *tag); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const char *text); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const wchar_t *text); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const char *text); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const wchar_t *text); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const std::string& text); + soap_dom_attribute(struct soap *soap, const char *ns, const char *tag, const std::wstring& text); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const std::string& text); + soap_dom_attribute(struct soap *soap, const char *ns, const wchar_t *tag, const std::wstring& text); + ~soap_dom_attribute(); + soap_dom_attribute& set(const char *ns, const char *tag) { return *soap_att_set(this, ns, tag); } + soap_dom_attribute& set(const char *ns, const wchar_t *tag) { return *soap_att_set_w(this, ns, tag); } + soap_dom_attribute& set(bool b) { return *soap_att_bool(this, b); } + soap_dom_attribute& set(int n) { return *soap_att_int(this, n); } + soap_dom_attribute& set(LONG64 n) { return *soap_att_int(this, n); } + soap_dom_attribute& set(float x) { return *soap_att_double(this, x); } + soap_dom_attribute& set(double x) { return *soap_att_double(this, x); } + soap_dom_attribute& set(const char *text) { return *soap_att_text(this, text); } + soap_dom_attribute& set(const wchar_t *text) { return *soap_att_text_w(this, text); } +#ifndef WITH_COMPAT + soap_dom_attribute& set(const std::string& text) { return *soap_att_text(this, text.c_str()); } + soap_dom_attribute& set(const std::wstring& text) { return *soap_att_text_w(this, text.c_str()); } +#endif + soap_dom_attribute& operator=(bool b) { return *soap_att_bool(this, b); } + soap_dom_attribute& operator=(int n) { return *soap_att_int(this, n); } + soap_dom_attribute& operator=(LONG64 n) { return *soap_att_int(this, n); } + soap_dom_attribute& operator=(float x) { return *soap_att_double(this, x); } + soap_dom_attribute& operator=(double x) { return *soap_att_double(this, x); } + soap_dom_attribute& operator=(const char *text) { return *soap_att_text(this, text); } + soap_dom_attribute& operator=(const wchar_t *text) { return *soap_att_text_w(this, text); } +#ifndef WITH_COMPAT + soap_dom_attribute& operator=(const std::string& text) { return *soap_att_text(this, text.c_str()); } + soap_dom_attribute& operator=(const std::wstring& text) { return *soap_att_text_w(this, text.c_str()); } +#endif + soap_dom_attribute& operator=(const soap_dom_attribute& att) { return *soap_att_copy(this, &att); } + soap_dom_attribute& att(const char *tag) { return *soap_att_add(this, NULL, tag); } + soap_dom_attribute& att(const wchar_t *tag) { return *soap_att_add_w(this, NULL, tag); } + soap_dom_attribute& att(const char *ns, const char *tag) { return *soap_att_add(this, ns, tag); } + soap_dom_attribute& att(const char *ns, const wchar_t *tag) { return *soap_att_add_w(this, ns, tag); } + bool match(const char *patt) const { return soap_att_match(this, NULL, patt) != 0; } + bool match(const wchar_t *patt) const { return soap_att_match_w(this, NULL, patt) != 0; } + bool match(const char *ns, const char *patt) const { return soap_att_match(this, ns, patt) != 0; } + bool match(const char *ns, const wchar_t *patt) const { return soap_att_match_w(this, ns, patt) != 0; } + const char *ns() const { return this->nstr; } + const char *tag() const { return this->name; } + bool is_true() const { return soap_att_is_true(this) != 0; } + bool is_false() const { return soap_att_is_false(this) != 0; } + LONG64 get_int() const { return soap_att_get_LONG64(this); } + double get_double() const { return soap_att_get_double(this); } + const char *get_text() const { return this->text; } + operator bool() const { return soap_att_is_true(this) != 0; } + operator int() const { return soap_att_get_int(this); } + operator LONG64() const { return soap_att_get_LONG64(this); } + operator double() const { return soap_att_get_double(this); } + operator const char*() const { return this->text; } + soap_dom_attribute_iterator att_begin() { return soap_dom_attribute_iterator(this); } + soap_dom_attribute_iterator att_end() { return soap_dom_attribute_iterator(NULL); } + soap_dom_attribute_iterator att_find(const char *patt) { return att_find(NULL, patt); } + soap_dom_attribute_iterator att_find(const wchar_t *patt) { return att_find(NULL, patt); } + soap_dom_attribute_iterator att_find(const char *ns, const char *patt); + soap_dom_attribute_iterator att_find(const char *ns, const wchar_t *patt); + void unlink(); +#endif +}; +#endif + +#ifndef WITH_LEANER +#ifdef __cplusplus +class SOAP_CMAC soap_dom_element_iterator +{ + public: + struct soap_dom_element *iter; + struct soap_dom_element *stop; + const char *nstr; + const char *name; + int type; + bool deep; + bool operator==(const soap_dom_element_iterator&) const; + bool operator!=(const soap_dom_element_iterator&) const; + struct soap_dom_element& operator*() const; + struct soap_dom_element *operator->() const; + soap_dom_element_iterator& operator++(); + soap_dom_element_iterator operator++(int); + soap_dom_element_iterator(); + soap_dom_element_iterator(struct soap_dom_element*); + ~soap_dom_element_iterator(); +}; +#endif +#endif + +#ifndef WITH_LEANER +struct SOAP_CMAC soap_dom_element +{ + struct soap_dom_element *next; + struct soap_dom_element *prnt; + struct soap_dom_element *elts; + struct soap_dom_attribute *atts; + const char *nstr; + const char *name; + const char *lead; + const char *text; + const char *code; + const char *tail; + const void *node; + int type; + struct soap *soap; +#ifdef __cplusplus + typedef soap_dom_element_iterator iterator; + soap_dom_element(struct soap *soap = NULL); + soap_dom_element(const soap_dom_element& elt); + soap_dom_element(struct soap *soap, const char *tag); + soap_dom_element(struct soap *soap, const wchar_t *tag); + soap_dom_element(struct soap *soap, const char *ns, const char *tag); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag); + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const char *text); + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const wchar_t *text); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const char *text); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const wchar_t *text); +#ifndef WITH_COMPAT + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const std::string& text); + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const std::wstring& text); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const std::string& text); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const std::wstring& text); +#endif + soap_dom_element(struct soap *soap, const char *ns, const char *tag, const void *node, int type); + soap_dom_element(struct soap *soap, const char *ns, const wchar_t *tag, const void *node, int type); + ~soap_dom_element(); + soap_dom_element& set(const char *ns, const char *tag) { return *soap_elt_set(this, ns, tag); } + soap_dom_element& set(const char *ns, const wchar_t *tag) { return *soap_elt_set_w(this, ns, tag); } + soap_dom_element& set(bool b) { return *soap_elt_bool(this, b); } + soap_dom_element& set(int n) { return *soap_elt_int(this, n); } + soap_dom_element& set(LONG64 n) { return *soap_elt_int(this, n); } + soap_dom_element& set(float x) { return *soap_elt_double(this, x); } + soap_dom_element& set(double x) { return *soap_elt_double(this, x); } + soap_dom_element& set(const char *text) { return *soap_elt_text(this, text); } + soap_dom_element& set(const wchar_t *text) { return *soap_elt_text_w(this, text); } +#ifndef WITH_COMPAT + soap_dom_element& set(const std::string& text) { return *soap_elt_text(this, text.c_str()); } + soap_dom_element& set(const std::wstring& text) { return *soap_elt_text_w(this, text.c_str()); } +#endif + soap_dom_element& set(const void *node, int type) { return *soap_elt_node(this, node, type); } + soap_dom_element& add(soap_dom_element& elt) { return *soap_add_elt(this, &elt); } + soap_dom_element& add(soap_dom_element *elt) { return *soap_add_elt(this, elt); } + soap_dom_element& add(soap_dom_attribute& att) { return *soap_add_att(this, &att); } + soap_dom_element& add(soap_dom_attribute *att) { return *soap_add_att(this, att); } + soap_dom_element& adds(soap_dom_element& elts) { return *soap_add_elts(this, &elts); } + soap_dom_element& adds(soap_dom_element *elts) { return *soap_add_elts(this, elts); } + soap_dom_element& adds(soap_dom_attribute& atts) { return *soap_add_atts(this, &atts); } + soap_dom_element& adds(soap_dom_attribute *atts) { return *soap_add_atts(this, atts); } + soap_dom_element& operator=(bool b) { return *soap_elt_bool(this, b); } + soap_dom_element& operator=(int n) { return *soap_elt_int(this, n); } + soap_dom_element& operator=(LONG64 n) { return *soap_elt_int(this, n); } + soap_dom_element& operator=(float x) { return *soap_elt_double(this, x); } + soap_dom_element& operator=(double x) { return *soap_elt_double(this, x); } + soap_dom_element& operator=(const char *text) { return *soap_elt_text(this, text); } + soap_dom_element& operator=(const wchar_t *text) { return *soap_elt_text_w(this, text); } +#ifndef WITH_COMPAT + soap_dom_element& operator=(const std::string& text) { return *soap_elt_text(this, text.c_str()); } + soap_dom_element& operator=(const std::wstring& text) { return *soap_elt_text_w(this, text.c_str()); } +#endif + soap_dom_element& operator=(const soap_dom_element& elt) { return *soap_elt_copy(this, &elt); } + template soap_dom_element& operator=(const T& node) { return this->set(&node, node.soap_type()); } + template soap_dom_element& operator=(const T *node) { return this->set(node, node->soap_type()); } + template soap_dom_element& operator=(T *node) { return this->set(node, node->soap_type()); } + soap_dom_attribute& att(const char *tag) { return *soap_att(this, NULL, tag); } + soap_dom_attribute& att(const wchar_t *tag) { return *soap_att_w(this, NULL, tag); } + soap_dom_attribute& att(const char *ns, const char *tag) { return *soap_att(this, ns, tag); } + soap_dom_attribute& att(const char *ns, const wchar_t *tag) { return *soap_att_w(this, ns, tag); } + soap_dom_element& elt() { return *soap_elt(this, NULL, NULL); } + soap_dom_element& elt(const char *tag) { return *soap_elt(this, NULL, tag); } + soap_dom_element& elt(const wchar_t *tag) { return *soap_elt_w(this, NULL, tag); } + soap_dom_element& elt(const char *ns, const char *tag) { return *soap_elt(this, ns, tag); } + soap_dom_element& elt(const char *ns, const wchar_t *tag) { return *soap_elt_w(this, ns, tag); } + soap_dom_element& operator[](const char *tag) { return *soap_elt(this, NULL, tag); } + soap_dom_element& operator[](const wchar_t *tag) { return *soap_elt_w(this, NULL, tag); } + soap_dom_element& operator[](size_t n) { return *soap_nth(this, n); } + soap_dom_attribute *att_get(const char *tag) const { return soap_att_get(this, NULL, tag); } + soap_dom_attribute *att_get(const wchar_t *tag) const { return soap_att_get_w(this, NULL, tag); } + soap_dom_attribute *att_get(const char *ns, const char *tag) const { return soap_att_get(this, ns, tag); } + soap_dom_attribute *att_get(const char *ns, const wchar_t *tag) const { return soap_att_get_w(this, ns, tag); } + soap_dom_element *elt_get() const { return soap_elt_get(this, NULL, NULL); } + soap_dom_element *elt_get(const char *tag) const { return soap_elt_get(this, NULL, tag); } + soap_dom_element *elt_get(const wchar_t *tag) const { return soap_elt_get_w(this, NULL, tag); } + soap_dom_element *elt_get(const char *ns, const char *tag) const { return soap_elt_get(this, ns, tag); } + soap_dom_element *elt_get(const char *ns, const wchar_t *tag) const { return soap_elt_get_w(this, ns, tag); } + soap_dom_element *get_next() const { return soap_elt_get_next(this); } + soap_dom_element *get_nth(size_t n) { return soap_elt_get_nth(this, n); } + bool match(const char *patt) const { return soap_elt_match(this, NULL, patt) != 0; } + bool match(const wchar_t *patt) const { return soap_elt_match_w(this, NULL, patt) != 0; } + bool match(const char *ns, const char *patt) const { return soap_elt_match(this, ns, patt) != 0; } + bool match(const char *ns, const wchar_t *patt) const { return soap_elt_match_w(this, ns, patt) != 0; } + const char *ns() const { return this->nstr; } + const char *tag() const { return this->name; } + soap_dom_element *parent() { return this->prnt; } + size_t depth() const { return soap_elt_depth(this); } + size_t index() const { return soap_elt_index(this); } + size_t len() const { return soap_elt_len(this); } + size_t nth() const { return soap_elt_nth(this); } + size_t elt_size() { return soap_elt_size(this, NULL, NULL); } + size_t elt_size(const char *patt, int type = 0) { return elt_size(NULL, patt, type); } + size_t elt_size(const char *ns, const char *patt, int type = 0) { return soap_elt_size_type(this, ns, patt, type); } + size_t att_size() { return soap_att_size(this, NULL, NULL); } + size_t att_size(const char *patt) { return att_size(NULL, patt); } +#ifndef WITH_COMPAT + size_t att_size(const std::string& patt) { return att_size(NULL, patt); } +#endif + size_t att_size(const char *ns, const char *patt) { return soap_att_size(this, ns, patt); } +#ifndef WITH_COMPAT + size_t att_size(const char *ns, const std::string& patt) { return soap_att_size(this, ns, patt.c_str()); } +#endif + bool is_true() const { return soap_elt_is_true(this) != 0; } + bool is_false() const { return soap_elt_is_false(this) != 0; } + LONG64 get_int() const { return soap_elt_get_LONG64(this); } + double get_double() const { return soap_elt_get_double(this); } + const char *get_text() const { return this->text; } + const void *get_node(int type) const { return soap_elt_get_node(this, type); } + int get_type(const void **node) const { return soap_elt_get_type(this, node); } + operator bool() const { return soap_elt_is_true(this) != 0; } + operator int() const { return soap_elt_get_int(this); } + operator LONG64() const { return soap_elt_get_LONG64(this); } + operator double() const { return soap_elt_get_double(this); } + operator const char*() const { return this->text; } + soap_dom_element_iterator begin(); + soap_dom_element_iterator end() { return soap_dom_element_iterator(NULL); } + soap_dom_element_iterator elt_begin() { return soap_dom_element_iterator(this->elts); } + soap_dom_element_iterator elt_end() { return soap_dom_element_iterator(NULL); } + soap_dom_attribute_iterator att_begin() { return soap_dom_attribute_iterator(this->atts); } + soap_dom_attribute_iterator att_end() { return soap_dom_attribute_iterator(NULL); } + soap_dom_element_iterator find(const char *patt, int type = 0) { return find(NULL, patt, type); } + soap_dom_element_iterator find(const wchar_t *patt, int type = 0) { return find(NULL, patt, type); } + soap_dom_element_iterator find(const char *ns, const char *patt, int type = 0); + soap_dom_element_iterator find(const char *ns, const wchar_t *patt, int type = 0); + soap_dom_element_iterator find(int type); + soap_dom_element_iterator elt_find(const char *patt, int type = 0) { return elt_find(NULL, patt, type); } + soap_dom_element_iterator elt_find(const wchar_t *patt, int type = 0) { return elt_find(NULL, patt, type); } + soap_dom_element_iterator elt_find(const char *ns, const char *patt, int type = 0); + soap_dom_element_iterator elt_find(const char *ns, const wchar_t *patt, int type = 0); + soap_dom_element_iterator elt_find(int type); + soap_dom_attribute_iterator att_find(const char *patt) { return att_find(NULL, patt); } + soap_dom_attribute_iterator att_find(const wchar_t *patt) { return att_find(NULL, patt); } + soap_dom_attribute_iterator att_find(const char *ns, const char *patt); + soap_dom_attribute_iterator att_find(const char *ns, const wchar_t *patt); + void unlink(); +#endif +}; +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 struct soap_dom_element * SOAP_FMAC2 soap_dup_xsd__anyType(struct soap *soap, struct soap_dom_element *d, const struct soap_dom_element *a); +SOAP_FMAC1 void SOAP_FMAC2 soap_del_xsd__anyType(const struct soap_dom_element *a); +SOAP_FMAC1 struct soap_dom_attribute * SOAP_FMAC2 soap_dup_xsd__anyAttribute(struct soap *soap, struct soap_dom_attribute *d, const struct soap_dom_attribute *a); +SOAP_FMAC1 void SOAP_FMAC2 soap_del_xsd__anyAttribute(const struct soap_dom_attribute *a); +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element *in, struct soap_dom_element *out); +#endif + +#ifndef WITH_LEANER +#if defined(__cplusplus) && !defined(WITH_COMPAT) +extern std::ostream &operator<<(std::ostream&, const struct soap_dom_element&); +extern std::istream &operator>>(std::istream&, struct soap_dom_element&); + +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element& in, struct soap_dom_element& out); +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element *in, struct soap_dom_element& out); +SOAP_FMAC1 int SOAP_FMAC2 soap_dom_call(struct soap *soap, const char *endpoint, const char *action, const struct soap_dom_element& in, struct soap_dom_element *out); +#endif +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +/******************************************************************************/ + +struct SOAP_CMAC soap +{ + short state; /* 0 = uninitialized, 1 = initialized, 2 = copy of another soap struct */ + short version; /* 1 = SOAP1.1 and 2 = SOAP1.2 (set automatically from namespace URI in nsmap table), 0 indicates non-SOAP content */ + soap_mode mode; /* internal mode flag, combines imode/omode */ + soap_mode imode; /* input mode flag set with soap_init1(), soap_new1(), or soap_set_imode() */ + soap_mode omode; /* ouput mode flag set with soap_init1(), soap_new1(), or soap_set_omode() */ + const char *float_format; /* user-definable format string for floats (<1024 chars) */ + const char *double_format; /* user-definable format string for doubles (<1024 chars) */ + const char *long_double_format;/* user-definable format string for long doubles (<1024 chars) */ + const char *dime_id_format; /* user-definable format string for integer DIME id ( 0, sets max message size that can be received */ + int recv_timeout; /* user-definable, when > 0, sets socket recv stall timeout in seconds, < 0 in usec */ + int send_timeout; /* user-definable, when > 0, sets socket send stall timeout in seconds, < 0 in usec */ + int transfer_timeout; /* user-definable, when > 0, sets socket total transfer timeout in seconds, < 0 in usec */ + int connect_timeout; /* user-definable, when > 0, sets socket connect() timeout in seconds, < 0 in usec */ + int accept_timeout; /* user-definable, when > 0, sets socket accept() timeout in seconds, < 0 in usec */ + int socket_flags; /* user-definable socket recv() and send() flags, e.g. set to MSG_NOSIGNAL to disable sigpipe */ + int connect_flags; /* user-definable connect() SOL_SOCKET sockopt flags, e.g. set to SO_DEBUG to debug socket */ + int connect_retry; /* number of times to retry connecting (exponential backoff), zero by default */ + int bind_flags; /* user-definable bind() SOL_SOCKET sockopt flags, e.g. set to SO_REUSEADDR to enable reuse */ + short bind_inet6; /* user-definable, when > 0 use AF_INET6 instead of PF_UNSPEC (only with -DWITH_IPV6) */ + short bind_v6only; /* user-definable, when > 0 use IPPROTO_IPV6 sockopt IPV6_V6ONLY (only with -DWITH_IPV6) */ + int accept_flags; /* user-definable accept() SOL_SOCKET sockopt flags */ +#ifdef WITH_SELF_PIPE + int pipe_fd[2]; /* self pipe trick file descriptors used to close the select call from another thread */ +#endif + int sndbuf; /* user-definable SO_SNDBUF setsockopt value */ + int rcvbuf; /* user-definable SO_RCVBUF setsockopt value */ + unsigned short linger_time; /* user-definable linger time for SO_LINGER option */ + unsigned int maxlevel; /* user-definable max XML nesting depth levels, initialized to SOAP_MAXLEVEL */ + long maxlength; /* user-definable max string length, initialized to SOAP_MAXLENGTH, maxlength<=0 is unbounded */ + size_t maxoccurs; /* user-definable max array/container size, initialized to SOAP_MAXOCCURS */ + const char *http_version; /* HTTP version used "1.0" or "1.1" */ + const char *http_content; /* optional custom HTTP content type (with SOAP_PUT, SOAP_POST_FILE, SOAP_FILE) */ + const char *http_extra_header;/* optional custom HTTP header of the form 'key: val' (multiple headers should be separated in the string by \r\n - crlf) */ + const char *encodingStyle; /* default = "" which means that SOAP encoding is used */ + const char *actor; /* SOAP-ENV:actor or role attribute value */ + const char *lang; /* user-definable xml:lang attribute value of SOAP-ENV:Text */ + const struct Namespace *namespaces; /* Pointer to global namespace mapping table */ + struct Namespace *local_namespaces; /* Local namespace mapping table */ + struct soap_nlist *nlist; /* namespace stack */ + struct soap_blist *blist; /* block allocation stack */ + struct soap_clist *clist; /* class instance allocation list */ + void *alist; /* memory allocation (malloc) list */ +#if !defined(WITH_LEANER) || !defined(WITH_NOIDREF) + struct soap_ilist *iht[SOAP_IDHASH]; +#endif + struct soap_plist *pht[SOAP_PTRHASH]; + struct soap_pblk *pblk; /* plist block allocation */ + short pidx; /* plist block allocation */ + short shaky; /* objects in reallocatable containers are on shaky grounds */ + struct SOAP_ENV__Header *header; + struct SOAP_ENV__Fault *fault; + int idnum; + void *user; /* for user to pass user-defined data to callbacks */ + void *data[4]; /* extension data = {smdevp, mecevp, ...} */ + struct soap_plugin *plugins; /* linked list of plug-in data */ + const char *bearer; /* HTTP authorization bearer token value */ + const char *userid; /* HTTP Basic authorization userid */ + const char *passwd; /* HTTP Basic authorization passwd */ + const char *authrealm; /* HTTP authentication realm (and NTLM domain) */ +#if !defined(WITH_LEAN) || defined(WITH_NTLM) + const char *ntlm_challenge; /* HTTP NTLM challenge key string */ + short ntlm_auth; /* HTTP NTLM authentication type */ +#endif + int (*fpost)(struct soap*, const char*, const char*, int, const char*, const char*, ULONG64); + int (*fget)(struct soap*); /* HTTP GET hook (not set by default) */ + int (*fput)(struct soap*); /* HTTP PUT hook (handled as POST by default) */ + int (*fpatch)(struct soap*); /* HTTP PATCH hook (handled as POST by default) */ + int (*fdel)(struct soap*); /* HTTP DELETE hook (not set by default) */ + int (*fopt)(struct soap*); /* HTTP OPTIONS hook (not set by default) */ + int (*fhead)(struct soap*); /* HTTP HEAD hook (not set by default) */ + int (*fform)(struct soap*); /* HTTP/HTML form handler for plugins */ + int (*fposthdr)(struct soap*, const char*, const char*); + int (*fresponse)(struct soap*, int, ULONG64); + int (*fparse)(struct soap*); + int (*fparsehdr)(struct soap*, const char*, const char*); + int (*fheader)(struct soap*); + int (*fresolve)(struct soap*, const char*, struct in_addr* inaddr); + int (*fconnect)(struct soap*, const char*, const char*, int); + int (*fdisconnect)(struct soap*); + int (*fclosesocket)(struct soap*, SOAP_SOCKET); + int (*fshutdownsocket)(struct soap*, SOAP_SOCKET, int); + SOAP_SOCKET (*fopen)(struct soap*, const char*, const char*, int); + SOAP_SOCKET (*faccept)(struct soap*, SOAP_SOCKET, struct sockaddr*, int *n); + int (*fclose)(struct soap*); + int (*fsend)(struct soap*, const char*, size_t); + size_t (*frecv)(struct soap*, char*, size_t); + int (*fpoll)(struct soap*); + void (*fseterror)(struct soap*, const char **c, const char **s); + int (*fignore)(struct soap*, const char*); + int (*fserveloop)(struct soap*); + void *(*fplugin)(struct soap*, const char*); +#ifndef WITH_LEANER + int (*fsvalidate)(struct soap*, const char*, const char*); + int (*fwvalidate)(struct soap*, const char*, const wchar_t*); + int (*feltbegin)(struct soap*, const char*); + int (*feltendin)(struct soap*, const char*, const char*); + int (*feltbegout)(struct soap*, const char*, int, const char*); + int (*feltendout)(struct soap*, const char*); + int (*fprepareinitsend)(struct soap*); + int (*fprepareinitrecv)(struct soap*); + int (*fpreparesend)(struct soap*, const char*, size_t); + int (*fpreparerecv)(struct soap*, const char*, size_t); + int (*fpreparefinalsend)(struct soap*); + int (*fpreparefinalrecv)(struct soap*); + int recverror; /* last soap_recv_raw error code for filterrecv */ + int (*ffiltersend)(struct soap*, const char**, size_t*); + int (*ffilterrecv)(struct soap*, char*, size_t*, size_t); + void *(*fdimereadopen)(struct soap*, void*, const char*, const char*, const char*); + void *(*fdimewriteopen)(struct soap*, const char*, const char*, const char*); + void (*fdimereadclose)(struct soap*, void*); + void (*fdimewriteclose)(struct soap*, void*); + size_t (*fdimeread)(struct soap*, void*, char*, size_t); + int (*fdimewrite)(struct soap*, void*, const char*, size_t); + void *(*fmimereadopen)(struct soap*, void*, const char*, const char*, const char*); + void *(*fmimewriteopen)(struct soap*, void*, const char*, const char*, const char*, enum soap_mime_encoding); + void (*fmimereadclose)(struct soap*, void*); + void (*fmimewriteclose)(struct soap*, void*); + size_t (*fmimeread)(struct soap*, void*, char*, size_t); + int (*fmimewrite)(struct soap*, void*, const char*, size_t); +#endif + SOAP_SOCKET master; /* socket bound to TCP/IP port */ + SOAP_SOCKET socket; /* socket to send and receive */ + SOAP_SOCKET sendsk; /* socket to send (overrides ::socket) */ + SOAP_SOCKET recvsk; /* socket to receive (overrides ::socket) */ +#if defined(__cplusplus) && !defined(WITH_COMPAT) + std::ostream *os; /* C++ only: ostream to send */ + std::istream *is; /* C++ only: istream to receive */ +#else + const char **os; /* C only: pointer to a const char*, will be set to point to the string output */ + const char *is; /* C only: a const char* to read from (soap->is will advance) */ +#endif +#ifndef UNDER_CE + int sendfd; /* int file descriptor for sending */ + int recvfd; /* int file descriptor for receiving */ +#else + FILE *sendfd; /* WinCE FILE* to send */ + FILE *recvfd; /* WinCE FILE* to receive */ +#endif + size_t bufidx; /* index in soap.buf[] */ + size_t buflen; /* length of soap.buf[] content */ + soap_wchar ahead; /* parser lookahead */ + short cdata; /* CDATA parser state */ + short body; /* HTTP or XML element has a body (1) or not (0) */ + unsigned int level; /* XML nesting level */ +#ifndef WITH_LEAN + ULONG64 start; /* start time of send/recv (value cast to time_t) */ +#endif + ULONG64 count; /* message length counter */ + ULONG64 length; /* message length as was set by HTTP header received */ + char *labbuf; /* look-aside buffer */ + size_t lablen; /* look-aside buffer allocated length */ + size_t labidx; /* look-aside buffer index to available part */ + char buf[SOAP_BUFLEN];/* send and receive buffer */ + char msgbuf[SOAP_TMPLEN]; /* in/out buffer for HTTP/MIME headers and short messages, must be >=1024 bytes */ + char tmpbuf[SOAP_TMPLEN]; /* in/out buffer for HTTP/MIME headers, simpleType values, element and attribute tag names, and DIME must be >=1024 bytes */ + char tag[SOAP_TAGLEN]; + char id[SOAP_TAGLEN]; + char href[SOAP_TAGLEN]; + char type[SOAP_TAGLEN]; + char arrayType[SOAP_TAGLEN]; + char arraySize[SOAP_TAGLEN]; + char arrayOffset[SOAP_TAGLEN]; + int position; + int positions[SOAP_MAXDIMS]; + struct soap_attribute *attributes; /* attribute list */ + short other; + short root; + short encoding; /* when set, output encodingStyle */ + short mustUnderstand; /* a mustUnderstand element was parsed or is output */ + short null; /* parsed XML is xsi:nil */ + short ns; /* zero to output all xmlns */ + short part; /* SOAP part state (header or body) */ + short event; /* engine events and states for use by plugins */ + short peeked; + unsigned int evlev; /* event level */ + int alloced; + size_t chunksize; + size_t chunkbuflen; + char endpoint[SOAP_TAGLEN]; + char path[SOAP_TAGLEN]; + char host[SOAP_TAGLEN]; + char *action; /* SOAPAction string */ + const char *prolog; /* XML declaration prolog */ + unsigned int ip; /* IP number retrieved from request */ + unsigned int ip6[4]; /* same for IPv6: upper in ip6[0] to lower in ip6[3] requires WITH_IPV6 */ + int port; /* port number */ + const char *override_host; /* to override the client-side host name/IP when connecting */ + int override_port; /* to override client-side port number when connecting */ + int keep_alive; /* connection should be kept open (-1, 0, or counts down) */ + int tcp_keep_alive; /* enable SO_KEEPALIVE */ + unsigned int tcp_keep_idle; /* set TCP_KEEPIDLE */ + unsigned int tcp_keep_intvl; /* set TCP_KEEPINTVL */ + unsigned int tcp_keep_cnt; /* set TCP_KEEPCNT */ + int max_keep_alive; /* maximum keep-alive session (default=100) 0 to always keep open */ + const char *proxy_http_version;/* HTTP version of proxy "1.0" or "1.1" */ + const char *proxy_host; /* Proxy Server host name */ + int proxy_port; /* Proxy Server port (default = 8080) */ + const char *proxy_userid; /* Proxy Authorization user name */ + const char *proxy_passwd; /* Proxy Authorization password */ + const char *proxy_from; /* X-Forwarding-For header returned by proxy */ + const char *origin; /* Origin header received */ + const char *cors_origin; /* CORS Allow-Origin header returned by server */ + const char *cors_allow; /* CORS Allow-Origin header default value of "*" */ + const char *cors_method; /* CORS Request-Method header received */ + const char *cors_header; /* CORS Request-Headers header received */ + const char *cors_methods; /* CORS Allow-Methods header returned by server */ + const char *cors_headers; /* CORS Allow-Headers header returned by server */ + const char *x_frame_options; /* "DENY", "SAMEORIGIN" (default), or "ALLOW-FROM uri" */ + int status; /* HTTP status code, HTTP method, or other error code */ + int error; + int errmode; + int errnum; +#ifndef WITH_LEANER + struct soap_dom_element *dom; + struct soap_dime dime; + struct soap_mime mime; + struct soap_xlist *xlist; +#endif + const char *logfile[SOAP_MAXLOGS]; + FILE *fdebug[SOAP_MAXLOGS]; + struct soap_mlist *mht[SOAP_PTRHASH]; +#ifndef WITH_LEAN + const char *wsuid; /* space-separated string of element tags */ + const char *c14nexclude; /* space-separated string of prefixes for c14n exclusion */ + const char *c14ninclude; /* space-separated string of prefixes for c14n inclusion */ +#endif + struct soap_cookie *cookies; + const char *cookie_domain; + const char *cookie_path; + int cookie_max; +#ifndef WITH_NOIO + unsigned int ipv6_multicast_if; /* in_addr_t in6addr->sin6_scope_id IPv6 value */ + char* ipv4_multicast_if; /* IP_MULTICAST_IF IPv4 setsockopt interface_addr */ + unsigned char ipv4_multicast_ttl; /* IP_MULTICAST_TTL value 0..255 */ + const char *client_addr; /* when non-NULL, client binds to this address before connect */ + const char *client_addr_ipv6; /* WITH_IPV6: when non-NULL and client_addr is non-NULL and when connecting to a IPv6 server, client binds to this IPv6 address instead of client_addr */ + int client_port; /* when nonnegative, client binds to this port before connect */ + const char *client_interface; /* when non-NULL, override client-side interface address using this address */ + union { + struct sockaddr addr; + struct sockaddr_in in; + struct sockaddr_storage storage; + } peer; /* set by soap_connect/soap_accept and by UDP recv */ + size_t peerlen; +#endif +#if defined(WITH_OPENSSL) /* OpenSSL */ + int (*fsslauth)(struct soap*); + int (*fsslverify)(int, X509_STORE_CTX*); + BIO *bio; + SSL *ssl; + SSL_CTX *ctx; + SSL_SESSION *session; + const char *dhfile; + const char *randfile; +#elif defined(WITH_GNUTLS) /* GNUTLS */ + int (*fsslauth)(struct soap*); + void *fsslverify; + gnutls_certificate_credentials_t xcred; /* cert pointer */ + gnutls_anon_client_credentials_t acred; /* anon pointer */ + gnutls_priority_t cache; /* priority cache pointer */ + gnutls_session_t session; /* session pointer */ + gnutls_dh_params_t dh_params; + gnutls_rsa_params_t rsa_params; +#elif defined(WITH_SYSTEMSSL) /* SYSTEM SSL */ + int (*fsslauth)(struct soap*); + void *fsslverify; /* N/A */ + void *bio; /* N/A */ + gsk_handle ctx; /* environment */ + gsk_handle ssl; /* ssl socket */ + void *session; /* N/A */ + const char *dhfile; /* N/A */ + const char *randfile; /* N/A */ +#else /* No SSL/TLS */ + void *fsslauth; /* dummy members, to preserve struct size */ + void *fsslverify; + void *bio; + void *ssl; + void *ctx; + void *session; + void *dh_params; + void *rsa_params; +#endif + unsigned short ssl_flags; + const char *keyfile; + const char *keyid; + const char *password; + const char *cafile; + const char *capath; + const char *crlfile; + char session_host[SOAP_TAGLEN]; + int session_port; +#ifdef SOAP_LOCALE_T + SOAP_LOCALE_T c_locale; /* if this does not compile, use ./configure --enable-xlocale or compile with -DWITH_INCLUDE_XLOCALE_H, or use -DWITH_NO_C_LOCALE to disable locale support */ +#else + void *c_locale; +#endif +#ifdef WITH_ZLIB + z_stream *d_stream; /* decompression stream */ + uLong z_crc; /* internal gzip crc */ +#else + void *d_stream; /* dummy members, to preserve struct size */ + soap_int32 z_crc; +#endif + const char *z_dict; /* support for zlib static dictionaries */ + unsigned int z_dict_len; + short zlib_state; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_INFLATE */ + short zlib_in; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */ + short zlib_out; /* SOAP_ZLIB_NONE, SOAP_ZLIB_DEFLATE, or SOAP_ZLIB_GZIP */ + char *z_buf; /* buffer */ + size_t z_buflen; + unsigned short z_level; /* compression level to be used (0=none, 1=fast to 9=best) */ + float z_ratio_in; /* detected compression ratio compressed_length/length of inbound message */ + float z_ratio_out; /* detected compression ratio compressed_length/length of outbound message */ +#ifdef WMW_RPM_IO /* vxWorks compatibility */ + void *rpmreqid; +#endif +#ifdef __cplusplus + soap(); + soap(soap_mode); + soap(soap_mode, soap_mode); + soap(const struct soap&); + struct soap& operator=(const struct soap&); + void destroy(); + ~soap(); /* no virtual methods, so sizeof(soap) should be the same in C and C++ */ +#endif +}; + +struct soap_code_map +{ + LONG64 code; + const char *string; +}; + +/* forwarding list */ +struct soap_flist +{ + struct soap_flist *next; + int type; + void *ptr; + unsigned int level; + size_t index; + void (*finsert)(struct soap*, int, int, void*, size_t, const void*, void**); +}; + +/* id-ref forwarding list */ +struct soap_ilist +{ + struct soap_ilist *next; + int type; + size_t size; + void *ptr; + void **spine; + void *link; + void *copy; + struct soap_flist *flist; + void *smart; + short shaky; + char id[1]; /* the actual id string value flows into the allocated region below this struct */ +}; + +struct soap_plugin +{ + struct soap_plugin *next; + const char *id; + void *data; + int (*fcopy)(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src); + void (*fdelete)(struct soap *soap, struct soap_plugin *p); /* should delete fields of plugin only and not free(p) */ +}; + +extern SOAP_NMAC struct Namespace namespaces[]; + +#ifndef WITH_LEAN +# define soap_get0(soap) (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx]) +# define soap_get1(soap) (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx++]) +#else +soap_wchar soap_get0(struct soap*); +soap_wchar soap_get1(struct soap*); +#endif + +#define soap_versioning_paste(name, ext) name##_REQUIRE_lib_v##ext +#define soap_versioning_ext(name, ext) soap_versioning_paste(name, ext) +#define soap_versioning(name) soap_versioning_ext(name, GSOAP_VERSION) + +#define soap_init(soap) soap_init1(soap, SOAP_IO_DEFAULT) +#define soap_init1(soap, mode) soap_init2(soap, mode, mode) +#define soap_init2(soap, imode, omode) soap_versioning(soap_init)(soap, imode, omode) + +#define soap_new() soap_new1(SOAP_IO_DEFAULT) +#define soap_new1(mode) soap_new2(mode, mode) +#define soap_new2(imode, omode) soap_versioning(soap_new)(imode, omode) + +#define soap_revget1(soap) ((soap)->bufidx--) +#define soap_unget(soap, c) ((soap)->ahead = c) +#define soap_peek(soap) ((soap)->ahead = soap_get(soap)) +#define soap_register_plugin(soap, plugin) soap_register_plugin_arg(soap, plugin, NULL) +#define soap_mode(soap, n) ((soap)->mode = (soap)->imode = (soap)->omode = (n)) +#define soap_imode(soap, n) ((soap)->imode = (n)) +#define soap_omode(soap, n) ((soap)->omode = (n)) +#define soap_set_imode(soap, n) ((soap)->imode |= (n)) +#define soap_clr_imode(soap, n) ((soap)->imode &= ~(n)) +#define soap_set_omode(soap, n) ((soap)->omode |= (n)) +#define soap_clr_omode(soap, n) ((soap)->omode &= ~(n)) +#define soap_set_mode(soap, n) ((soap)->mode |= (n), (soap)->imode |= (n), (soap)->omode |= (n)) +#define soap_clr_mode(soap, n) ((soap)->mode &= ~(n), (soap)->imode &= ~(n), (soap)->omode &= ~(n)) +#define soap_destroy(soap) soap_delete((soap), NULL) + +#define SOAP_NO_LINK_TO_DELETE (-2) /* pass to soap_link() as size n: do not manage, smart pointers are self-managing */ + +#ifdef HAVE_STRRCHR +# define soap_strrchr(s, t) strrchr(s, t) +#else + SOAP_FMAC1 char* SOAP_FMAC2 soap_strrchr(const char *s, int t); +#endif + +#ifdef HAVE_STRTOL +# define soap_strtol(s, t, b) strtol(s, t, b) +#else + SOAP_FMAC1 long SOAP_FMAC2 soap_strtol(const char*, char**, int); +#endif + +#ifdef HAVE_STRTOUL +# define soap_strtoul(s, t, b) strtoul(s, t, b) +#else + SOAP_FMAC1 unsigned long SOAP_FMAC2 soap_strtoul(const char*, char**, int); +#endif + +#if defined(WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) +# define soap_strtoll _strtoi64 +#elif defined(HAVE_STRTOLL) && !defined(soap_strtoll) +# define soap_strtoll strtoll +#elif !defined(soap_strtoll) + SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_strtoll(const char*, char**, int); +#endif + +#if defined(WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__BORLANDC__) +# define soap_strtoull _strtoui64 +#elif defined(HAVE_STRTOULL) && !defined(soap_strtoull) +# define soap_strtoull strtoull +#elif !defined(soap_strtoull) + SOAP_FMAC1 ULONG64 SOAP_FMAC2 soap_strtoull(const char*, char**, int); +#endif + +#if defined(WITH_OPENSSL) +# define soap_random soap_rand() + SOAP_FMAC1 int SOAP_FMAC2 soap_rand(void); +#elif defined(UNDER_CE) +# define soap_random (int)Random() +#elif defined(HAVE_RANDOM) +# define soap_random (int)random() +#else +# define soap_random rand() +#endif + +#ifdef WITH_NOIDREF +# define soap_embedded(s, p, t) ((void)(s), 0) +# define soap_id_lookup(s, i, p, t, n, k, fb) ((void)(s), (p)) +# define soap_id_forward(s, h, p, i, t, tt, n, k, fi, fb) ((void)(s), (p)) +# define soap_id_nullify(s, i) ((void)(s), (i)) +# define soap_reference(s, a, t) ((void)(s), 1) +# define soap_array_reference(s, p, a, n, t) ((void)(s), 1) +# define soap_attachment_reference(s, p, a, n, t, i, y) ((void)(s), 1) +# define soap_embed(s, p, a, n, t) ((void)(s), 0) +# define soap_embedded_id(s, i, p, t) ((void)(s), (void)(t), i) +# define soap_is_embedded(s, p) ((void)(s), 0) +# define soap_is_single(s, p) ((void)(s), 1) +# define soap_lookup_type(s, i) ((void)(s), 0) +# define soap_getindependent(s) ((void)(s), 0) +# define soap_putindependent(s) ((void)(s), 0) +# define soap_markelement(s, p, t) ((void)(s), 0) +# define soap_begin_shaky(s) ((void)(s), 0) +# define soap_end_shaky(s, f) ((void)(s), (void)(f), 0) +#endif + +/* soap_traverse() traversal/walker routines take walker function arguments */ +typedef void soap_walker(struct soap*, void*, int, const char*, const char*); + +SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap); +SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap); + +SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_init(void); +SOAP_FMAC1 void SOAP_FMAC2 soap_ssl_noinit(void); +SOAP_FMAC1 int SOAP_FMAC2 soap_GET(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_PUT(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_PATCH(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_POST(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_DELETE(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_connect_command(struct soap*, int, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_connect(struct soap*, const char*, const char*); +SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_bind(struct soap*, const char*, int, int); +SOAP_FMAC1 SOAP_SOCKET SOAP_FMAC2 soap_accept(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_accept(struct soap*); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_ssl_error(struct soap*, int ret, int err); +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_crl(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_poll(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_ready(struct soap*); + +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid); +#else +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid); +#endif +#if defined(VXWORKS) && defined(WM_SECURE_KEY_STORAGE) +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *keyid, const char *password, const char *cafile, const char *capath, const char *randfile); +#else +SOAP_FMAC1 int SOAP_FMAC2 soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *randfile); +#endif + +SOAP_FMAC1 const char * SOAP_FMAC2 soap_http_content_type(struct soap *soap, int status); +SOAP_FMAC1 int SOAP_FMAC2 soap_puthttphdr(struct soap*, int status, ULONG64 count); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_http_header_attribute(struct soap*, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_decode_key(char*, size_t, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_decode_val(char*, size_t, const char*); + +SOAP_FMAC1 size_t SOAP_FMAC2 soap_hash(const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_endpoint(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_flush_raw(struct soap*, const char*, size_t); +SOAP_FMAC1 int SOAP_FMAC2 soap_flush(struct soap*); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_get(struct soap*); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getchar(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_tag_cmp(const char*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_fault(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_sender_fault_subcode(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_receiver_fault_subcode(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_sender_error(struct soap*, const char*, const char*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_receiver_error(struct soap*, const char*, const char*, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_send_raw(struct soap*, const char*, size_t); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_raw(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_send(struct soap*, const char*); + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_send2(struct soap*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_send3(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_query_send_key(struct soap*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_query_send_val(struct soap*, const char*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_query(struct soap*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_query_key(struct soap*, char**); +SOAP_FMAC1 char * SOAP_FMAC2 soap_query_val(struct soap*, char**); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_query_decode(char*, size_t, const char*); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_pututf8(struct soap*, unsigned long); +SOAP_FMAC1 soap_wchar SOAP_FMAC2 soap_getutf8(struct soap*); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_utf8len(const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_putbase64(struct soap*, const unsigned char*, int); +SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_getbase64(struct soap*, int*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_puthex(struct soap*, const unsigned char*, int); +SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_gethex(struct soap*, int*); + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_xop_forward(struct soap*, unsigned char**, int*, char**, char**, char**); +SOAP_FMAC1 int SOAP_FMAC2 soap_attachment_forward(struct soap*, unsigned char**, int*, char**, char**, char**); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup(struct soap*, const void *p, int t, struct soap_plist**); +SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_enter(struct soap*, const void *p, const void *a, int n, int t, struct soap_plist**); +SOAP_FMAC1 int SOAP_FMAC2 soap_array_pointer_lookup(struct soap*, const void *p, const void *a, int n, int t, struct soap_plist**); +#ifndef WITH_NOIDREF +SOAP_FMAC1 int SOAP_FMAC2 soap_pointer_lookup_id(struct soap*, void *p, int t, struct soap_plist**); +SOAP_FMAC1 int SOAP_FMAC2 soap_embed(struct soap *soap, const void *p, const void *a, int n, int t); +SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_lookup(struct soap*, const char*); +SOAP_FMAC1 struct soap_ilist* SOAP_FMAC2 soap_enter(struct soap*, const char*, int t, size_t n); +SOAP_FMAC1 int SOAP_FMAC2 soap_resolve(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_embedded(struct soap*, const void *p, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_reference(struct soap*, const void *p, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_array_reference(struct soap*, const void *p, const void *a, int n, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_attachment_reference(struct soap *soap, const void *p, const void *a, int n, int t, const char *id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_embedded_id(struct soap*, int id, const void *p, int t); +SOAP_FMAC1 int SOAP_FMAC2 soap_is_embedded(struct soap*, struct soap_plist*); +SOAP_FMAC1 int SOAP_FMAC2 soap_is_single(struct soap*, struct soap_plist*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_embedded(struct soap*, struct soap_plist*); +#endif +SOAP_FMAC1 int SOAP_FMAC2 soap_check_and_mark(struct soap *soap, const void *p, int t, char **mark); +SOAP_FMAC1 void * SOAP_FMAC2 soap_mark_lookup(struct soap *soap, const void *p, int t, struct soap_plist **pp, char **mark); +SOAP_FMAC1 int SOAP_FMAC2 soap_mark_cycle(struct soap *soap, struct soap_plist *pp); +SOAP_FMAC1 void SOAP_FMAC2 soap_mark_dup(struct soap *soap, void *a, struct soap_plist *pp); +SOAP_FMAC1 void SOAP_FMAC2 soap_unmark(struct soap *soap, char *mark); + +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_count(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_count(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_send(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_send(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_send_flush(struct soap*); + +SOAP_FMAC1 const struct soap_code_map* SOAP_FMAC2 soap_code(const struct soap_code_map*, const char*); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_code_int(const struct soap_code_map*, const char*, LONG64); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_str(const struct soap_code_map*, long); +SOAP_FMAC1 LONG64 SOAP_FMAC2 soap_code_bits(const struct soap_code_map*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_code_list(struct soap*, const struct soap_code_map*, long); + +SOAP_FMAC1 int SOAP_FMAC2 soap_binary_search_string(const char**, int, const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_getline(struct soap*, char*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_serve(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_begin_recv(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_end_recv(struct soap*); + +SOAP_FMAC1 void* SOAP_FMAC2 soap_malloc(struct soap*, size_t); +SOAP_FMAC1 void SOAP_FMAC2 soap_dealloc(struct soap*, void*); +SOAP_FMAC1 struct soap_clist * SOAP_FMAC2 soap_link(struct soap*, int, int, int (*fdelete)(struct soap*, struct soap_clist*)); +SOAP_FMAC1 int SOAP_FMAC2 soap_unlink(struct soap*, const void*); +SOAP_FMAC1 void SOAP_FMAC2 soap_free_temp(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_del(struct soap*); + +SOAP_FMAC1 void* SOAP_FMAC2 soap_track_malloc(struct soap*, const char*, int, size_t); +SOAP_FMAC1 void SOAP_FMAC2 soap_track_free(struct soap*, const char*, int, void*); + +#ifndef WITH_NOIDREF +SOAP_FMAC1 int SOAP_FMAC2 soap_lookup_type(struct soap*, const char *id); +SOAP_FMAC1 short SOAP_FMAC2 soap_begin_shaky(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_end_shaky(struct soap*, short); +SOAP_FMAC1 void* SOAP_FMAC2 soap_id_lookup(struct soap*, const char *id, void **p, int t, size_t n, unsigned int k, int (*fbase)(int, int)); +SOAP_FMAC1 void* SOAP_FMAC2 soap_id_forward(struct soap*, const char *id, void *p, size_t i, int t, int tt, size_t n, unsigned int k, void(*finsert)(struct soap*, int, int, void*, size_t, const void*, void**), int (*fbase)(int, int)); +SOAP_FMAC1 int SOAP_FMAC2 soap_id_nullify(struct soap*, const char*); +#endif +SOAP_FMAC1 void* SOAP_FMAC2 soap_id_enter(struct soap*, const char *id, void *p, int t, size_t n, const char *type, const char *arrayType, void *(*finstantiate)(struct soap*, int, const char*, const char*, size_t*), int (*fbase)(int, int)); +SOAP_FMAC1 void** SOAP_FMAC2 soap_id_smart(struct soap *soap, const char*, int t, size_t n); + +SOAP_FMAC1 size_t SOAP_FMAC2 soap_size(const int *, int); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_getsizes(const char *, int *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_getoffsets(const char *, const int *, int *, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_getposition(const char *, int *); + +SOAP_FMAC1 char* SOAP_FMAC2 soap_putsizesoffsets(struct soap*, const char *, const int *, const int *, int); +SOAP_FMAC1 char* SOAP_FMAC2 soap_putoffsets(struct soap*, const int *, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_closesock(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_force_closesock(struct soap*); + +SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_versioning(soap_new)(soap_mode, soap_mode); +SOAP_FMAC1 void SOAP_FMAC2 soap_free(struct soap*); +SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy(const struct soap*); +SOAP_FMAC1 struct soap *SOAP_FMAC2 soap_copy_context(struct soap*, const struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_copy_stream(struct soap*, struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_free_stream(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_versioning(soap_init)(struct soap*, soap_mode, soap_mode); +SOAP_FMAC1 void SOAP_FMAC2 soap_initialize(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_done(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_cleanup(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_begin(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_end(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_delete(struct soap*, void*); +SOAP_FMAC1 void SOAP_FMAC2 soap_delegate_deletion(struct soap*, struct soap*); +#ifdef WITH_SELF_PIPE +SOAP_FMAC1 void SOAP_FMAC2 soap_close_connection(struct soap*); +#endif + +/* API functions available with DEBUG or SOAP_DEBUG defined: */ +SOAP_FMAC1 void SOAP_FMAC2 soap_set_recv_logfile(struct soap*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_sent_logfile(struct soap*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_test_logfile(struct soap*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_close_logfiles(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_open_logfile(struct soap*, int); +/* */ + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_value(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_match_tag(struct soap*, const char*, const char *); +SOAP_FMAC1 int SOAP_FMAC2 soap_match_att(struct soap*, const char*, const char *); +SOAP_FMAC1 int SOAP_FMAC2 soap_match_array(struct soap*, const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_element(struct soap*, const char*, int, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_start_end_out(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_out(struct soap*, const char *tag, int id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_array_begin_out(struct soap*, const char *tag, int id, const char *type, const char *offset); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_ref(struct soap*, const char *tag, int id, int href); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_href(struct soap*, const char *tag, int id, const char *ref, const char *val); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_null(struct soap*, const char *tag, int id, const char *type); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_empty(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_nil(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_id(struct soap*, const char *tag, int id, const void *p, const void *a, int n, const char *type, int t, char **mark); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_result(struct soap*, const char *tag); +SOAP_FMAC1 void SOAP_FMAC2 soap_check_result(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_out(struct soap*, const char *tag); +SOAP_FMAC1 int SOAP_FMAC2 soap_element_end(struct soap*, const char *tag); + +SOAP_FMAC1 int SOAP_FMAC2 soap_attribute(struct soap*, const char*, const char*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_element_begin_in(struct soap*, const char *tag, int nillable, const char *type); + +SOAP_FMAC1 int SOAP_FMAC2 soap_element_end_in(struct soap*, const char *tag); + +SOAP_FMAC1 int SOAP_FMAC2 soap_peek_element(struct soap*); + +SOAP_FMAC1 void SOAP_FMAC2 soap_retry(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_revert(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_ignore(struct soap*); + +SOAP_FMAC1 void* SOAP_FMAC2 soap_memdup(struct soap*, const void*, size_t); +SOAP_FMAC1 char* SOAP_FMAC2 soap_strdup(struct soap*, const char*); +SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrdup(struct soap*, const wchar_t*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_strtrim(struct soap*, char*); +SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstrtrim(struct soap*, wchar_t*); +SOAP_FMAC1 const char * SOAP_FMAC2 soap_tagsearch(const char *big, const char *little); + +SOAP_FMAC1 int SOAP_FMAC2 soap_string_out(struct soap*, const char *s, int flag); +SOAP_FMAC1 char* SOAP_FMAC2 soap_string_in(struct soap*, int, long, long, const char*); + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_wstring_out(struct soap*, const wchar_t *s, int flag); +SOAP_FMAC1 wchar_t* SOAP_FMAC2 soap_wstring_in(struct soap*, int, long, long, const char*); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_match_namespace(struct soap*, const char *, const char*, size_t n1, size_t n2); + +SOAP_FMAC1 void SOAP_FMAC2 soap_set_version(struct soap*, short); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_namespaces(struct soap*, const struct Namespace*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_local_namespaces(struct soap*); + +SOAP_FMAC1 void SOAP_FMAC2 soap_pop_namespace(struct soap*); +SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_push_namespace(struct soap*, const char *,const char *); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace_tag(struct soap *soap, const char *tag); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_current_namespace_att(struct soap *soap, const char *tag); + +SOAP_FMAC1 struct soap_nlist* SOAP_FMAC2 soap_lookup_ns(struct soap *soap, const char *tag, size_t n); + +SOAP_FMAC1 int SOAP_FMAC2 soap_store_lab(struct soap*, const char*, size_t); +SOAP_FMAC1 int SOAP_FMAC2 soap_append_lab(struct soap*, const char*, size_t); + +SOAP_FMAC1 struct soap_blist* SOAP_FMAC2 soap_alloc_block(struct soap*); +SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block(struct soap*, struct soap_blist*, size_t); +SOAP_FMAC1 void* SOAP_FMAC2 soap_push_block_max(struct soap*, struct soap_blist*, size_t); +SOAP_FMAC1 void SOAP_FMAC2 soap_pop_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_size_block(struct soap*, struct soap_blist*, size_t); +SOAP_FMAC1 char* SOAP_FMAC2 soap_first_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_next_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 size_t SOAP_FMAC2 soap_block_size(struct soap*, struct soap_blist*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_save_block(struct soap*, struct soap_blist*, char*, int); +SOAP_FMAC1 void SOAP_FMAC2 soap_end_block(struct soap*, struct soap_blist*); +SOAP_FMAC1 void SOAP_FMAC2 soap_update_pointers(struct soap *soap, const char *dst, const char *src, size_t len); + +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_out(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_out(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_http_has_body(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_http_skip_body(struct soap*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_http_get_body(struct soap*, size_t *len); +SOAP_FMAC1 char * SOAP_FMAC2 soap_http_get_form(struct soap*); +SOAP_FMAC1 char * SOAP_FMAC2 soap_http_get_body_prefix(struct soap*, size_t *len, const char *prefix); + +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_begin_in(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_envelope_end_in(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_out(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_out(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_body_begin_in(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_body_end_in(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_header(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_response(struct soap*, int); + +SOAP_FMAC1 int SOAP_FMAC2 soap_send_empty_response(struct soap*, int status); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_empty_response(struct soap*); + +SOAP_FMAC1 int SOAP_FMAC2 soap_send_fault(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_recv_fault(struct soap*, int check); + +#ifndef WITH_NOSTDLIB +SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault(struct soap*, FILE*); +SOAP_FMAC1 void SOAP_FMAC2 soap_print_fault_location(struct soap*, FILE*); +# ifndef WITH_LEAN +# ifndef WITH_COMPAT +# ifdef __cplusplus +SOAP_FMAC1 void SOAP_FMAC2 soap_stream_fault(struct soap*, std::ostream&); +SOAP_FMAC1 void SOAP_FMAC2 soap_stream_fault_location(struct soap*, std::ostream&); +# endif +# endif +SOAP_FMAC1 char* SOAP_FMAC2 soap_sprint_fault(struct soap*, char*, size_t); +# endif +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_s2byte(struct soap*, const char*, char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2short(struct soap*, const char*, short*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2int(struct soap*, const char*, int*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2long(struct soap*, const char*, long*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2LONG64(struct soap*, const char*, LONG64*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2float(struct soap*, const char*, float*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2double(struct soap*, const char*, double*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedByte(struct soap*, const char*, unsigned char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedShort(struct soap*, const char*, unsigned short*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedInt(struct soap*, const char*, unsigned int*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2unsignedLong(struct soap*, const char*, unsigned long*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2ULONG64(struct soap*, const char*, ULONG64*); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2char(struct soap*, const char*, char**, int, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2QName(struct soap*, const char*, char**, long minlen, long maxlen, const char *pattern); + +#ifndef WITH_COMPAT +#ifdef __cplusplus +SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdQName(struct soap*, const char*, std::string*, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdchar(struct soap*, const char*, std::string*, int, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2stdwchar(struct soap*, const char*, std::wstring*, int, long minlen, long maxlen, const char *pattern); +#endif +#endif + +#ifndef WITH_LEAN +SOAP_FMAC1 int SOAP_FMAC2 soap_s2wchar(struct soap*, const char*, wchar_t**, int, long minlen, long maxlen, const char *pattern); +SOAP_FMAC1 int SOAP_FMAC2 soap_s2dateTime(struct soap*, const char*, time_t*); +#endif + +SOAP_FMAC1 char* SOAP_FMAC2 soap_s2base64(struct soap*, const unsigned char*, char*, int); +SOAP_FMAC1 char* SOAP_FMAC2 soap_s2hex(struct soap*, const unsigned char*, char*, int); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_byte2s(struct soap*, char); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_short2s(struct soap*, short); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_int2s(struct soap*, int); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_long2s(struct soap*, long); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_LONG642s(struct soap*, LONG64); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_float2s(struct soap*, float); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_double2s(struct soap*, double); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedByte2s(struct soap*, unsigned char); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedShort2s(struct soap*, unsigned short); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedInt2s(struct soap*, unsigned int); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_unsignedLong2s(struct soap*, unsigned long); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_ULONG642s(struct soap*, ULONG64); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_QName2s(struct soap*, const char*); + +#ifndef WITH_LEAN +SOAP_FMAC1 const char* SOAP_FMAC2 soap_wchar2s(struct soap*, const wchar_t*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_dateTime2s(struct soap*, time_t); +#endif + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_base642s(struct soap*, const char*, char*, size_t, int*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_hex2s(struct soap*, const char*, char*, size_t, int*); + +SOAP_FMAC1 int* SOAP_FMAC2 soap_inint(struct soap*, const char *tag, int *p, const char *, int); +SOAP_FMAC1 char* SOAP_FMAC2 soap_inbyte(struct soap*, const char *tag, char *p, const char *, int); +SOAP_FMAC1 long* SOAP_FMAC2 soap_inlong(struct soap*, const char *tag, long *p, const char *, int); +SOAP_FMAC1 LONG64* SOAP_FMAC2 soap_inLONG64(struct soap*, const char *tag, LONG64 *p, const char *, int); +SOAP_FMAC1 short* SOAP_FMAC2 soap_inshort(struct soap*, const char *tag, short *p, const char *, int); +SOAP_FMAC1 float* SOAP_FMAC2 soap_infloat(struct soap*, const char *tag, float *p, const char *, int); +SOAP_FMAC1 double* SOAP_FMAC2 soap_indouble(struct soap*, const char *tag, double *p, const char *, int); +SOAP_FMAC1 unsigned char* SOAP_FMAC2 soap_inunsignedByte(struct soap*, const char *tag, unsigned char *p, const char *, int); +SOAP_FMAC1 unsigned short* SOAP_FMAC2 soap_inunsignedShort(struct soap*, const char *tag, unsigned short *p, const char *, int); +SOAP_FMAC1 unsigned int* SOAP_FMAC2 soap_inunsignedInt(struct soap*, const char *tag, unsigned int *p, const char *, int); +SOAP_FMAC1 unsigned long* SOAP_FMAC2 soap_inunsignedLong(struct soap*, const char *tag, unsigned long *p, const char *, int); +SOAP_FMAC1 ULONG64* SOAP_FMAC2 soap_inULONG64(struct soap*, const char *tag, ULONG64 *p, const char *, int); +SOAP_FMAC1 char** SOAP_FMAC2 soap_instring(struct soap*, const char *tag, char **p, const char *, int, int, long, long, const char*); +SOAP_FMAC1 char** SOAP_FMAC2 soap_inliteral(struct soap*, const char *tag, char **p); + +#ifndef WITH_LEAN +SOAP_FMAC1 time_t* SOAP_FMAC2 soap_indateTime(struct soap*, const char *tag, time_t *p, const char *, int); +#endif + +#if !defined(WITH_LEAN) || defined(WITH_COOKIES) +SOAP_FMAC1 time_t SOAP_FMAC2 soap_timegm(struct tm*); +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwstring(struct soap*, const char *tag, wchar_t **p, const char *, int, int, long, long, const char*); +SOAP_FMAC1 wchar_t** SOAP_FMAC2 soap_inwliteral(struct soap*, const char *tag, wchar_t **p); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_outbyte(struct soap*, const char *tag, int id, const char *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outshort(struct soap*, const char *tag, int id, const short *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outint(struct soap*, const char *tag, int id, const int *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outlong(struct soap*, const char *tag, int id, const long *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outLONG64(struct soap*, const char *tag, int id, const LONG64 *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outfloat(struct soap*, const char *tag, int id, const float *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outdouble(struct soap*, const char *tag, int id, const double *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedByte(struct soap*, const char *tag, int id, const unsigned char *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedShort(struct soap*, const char *tag, int id, const unsigned short *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedInt(struct soap*, const char *tag, int id, const unsigned int *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outunsignedLong(struct soap*, const char *tag, int id, const unsigned long *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outULONG64(struct soap*, const char *tag, int id, const ULONG64 *p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outstring(struct soap*, const char *tag, int id, char *const*p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outliteral(struct soap*, const char *tag, char *const*p, const char *type); + +#ifndef WITH_LEAN +SOAP_FMAC1 int SOAP_FMAC2 soap_outdateTime(struct soap*, const char *tag, int id, const time_t *p, const char *, int); +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_outwstring(struct soap*, const char *tag, int id, wchar_t *const*p, const char *, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_outwliteral(struct soap*, const char *tag, wchar_t *const*p, const char *type); +#endif + +#ifndef WITH_LEANER +SOAP_FMAC1 int SOAP_FMAC2 soap_attachment(struct soap *, const char*, int, const void*, const void*, int, const char*, const char*, const char*, const char*, int); +SOAP_FMAC1 int SOAP_FMAC2 soap_move(struct soap*, ULONG64); +SOAP_FMAC1 ULONG64 SOAP_FMAC2 soap_tell(struct soap*); +SOAP_FMAC1 char* SOAP_FMAC2 soap_dime_option(struct soap*, unsigned short, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getdimehdr(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getdime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putdimehdr(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putdime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getmimehdr(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getmime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putmimehdr(struct soap*, struct soap_multipart*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putmime(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_dime(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_set_mime(struct soap*, const char *boundary, const char *start); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_dime(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_mime(struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_dime_attachment(struct soap*, const char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_mime_attachment(struct soap*, const char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description); +SOAP_FMAC1 void SOAP_FMAC2 soap_post_check_mime_attachments(struct soap *soap); +SOAP_FMAC1 int SOAP_FMAC2 soap_check_mime_attachments(struct soap *soap); +SOAP_FMAC1 struct soap_multipart* SOAP_FMAC2 soap_recv_mime_attachment(struct soap *soap, void *handle); +SOAP_FMAC1 int SOAP_FMAC2 soap_match_cid(struct soap*, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_rand_uuid(struct soap*, const char*); +#endif + +SOAP_FMAC1 int SOAP_FMAC2 soap_register_plugin_arg(struct soap*, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void*); +SOAP_FMAC1 void* SOAP_FMAC2 soap_lookup_plugin(struct soap*, const char*); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_attr_value(struct soap *soap, const char *name, int flag, int occurs); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_attr(struct soap *soap, const char *name, const char *value, int flag); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_attr(struct soap *soap); + +SOAP_FMAC1 const char* SOAP_FMAC2 soap_extend_url(struct soap *soap, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_extend_url_query(struct soap *soap, const char*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_url_query(struct soap *soap, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_encode_url(const char*, char*, int); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_encode_url_string(struct soap*, const char*); +#ifdef WITH_COOKIES +SOAP_FMAC1 void SOAP_FMAC2 soap_getcookies(struct soap *soap, const char *val); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_set_cookie(struct soap*, const char*, const char*, const char*, const char*); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_cookie(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_cookie_env(struct soap*, const char*, const char*, const char*, short); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_cookie_value(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 const char* SOAP_FMAC2 soap_env_cookie_value(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 time_t SOAP_FMAC2 soap_cookie_expire(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_cookie_expire(struct soap*, const char*, long, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_cookie_secure(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_set_cookie_session(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_clr_cookie_session(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 void SOAP_FMAC2 soap_clr_cookie(struct soap*, const char*, const char*, const char*); +SOAP_FMAC1 int SOAP_FMAC2 soap_getenv_cookies(struct soap*); +SOAP_FMAC1 void SOAP_FMAC2 soap_free_cookies(struct soap*); +SOAP_FMAC1 struct soap_cookie* SOAP_FMAC2 soap_copy_cookies(struct soap*, const struct soap*); +SOAP_FMAC1 int SOAP_FMAC2 soap_putsetcookies(struct soap *soap); +SOAP_FMAC1 int SOAP_FMAC2 soap_putcookies(struct soap *soap, const char *domain, const char *path, int secure); +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +SOAP_FMAC3 void SOAP_FMAC4 soap_header(struct soap*); +SOAP_FMAC3 void SOAP_FMAC4 soap_fault(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultcode(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultsubcode(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultstring(struct soap*); +SOAP_FMAC3 const char ** SOAP_FMAC4 soap_faultdetail(struct soap*); +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_subcode(struct soap*); +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_string(struct soap*); +SOAP_FMAC3 const char * SOAP_FMAC4 soap_fault_detail(struct soap*); +SOAP_FMAC3 void SOAP_FMAC4 soap_serializefault(struct soap*); +SOAP_FMAC3 void SOAP_FMAC4 soap_serializeheader(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getheader(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putheader(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_getfault(struct soap*); +SOAP_FMAC3 int SOAP_FMAC4 soap_putfault(struct soap*); + +#ifdef __cplusplus + +/* C++ templates (for generated C++ only, not needed nor used in generated C code) */ + +template +struct soap_block +{ + static T *push(struct soap *soap, struct soap_blist *b) + { + if (!b) + b = soap->blist; + if (!b) + return NULL; + T *p = (T*)soap_push_block_max(soap, b, sizeof(T)); + if (p) + SOAP_PLACEMENT_NEW(soap, p, T); + return p; + } + static void pop(struct soap *soap, struct soap_blist *b) + { + if (!b) + b = soap->blist; + if (!b || !b->head) + return; + ((T*)(b->head + 1))->~T(); + soap_pop_block(soap, b); + } + static void save(struct soap *soap, struct soap_blist *b, T *p) + { + if (!b) + b = soap->blist; + for (T *q = (T*)soap_first_block(soap, b); q; q = (T*)soap_next_block(soap, b)) + { + soap_update_pointers(soap, (const char*)p, (const char*)q, sizeof(T)); + *p++ = *q; + q->~T(); + } + soap_end_block(soap, b); + } + static void end(struct soap *soap, struct soap_blist *b) + { + if (!b) + b = soap->blist; + for (T *p = (T*)soap_first_block(soap, b); p; p = (T*)soap_next_block(soap, b)) + p->~T(); + soap_end_block(soap, b); + } +}; + +#endif + +#endif /* STDSOAP_H */ diff --git a/connor_erp_mes/tinystr.cpp b/connor_erp_mes/tinystr.cpp new file mode 100644 index 0000000..0665768 --- /dev/null +++ b/connor_erp_mes/tinystr.cpp @@ -0,0 +1,111 @@ +/* +www.sourceforge.net/projects/tinyxml + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + + +#ifndef TIXML_USE_STL + +#include "tinystr.h" + +// Error value for find primitive +const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); + + +// Null rep. +TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; + + +void TiXmlString::reserve (size_type cap) +{ + if (cap > capacity()) + { + TiXmlString tmp; + tmp.init(length(), cap); + memcpy(tmp.start(), data(), length()); + swap(tmp); + } +} + + +TiXmlString& TiXmlString::assign(const char* str, size_type len) +{ + size_type cap = capacity(); + if (len > cap || cap > 3*(len + 8)) + { + TiXmlString tmp; + tmp.init(len); + memcpy(tmp.start(), str, len); + swap(tmp); + } + else + { + memmove(start(), str, len); + set_size(len); + } + return *this; +} + + +TiXmlString& TiXmlString::append(const char* str, size_type len) +{ + size_type newsize = length() + len; + if (newsize > capacity()) + { + reserve (newsize + capacity()); + } + memmove(finish(), str, len); + set_size(newsize); + return *this; +} + + +TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) +{ + TiXmlString tmp; + tmp.reserve(a.length() + b.length()); + tmp += a; + tmp += b; + return tmp; +} + +TiXmlString operator + (const TiXmlString & a, const char* b) +{ + TiXmlString tmp; + TiXmlString::size_type b_len = static_cast( strlen(b) ); + tmp.reserve(a.length() + b_len); + tmp += a; + tmp.append(b, b_len); + return tmp; +} + +TiXmlString operator + (const char* a, const TiXmlString & b) +{ + TiXmlString tmp; + TiXmlString::size_type a_len = static_cast( strlen(a) ); + tmp.reserve(a_len + b.length()); + tmp.append(a, a_len); + tmp += b; + return tmp; +} + + +#endif // TIXML_USE_STL diff --git a/connor_erp_mes/tinystr.h b/connor_erp_mes/tinystr.h new file mode 100644 index 0000000..89cca33 --- /dev/null +++ b/connor_erp_mes/tinystr.h @@ -0,0 +1,305 @@ +/* +www.sourceforge.net/projects/tinyxml + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + + +#ifndef TIXML_USE_STL + +#ifndef TIXML_STRING_INCLUDED +#define TIXML_STRING_INCLUDED + +#include +#include + +/* The support for explicit isn't that universal, and it isn't really + required - it is used to check that the TiXmlString class isn't incorrectly + used. Be nice to old compilers and macro it here: +*/ +#if defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + #define TIXML_EXPLICIT explicit +#elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + #define TIXML_EXPLICIT explicit +#else + #define TIXML_EXPLICIT +#endif + + +/* + TiXmlString is an emulation of a subset of the std::string template. + Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. + Only the member functions relevant to the TinyXML project have been implemented. + The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase + a string and there's no more room, we allocate a buffer twice as big as we need. +*/ +class TiXmlString +{ + public : + // The size type used + typedef size_t size_type; + + // Error value for find primitive + static const size_type npos; // = -1; + + + // TiXmlString empty constructor + TiXmlString () : rep_(&nullrep_) + { + } + + // TiXmlString copy constructor + TiXmlString ( const TiXmlString & copy) : rep_(0) + { + init(copy.length()); + memcpy(start(), copy.data(), length()); + } + + // TiXmlString constructor, based on a string + TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) + { + init( static_cast( strlen(copy) )); + memcpy(start(), copy, length()); + } + + // TiXmlString constructor, based on a string + TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0) + { + init(len); + memcpy(start(), str, len); + } + + // TiXmlString destructor + ~TiXmlString () + { + quit(); + } + + TiXmlString& operator = (const char * copy) + { + return assign( copy, (size_type)strlen(copy)); + } + + TiXmlString& operator = (const TiXmlString & copy) + { + return assign(copy.start(), copy.length()); + } + + + // += operator. Maps to append + TiXmlString& operator += (const char * suffix) + { + return append(suffix, static_cast( strlen(suffix) )); + } + + // += operator. Maps to append + TiXmlString& operator += (char single) + { + return append(&single, 1); + } + + // += operator. Maps to append + TiXmlString& operator += (const TiXmlString & suffix) + { + return append(suffix.data(), suffix.length()); + } + + + // Convert a TiXmlString into a null-terminated char * + const char * c_str () const { return rep_->str; } + + // Convert a TiXmlString into a char * (need not be null terminated). + const char * data () const { return rep_->str; } + + // Return the length of a TiXmlString + size_type length () const { return rep_->size; } + + // Alias for length() + size_type size () const { return rep_->size; } + + // Checks if a TiXmlString is empty + bool empty () const { return rep_->size == 0; } + + // Return capacity of string + size_type capacity () const { return rep_->capacity; } + + + // single char extraction + const char& at (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // [] operator + char& operator [] (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // find a char in a string. Return TiXmlString::npos if not found + size_type find (char lookup) const + { + return find(lookup, 0); + } + + // find a char in a string from an offset. Return TiXmlString::npos if not found + size_type find (char tofind, size_type offset) const + { + if (offset >= length()) return npos; + + for (const char* p = c_str() + offset; *p != '\0'; ++p) + { + if (*p == tofind) return static_cast< size_type >( p - c_str() ); + } + return npos; + } + + void clear () + { + //Lee: + //The original was just too strange, though correct: + // TiXmlString().swap(*this); + //Instead use the quit & re-init: + quit(); + init(0,0); + } + + /* Function to reserve a big amount of data when we know we'll need it. Be aware that this + function DOES NOT clear the content of the TiXmlString if any exists. + */ + void reserve (size_type cap); + + TiXmlString& assign (const char* str, size_type len); + + TiXmlString& append (const char* str, size_type len); + + void swap (TiXmlString& other) + { + Rep* r = rep_; + rep_ = other.rep_; + other.rep_ = r; + } + + private: + + void init(size_type sz) { init(sz, sz); } + void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } + char* start() const { return rep_->str; } + char* finish() const { return rep_->str + rep_->size; } + + struct Rep + { + size_type size, capacity; + char str[1]; + }; + + void init(size_type sz, size_type cap) + { + if (cap) + { + // Lee: the original form: + // rep_ = static_cast(operator new(sizeof(Rep) + cap)); + // doesn't work in some cases of new being overloaded. Switching + // to the normal allocation, although use an 'int' for systems + // that are overly picky about structure alignment. + const size_type bytesNeeded = sizeof(Rep) + cap; + const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); + rep_ = reinterpret_cast( new int[ intsNeeded ] ); + + rep_->str[ rep_->size = sz ] = '\0'; + rep_->capacity = cap; + } + else + { + rep_ = &nullrep_; + } + } + + void quit() + { + if (rep_ != &nullrep_) + { + // The rep_ is really an array of ints. (see the allocator, above). + // Cast it back before delete, so the compiler won't incorrectly call destructors. + delete [] ( reinterpret_cast( rep_ ) ); + } + } + + Rep * rep_; + static Rep nullrep_; + +} ; + + +inline bool operator == (const TiXmlString & a, const TiXmlString & b) +{ + return ( a.length() == b.length() ) // optimization on some platforms + && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare +} +inline bool operator < (const TiXmlString & a, const TiXmlString & b) +{ + return strcmp(a.c_str(), b.c_str()) < 0; +} + +inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } +inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } +inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } +inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } + +inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } +inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } +inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } +inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } + +TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); +TiXmlString operator + (const TiXmlString & a, const char* b); +TiXmlString operator + (const char* a, const TiXmlString & b); + + +/* + TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. + Only the operators that we need for TinyXML have been developped. +*/ +class TiXmlOutStream : public TiXmlString +{ +public : + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const TiXmlString & in) + { + *this += in; + return *this; + } + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const char * in) + { + *this += in; + return *this; + } + +} ; + +#endif // TIXML_STRING_INCLUDED +#endif // TIXML_USE_STL diff --git a/connor_erp_mes/tinyxml.cpp b/connor_erp_mes/tinyxml.cpp new file mode 100644 index 0000000..fb3ed5a --- /dev/null +++ b/connor_erp_mes/tinyxml.cpp @@ -0,0 +1,1886 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#include + +#ifdef TIXML_USE_STL +#include +#include +#endif + +#include "tinyxml.h" + +FILE* TiXmlFOpen( const char* filename, const char* mode ); + +bool TiXmlBase::condenseWhiteSpace = true; + +// Microsoft compiler security +FILE* TiXmlFOpen( const char* filename, const char* mode ) +{ + #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) + FILE* fp = 0; + errno_t err = fopen_s( &fp, filename, mode ); + if ( !err && fp ) + return fp; + return 0; + #else + return fopen( filename, mode ); + #endif +} + +void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString ) +{ + int i=0; + + while( i<(int)str.length() ) + { + unsigned char c = (unsigned char) str[i]; + + if ( c == '&' + && i < ( (int)str.length() - 2 ) + && str[i+1] == '#' + && str[i+2] == 'x' ) + { + // Hexadecimal character reference. + // Pass through unchanged. + // © -- copyright symbol, for example. + // + // The -1 is a bug fix from Rob Laveaux. It keeps + // an overflow from happening if there is no ';'. + // There are actually 2 ways to exit this loop - + // while fails (error case) and break (semicolon found). + // However, there is no mechanism (currently) for + // this function to return an error. + while ( i<(int)str.length()-1 ) + { + outString->append( str.c_str() + i, 1 ); + ++i; + if ( str[i] == ';' ) + break; + } + } + else if ( c == '&' ) + { + outString->append( entity[0].str, entity[0].strLength ); + ++i; + } + else if ( c == '<' ) + { + outString->append( entity[1].str, entity[1].strLength ); + ++i; + } + else if ( c == '>' ) + { + outString->append( entity[2].str, entity[2].strLength ); + ++i; + } + else if ( c == '\"' ) + { + outString->append( entity[3].str, entity[3].strLength ); + ++i; + } + else if ( c == '\'' ) + { + outString->append( entity[4].str, entity[4].strLength ); + ++i; + } + else if ( c < 32 ) + { + // Easy pass at non-alpha/numeric/symbol + // Below 32 is symbolic. + char buf[ 32 ]; + + #if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); + #else + sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); + #endif + + //*ME: warning C4267: convert 'size_t' to 'int' + //*ME: Int-Cast to make compiler happy ... + outString->append( buf, (int)strlen( buf ) ); + ++i; + } + else + { + //char realc = (char) c; + //outString->append( &realc, 1 ); + *outString += (char) c; // somewhat more efficient function call. + ++i; + } + } +} + + +TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() +{ + parent = 0; + type = _type; + firstChild = 0; + lastChild = 0; + prev = 0; + next = 0; +} + + +TiXmlNode::~TiXmlNode() +{ + TiXmlNode* node = firstChild; + TiXmlNode* temp = 0; + + while ( node ) + { + temp = node; + node = node->next; + delete temp; + } +} + + +void TiXmlNode::CopyTo( TiXmlNode* target ) const +{ + target->SetValue (value.c_str() ); + target->userData = userData; + target->location = location; +} + + +void TiXmlNode::Clear() +{ + TiXmlNode* node = firstChild; + TiXmlNode* temp = 0; + + while ( node ) + { + temp = node; + node = node->next; + delete temp; + } + + firstChild = 0; + lastChild = 0; +} + + +TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) +{ + assert( node->parent == 0 || node->parent == this ); + assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); + + if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT ) + { + delete node; + if ( GetDocument() ) + GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + node->parent = this; + + node->prev = lastChild; + node->next = 0; + + if ( lastChild ) + lastChild->next = node; + else + firstChild = node; // it was an empty list. + + lastChild = node; + return node; +} + + +TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) +{ + if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT ) + { + if ( GetDocument() ) + GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + TiXmlNode* node = addThis.Clone(); + if ( !node ) + return 0; + + return LinkEndChild( node ); +} + + +TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) +{ + if ( !beforeThis || beforeThis->parent != this ) { + return 0; + } + if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT ) + { + if ( GetDocument() ) + GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + TiXmlNode* node = addThis.Clone(); + if ( !node ) + return 0; + node->parent = this; + + node->next = beforeThis; + node->prev = beforeThis->prev; + if ( beforeThis->prev ) + { + beforeThis->prev->next = node; + } + else + { + assert( firstChild == beforeThis ); + firstChild = node; + } + beforeThis->prev = node; + return node; +} + + +TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) +{ + if ( !afterThis || afterThis->parent != this ) { + return 0; + } + if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT ) + { + if ( GetDocument() ) + GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + TiXmlNode* node = addThis.Clone(); + if ( !node ) + return 0; + node->parent = this; + + node->prev = afterThis; + node->next = afterThis->next; + if ( afterThis->next ) + { + afterThis->next->prev = node; + } + else + { + assert( lastChild == afterThis ); + lastChild = node; + } + afterThis->next = node; + return node; +} + + +TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) +{ + if ( !replaceThis ) + return 0; + + if ( replaceThis->parent != this ) + return 0; + + if ( withThis.ToDocument() ) { + // A document can never be a child. Thanks to Noam. + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + TiXmlNode* node = withThis.Clone(); + if ( !node ) + return 0; + + node->next = replaceThis->next; + node->prev = replaceThis->prev; + + if ( replaceThis->next ) + replaceThis->next->prev = node; + else + lastChild = node; + + if ( replaceThis->prev ) + replaceThis->prev->next = node; + else + firstChild = node; + + delete replaceThis; + node->parent = this; + return node; +} + + +bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) +{ + if ( !removeThis ) { + return false; + } + + if ( removeThis->parent != this ) + { + assert( 0 ); + return false; + } + + if ( removeThis->next ) + removeThis->next->prev = removeThis->prev; + else + lastChild = removeThis->prev; + + if ( removeThis->prev ) + removeThis->prev->next = removeThis->next; + else + firstChild = removeThis->next; + + //delete removeThis; kk Ҫɾ + return true; +} + +const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = firstChild; node; node = node->next ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = lastChild; node; node = node->prev ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const +{ + if ( !previous ) + { + return FirstChild(); + } + else + { + assert( previous->parent == this ); + return previous->NextSibling(); + } +} + + +const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const +{ + if ( !previous ) + { + return FirstChild( val ); + } + else + { + assert( previous->parent == this ); + return previous->NextSibling( val ); + } +} + + +const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = next; node; node = node->next ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = prev; node; node = node->prev ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +void TiXmlElement::RemoveAttribute( const char * name ) +{ + #ifdef TIXML_USE_STL + TIXML_STRING str( name ); + TiXmlAttribute* node = attributeSet.Find( str ); + #else + TiXmlAttribute* node = attributeSet.Find( name ); + #endif + if ( node ) + { + attributeSet.Remove( node ); + delete node; + } +} + +const TiXmlElement* TiXmlNode::FirstChildElement() const +{ + const TiXmlNode* node; + + for ( node = FirstChild(); + node; + node = node->NextSibling() ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const +{ + const TiXmlNode* node; + + for ( node = FirstChild( _value ); + node; + node = node->NextSibling( _value ) ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlElement* TiXmlNode::NextSiblingElement() const +{ + const TiXmlNode* node; + + for ( node = NextSibling(); + node; + node = node->NextSibling() ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const +{ + const TiXmlNode* node; + + for ( node = NextSibling( _value ); + node; + node = node->NextSibling( _value ) ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlDocument* TiXmlNode::GetDocument() const +{ + const TiXmlNode* node; + + for( node = this; node; node = node->parent ) + { + if ( node->ToDocument() ) + return node->ToDocument(); + } + return 0; +} + + +TiXmlElement::TiXmlElement (const char * _value) + : TiXmlNode( TiXmlNode::TINYXML_ELEMENT ) +{ + firstChild = lastChild = 0; + value = _value; +} + + +#ifdef TIXML_USE_STL +TiXmlElement::TiXmlElement( const std::string& _value ) + : TiXmlNode( TiXmlNode::TINYXML_ELEMENT ) +{ + firstChild = lastChild = 0; + value = _value; +} +#endif + + +TiXmlElement::TiXmlElement( const TiXmlElement& copy) + : TiXmlNode( TiXmlNode::TINYXML_ELEMENT ) +{ + firstChild = lastChild = 0; + copy.CopyTo( this ); +} + + +TiXmlElement& TiXmlElement::operator=( const TiXmlElement& base ) +{ + ClearThis(); + base.CopyTo( this ); + return *this; +} + + +TiXmlElement::~TiXmlElement() +{ + ClearThis(); +} + + +void TiXmlElement::ClearThis() +{ + Clear(); + while( attributeSet.First() ) + { + TiXmlAttribute* node = attributeSet.First(); + attributeSet.Remove( node ); + delete node; + } +} + + +const char* TiXmlElement::Attribute( const char* name ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( node ) + return node->Value(); + return 0; +} + + +#ifdef TIXML_USE_STL +const std::string* TiXmlElement::Attribute( const std::string& name ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + if ( attrib ) + return &attrib->ValueStr(); + return 0; +} +#endif + + +const char* TiXmlElement::Attribute( const char* name, int* i ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + const char* result = 0; + + if ( attrib ) { + result = attrib->Value(); + if ( i ) { + attrib->QueryIntValue( i ); + } + } + return result; +} + + +#ifdef TIXML_USE_STL +const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + const std::string* result = 0; + + if ( attrib ) { + result = &attrib->ValueStr(); + if ( i ) { + attrib->QueryIntValue( i ); + } + } + return result; +} +#endif + + +const char* TiXmlElement::Attribute( const char* name, double* d ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + const char* result = 0; + + if ( attrib ) { + result = attrib->Value(); + if ( d ) { + attrib->QueryDoubleValue( d ); + } + } + return result; +} + + +#ifdef TIXML_USE_STL +const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + const std::string* result = 0; + + if ( attrib ) { + result = &attrib->ValueStr(); + if ( d ) { + attrib->QueryDoubleValue( d ); + } + } + return result; +} +#endif + + +int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + if ( !attrib ) + return TIXML_NO_ATTRIBUTE; + return attrib->QueryIntValue( ival ); +} + + +int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* value ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + + int ival = 0; + int result = node->QueryIntValue( &ival ); + *value = (unsigned)ival; + return result; +} + + +int TiXmlElement::QueryBoolAttribute( const char* name, bool* bval ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + + int result = TIXML_WRONG_TYPE; + if ( StringEqual( node->Value(), "true", true, TIXML_ENCODING_UNKNOWN ) + || StringEqual( node->Value(), "yes", true, TIXML_ENCODING_UNKNOWN ) + || StringEqual( node->Value(), "1", true, TIXML_ENCODING_UNKNOWN ) ) + { + *bval = true; + result = TIXML_SUCCESS; + } + else if ( StringEqual( node->Value(), "false", true, TIXML_ENCODING_UNKNOWN ) + || StringEqual( node->Value(), "no", true, TIXML_ENCODING_UNKNOWN ) + || StringEqual( node->Value(), "0", true, TIXML_ENCODING_UNKNOWN ) ) + { + *bval = false; + result = TIXML_SUCCESS; + } + return result; +} + + + +#ifdef TIXML_USE_STL +int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + if ( !attrib ) + return TIXML_NO_ATTRIBUTE; + return attrib->QueryIntValue( ival ); +} +#endif + + +int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + if ( !attrib ) + return TIXML_NO_ATTRIBUTE; + return attrib->QueryDoubleValue( dval ); +} + + +#ifdef TIXML_USE_STL +int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const +{ + const TiXmlAttribute* attrib = attributeSet.Find( name ); + if ( !attrib ) + return TIXML_NO_ATTRIBUTE; + return attrib->QueryDoubleValue( dval ); +} +#endif + + +void TiXmlElement::SetAttribute( const char * name, int val ) +{ + TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); + if ( attrib ) { + attrib->SetIntValue( val ); + } +} + + +#ifdef TIXML_USE_STL +void TiXmlElement::SetAttribute( const std::string& name, int val ) +{ + TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); + if ( attrib ) { + attrib->SetIntValue( val ); + } +} +#endif + + +void TiXmlElement::SetDoubleAttribute( const char * name, double val ) +{ + TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); + if ( attrib ) { + attrib->SetDoubleValue( val ); + } +} + + +#ifdef TIXML_USE_STL +void TiXmlElement::SetDoubleAttribute( const std::string& name, double val ) +{ + TiXmlAttribute* attrib = attributeSet.FindOrCreate( name ); + if ( attrib ) { + attrib->SetDoubleValue( val ); + } +} +#endif + + +void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) +{ + TiXmlAttribute* attrib = attributeSet.FindOrCreate( cname ); + if ( attrib ) { + attrib->SetValue( cvalue ); + } +} + + +#ifdef TIXML_USE_STL +void TiXmlElement::SetAttribute( const std::string& _name, const std::string& _value ) +{ + TiXmlAttribute* attrib = attributeSet.FindOrCreate( _name ); + if ( attrib ) { + attrib->SetValue( _value ); + } +} +#endif + + +void TiXmlElement::Print( FILE* cfile, int depth ) const +{ + int i; + assert( cfile ); + for ( i=0; iNext() ) + { + fprintf( cfile, " " ); + attrib->Print( cfile, depth ); + } + + // There are 3 different formatting approaches: + // 1) An element without children is printed as a node + // 2) An element with only a text child is printed as text + // 3) An element with children is printed on multiple lines. + TiXmlNode* node; + if ( !firstChild ) + { + fprintf( cfile, " />" ); + } + else if ( firstChild == lastChild && firstChild->ToText() ) + { + fprintf( cfile, ">" ); + firstChild->Print( cfile, depth + 1 ); + fprintf( cfile, "", value.c_str() ); + } + else + { + fprintf( cfile, ">" ); + + for ( node = firstChild; node; node=node->NextSibling() ) + { + if ( !node->ToText() ) + { + fprintf( cfile, "\n" ); + } + node->Print( cfile, depth+1 ); + } + fprintf( cfile, "\n" ); + for( i=0; i", value.c_str() ); + } +} + + +void TiXmlElement::CopyTo( TiXmlElement* target ) const +{ + // superclass: + TiXmlNode::CopyTo( target ); + + // Element class: + // Clone the attributes, then clone the children. + const TiXmlAttribute* attribute = 0; + for( attribute = attributeSet.First(); + attribute; + attribute = attribute->Next() ) + { + target->SetAttribute( attribute->Name(), attribute->Value() ); + } + + TiXmlNode* node = 0; + for ( node = firstChild; node; node = node->NextSibling() ) + { + target->LinkEndChild( node->Clone() ); + } +} + +bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const +{ + if ( visitor->VisitEnter( *this, attributeSet.First() ) ) + { + for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) + { + if ( !node->Accept( visitor ) ) + break; + } + } + return visitor->VisitExit( *this ); +} + + +TiXmlNode* TiXmlElement::Clone() const +{ + TiXmlElement* clone = new TiXmlElement( Value() ); + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +const char* TiXmlElement::GetText() const +{ + const TiXmlNode* child = this->FirstChild(); + if ( child ) { + const TiXmlText* childText = child->ToText(); + if ( childText ) { + return childText->Value(); + } + } + return 0; +} + + +TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) +{ + tabsize = 4; + useMicrosoftBOM = true; + ClearError(); +} + +TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) +{ + tabsize = 4; + useMicrosoftBOM = true; + value = documentName; + ClearError(); +} + + +#ifdef TIXML_USE_STL +TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) +{ + tabsize = 4; + useMicrosoftBOM = true; + value = documentName; + ClearError(); +} +#endif + + +TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT ) +{ + copy.CopyTo( this ); +} + + +TiXmlDocument& TiXmlDocument::operator=( const TiXmlDocument& copy ) +{ + Clear(); + copy.CopyTo( this ); + return *this; +} + + +bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) +{ + return LoadFile( Value(), encoding ); +} + + +bool TiXmlDocument::SaveFile() const +{ + return SaveFile( Value() ); +} + +bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) +{ + TIXML_STRING filename( _filename ); + value = filename; + + // reading in binary mode so that tinyxml can normalize the EOL + FILE* file = TiXmlFOpen( value.c_str (), "rb" ); + + if ( file ) + { + bool result = LoadFile( file, encoding ); + fclose( file ); + return result; + } + else + { + SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } +} + +bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) +{ + if ( !file ) + { + SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } + + // Delete the existing data: + Clear(); + location.Clear(); + + // Get the file size, so we can pre-allocate the string. HUGE speed impact. + long length = 0; + fseek( file, 0, SEEK_END ); + length = ftell( file ); + fseek( file, 0, SEEK_SET ); + + // Strange case, but good to handle up front. + if ( length <= 0 ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } + + // Subtle bug here. TinyXml did use fgets. But from the XML spec: + // 2.11 End-of-Line Handling + // + // + // ...the XML processor MUST behave as if it normalized all line breaks in external + // parsed entities (including the document entity) on input, before parsing, by translating + // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to + // a single #xA character. + // + // + // It is not clear fgets does that, and certainly isn't clear it works cross platform. + // Generally, you expect fgets to translate from the convention of the OS to the c/unix + // convention, and not work generally. + + /* + while( fgets( buf, sizeof(buf), file ) ) + { + data += buf; + } + */ + + char* buf = new char[ length+1 ]; + buf[0] = 0; + + if ( fread( buf, length, 1, file ) != 1 ) { + delete [] buf; + SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } + + // Process the buffer in place to normalize new lines. (See comment above.) + // Copies from the 'p' to 'q' pointer, where p can advance faster if + // a newline-carriage return is hit. + // + // Wikipedia: + // Systems based on ASCII or a compatible character set use either LF (Line feed, '\n', 0x0A, 10 in decimal) or + // CR (Carriage return, '\r', 0x0D, 13 in decimal) individually, or CR followed by LF (CR+LF, 0x0D 0x0A)... + // * LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others + // * CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS, OS/2, Microsoft Windows, Symbian OS + // * CR: Commodore 8-bit machines, Apple II family, Mac OS up to version 9 and OS-9 + + const char* p = buf; // the read head + char* q = buf; // the write head + const char CR = 0x0d; + const char LF = 0x0a; + + buf[length] = 0; + while( *p ) { + assert( p < (buf+length) ); + assert( q <= (buf+length) ); + assert( q <= p ); + + if ( *p == CR ) { + *q++ = LF; + p++; + if ( *p == LF ) { // check for CR+LF (and skip LF) + p++; + } + } + else { + *q++ = *p++; + } + } + assert( q <= (buf+length) ); + *q = 0; + + Parse( buf, 0, encoding ); + + delete [] buf; + return !Error(); +} + + +bool TiXmlDocument::SaveFile( const char * filename ) const +{ + // The old c stuff lives on... + FILE* fp = TiXmlFOpen( filename, "w" ); + if ( fp ) + { + bool result = SaveFile( fp ); + fclose( fp ); + return result; + } + return false; +} + + +bool TiXmlDocument::SaveFile( FILE* fp ) const +{ + if ( useMicrosoftBOM ) + { + const unsigned char TIXML_UTF_LEAD_0 = 0xefU; + const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; + const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; + + fputc( TIXML_UTF_LEAD_0, fp ); + fputc( TIXML_UTF_LEAD_1, fp ); + fputc( TIXML_UTF_LEAD_2, fp ); + } + Print( fp, 0 ); + return (ferror(fp) == 0); +} + + +void TiXmlDocument::CopyTo( TiXmlDocument* target ) const +{ + TiXmlNode::CopyTo( target ); + + target->error = error; + target->errorId = errorId; + target->errorDesc = errorDesc; + target->tabsize = tabsize; + target->errorLocation = errorLocation; + target->useMicrosoftBOM = useMicrosoftBOM; + + TiXmlNode* node = 0; + for ( node = firstChild; node; node = node->NextSibling() ) + { + target->LinkEndChild( node->Clone() ); + } +} + + +TiXmlNode* TiXmlDocument::Clone() const +{ + TiXmlDocument* clone = new TiXmlDocument(); + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +void TiXmlDocument::Print( FILE* cfile, int depth ) const +{ + assert( cfile ); + for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) + { + node->Print( cfile, depth ); + fprintf( cfile, "\n" ); + } +} + + +bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const +{ + if ( visitor->VisitEnter( *this ) ) + { + for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) + { + if ( !node->Accept( visitor ) ) + break; + } + } + return visitor->VisitExit( *this ); +} + + +const TiXmlAttribute* TiXmlAttribute::Next() const +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( next->value.empty() && next->name.empty() ) + return 0; + return next; +} + +/* +TiXmlAttribute* TiXmlAttribute::Next() +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( next->value.empty() && next->name.empty() ) + return 0; + return next; +} +*/ + +const TiXmlAttribute* TiXmlAttribute::Previous() const +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( prev->value.empty() && prev->name.empty() ) + return 0; + return prev; +} + +/* +TiXmlAttribute* TiXmlAttribute::Previous() +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( prev->value.empty() && prev->name.empty() ) + return 0; + return prev; +} +*/ + +void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const +{ + TIXML_STRING n, v; + + EncodeString( name, &n ); + EncodeString( value, &v ); + + if (value.find ('\"') == TIXML_STRING::npos) { + if ( cfile ) { + fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); + } + if ( str ) { + (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\""; + } + } + else { + if ( cfile ) { + fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); + } + if ( str ) { + (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'"; + } + } +} + + +int TiXmlAttribute::QueryIntValue( int* ival ) const +{ + if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; +} + +int TiXmlAttribute::QueryDoubleValue( double* dval ) const +{ + if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; +} + +void TiXmlAttribute::SetIntValue( int _value ) +{ + char buf [64]; + #if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); + #else + sprintf (buf, "%d", _value); + #endif + SetValue (buf); +} + +void TiXmlAttribute::SetDoubleValue( double _value ) +{ + char buf [256]; + #if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF( buf, sizeof(buf), "%g", _value); + #else + sprintf (buf, "%g", _value); + #endif + SetValue (buf); +} + +int TiXmlAttribute::IntValue() const +{ + return atoi (value.c_str ()); +} + +double TiXmlAttribute::DoubleValue() const +{ + return atof (value.c_str ()); +} + + +TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::TINYXML_COMMENT ) +{ + copy.CopyTo( this ); +} + + +TiXmlComment& TiXmlComment::operator=( const TiXmlComment& base ) +{ + Clear(); + base.CopyTo( this ); + return *this; +} + + +void TiXmlComment::Print( FILE* cfile, int depth ) const +{ + assert( cfile ); + for ( int i=0; i", value.c_str() ); +} + + +void TiXmlComment::CopyTo( TiXmlComment* target ) const +{ + TiXmlNode::CopyTo( target ); +} + + +bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlComment::Clone() const +{ + TiXmlComment* clone = new TiXmlComment(); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +void TiXmlText::Print( FILE* cfile, int depth ) const +{ + assert( cfile ); + if ( cdata ) + { + int i; + fprintf( cfile, "\n" ); + for ( i=0; i\n", value.c_str() ); // unformatted output + } + else + { + TIXML_STRING buffer; + EncodeString( value, &buffer ); + fprintf( cfile, "%s", buffer.c_str() ); + } +} + + +void TiXmlText::CopyTo( TiXmlText* target ) const +{ + TiXmlNode::CopyTo( target ); + target->cdata = cdata; +} + + +bool TiXmlText::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlText::Clone() const +{ + TiXmlText* clone = 0; + clone = new TiXmlText( "" ); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +TiXmlDeclaration::TiXmlDeclaration( const char * _version, + const char * _encoding, + const char * _standalone ) + : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) +{ + version = _version; + encoding = _encoding; + standalone = _standalone; +} + + +#ifdef TIXML_USE_STL +TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, + const std::string& _encoding, + const std::string& _standalone ) + : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) +{ + version = _version; + encoding = _encoding; + standalone = _standalone; +} +#endif + + +TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) + : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) +{ + copy.CopyTo( this ); +} + + +TiXmlDeclaration& TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) +{ + Clear(); + copy.CopyTo( this ); + return *this; +} + + +void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const +{ + if ( cfile ) fprintf( cfile, "" ); + if ( str ) (*str) += "?>"; +} + + +void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const +{ + TiXmlNode::CopyTo( target ); + + target->version = version; + target->encoding = encoding; + target->standalone = standalone; +} + + +bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlDeclaration::Clone() const +{ + TiXmlDeclaration* clone = new TiXmlDeclaration(); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +void TiXmlUnknown::Print( FILE* cfile, int depth ) const +{ + for ( int i=0; i", value.c_str() ); +} + + +void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const +{ + TiXmlNode::CopyTo( target ); +} + + +bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlUnknown::Clone() const +{ + TiXmlUnknown* clone = new TiXmlUnknown(); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +TiXmlAttributeSet::TiXmlAttributeSet() +{ + sentinel.next = &sentinel; + sentinel.prev = &sentinel; +} + + +TiXmlAttributeSet::~TiXmlAttributeSet() +{ + assert( sentinel.next == &sentinel ); + assert( sentinel.prev == &sentinel ); +} + + +void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) +{ + #ifdef TIXML_USE_STL + assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. + #else + assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. + #endif + + addMe->next = &sentinel; + addMe->prev = sentinel.prev; + + sentinel.prev->next = addMe; + sentinel.prev = addMe; +} + +void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) +{ + TiXmlAttribute* node; + + for( node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( node == removeMe ) + { + node->prev->next = node->next; + node->next->prev = node->prev; + node->next = 0; + node->prev = 0; + return; + } + } + assert( 0 ); // we tried to remove a non-linked attribute. +} + + +#ifdef TIXML_USE_STL +TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const +{ + for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( node->name == name ) + return node; + } + return 0; +} + +TiXmlAttribute* TiXmlAttributeSet::FindOrCreate( const std::string& _name ) +{ + TiXmlAttribute* attrib = Find( _name ); + if ( !attrib ) { + attrib = new TiXmlAttribute(); + Add( attrib ); + attrib->SetName( _name ); + } + return attrib; +} +#endif + + +TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const +{ + for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( strcmp( node->name.c_str(), name ) == 0 ) + return node; + } + return 0; +} + + +TiXmlAttribute* TiXmlAttributeSet::FindOrCreate( const char* _name ) +{ + TiXmlAttribute* attrib = Find( _name ); + if ( !attrib ) { + attrib = new TiXmlAttribute(); + Add( attrib ); + attrib->SetName( _name ); + } + return attrib; +} + + +#ifdef TIXML_USE_STL +std::istream& operator>> (std::istream & in, TiXmlNode & base) +{ + TIXML_STRING tag; + tag.reserve( 8 * 1000 ); + base.StreamIn( &in, &tag ); + + base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); + return in; +} +#endif + + +#ifdef TIXML_USE_STL +std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) +{ + TiXmlPrinter printer; + printer.SetStreamPrinting(); + base.Accept( &printer ); + out << printer.Str(); + + return out; +} + + +std::string& operator<< (std::string& out, const TiXmlNode& base ) +{ + TiXmlPrinter printer; + printer.SetStreamPrinting(); + base.Accept( &printer ); + out.append( printer.Str() ); + + return out; +} +#endif + + +TiXmlHandle TiXmlHandle::FirstChild() const +{ + if ( node ) + { + TiXmlNode* child = node->FirstChild(); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const +{ + if ( node ) + { + TiXmlNode* child = node->FirstChild( value ); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::FirstChildElement() const +{ + if ( node ) + { + TiXmlElement* child = node->FirstChildElement(); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const +{ + if ( node ) + { + TiXmlElement* child = node->FirstChildElement( value ); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::Child( int count ) const +{ + if ( node ) + { + int i; + TiXmlNode* child = node->FirstChild(); + for ( i=0; + child && iNextSibling(), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const +{ + if ( node ) + { + int i; + TiXmlNode* child = node->FirstChild( value ); + for ( i=0; + child && iNextSibling( value ), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::ChildElement( int count ) const +{ + if ( node ) + { + int i; + TiXmlElement* child = node->FirstChildElement(); + for ( i=0; + child && iNextSiblingElement(), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const +{ + if ( node ) + { + int i; + TiXmlElement* child = node->FirstChildElement( value ); + for ( i=0; + child && iNextSiblingElement( value ), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) +{ + return true; +} + +bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) +{ + return true; +} + +bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) +{ + DoIndent(); + buffer += "<"; + buffer += element.Value(); + + for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) + { + buffer += " "; + attrib->Print( 0, 0, &buffer ); + } + + if ( !element.FirstChild() ) + { + buffer += " />"; + DoLineBreak(); + } + else + { + buffer += ">"; + if ( element.FirstChild()->ToText() + && element.LastChild() == element.FirstChild() + && element.FirstChild()->ToText()->CDATA() == false ) + { + simpleTextPrint = true; + // no DoLineBreak()! + } + else + { + DoLineBreak(); + } + } + ++depth; + return true; +} + + +bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) +{ + --depth; + if ( !element.FirstChild() ) + { + // nothing. + } + else + { + if ( simpleTextPrint ) + { + simpleTextPrint = false; + } + else + { + DoIndent(); + } + buffer += ""; + DoLineBreak(); + } + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlText& text ) +{ + if ( text.CDATA() ) + { + DoIndent(); + buffer += ""; + DoLineBreak(); + } + else if ( simpleTextPrint ) + { + TIXML_STRING str; + TiXmlBase::EncodeString( text.ValueTStr(), &str ); + buffer += str; + } + else + { + DoIndent(); + TIXML_STRING str; + TiXmlBase::EncodeString( text.ValueTStr(), &str ); + buffer += str; + DoLineBreak(); + } + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) +{ + DoIndent(); + declaration.Print( 0, 0, &buffer ); + DoLineBreak(); + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlComment& comment ) +{ + DoIndent(); + buffer += ""; + DoLineBreak(); + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) +{ + DoIndent(); + buffer += "<"; + buffer += unknown.Value(); + buffer += ">"; + DoLineBreak(); + return true; +} + diff --git a/connor_erp_mes/tinyxml.h b/connor_erp_mes/tinyxml.h new file mode 100644 index 0000000..a3589e5 --- /dev/null +++ b/connor_erp_mes/tinyxml.h @@ -0,0 +1,1805 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code by Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + + +#ifndef TINYXML_INCLUDED +#define TINYXML_INCLUDED + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4530 ) +#pragma warning( disable : 4786 ) +#endif + +#include +#include +#include +#include +#include + +// Help out windows: +#if defined( _DEBUG ) && !defined( DEBUG ) +#define DEBUG +#endif + +#ifdef TIXML_USE_STL + #include + #include + #include + #define TIXML_STRING std::string +#else + #include "tinystr.h" + #define TIXML_STRING TiXmlString +#endif + +// Deprecated library function hell. Compilers want to use the +// new safe versions. This probably doesn't fully address the problem, +// but it gets closer. There are too many compilers for me to fully +// test. If you get compilation troubles, undefine TIXML_SAFE +#define TIXML_SAFE + +#ifdef TIXML_SAFE + #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) + // Microsoft visual studio, version 2005 and higher. + #define TIXML_SNPRINTF _snprintf_s + #define TIXML_SSCANF sscanf_s + #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + //#pragma message( "Using _sn* functions." ) + #define TIXML_SNPRINTF _snprintf + #define TIXML_SSCANF sscanf + #elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + //#warning( "Using sn* functions." ) + #define TIXML_SNPRINTF snprintf + #define TIXML_SSCANF sscanf + #else + #define TIXML_SNPRINTF snprintf + #define TIXML_SSCANF sscanf + #endif +#endif + +class TiXmlDocument; +class TiXmlElement; +class TiXmlComment; +class TiXmlUnknown; +class TiXmlAttribute; +class TiXmlText; +class TiXmlDeclaration; +class TiXmlParsingData; + +const int TIXML_MAJOR_VERSION = 2; +const int TIXML_MINOR_VERSION = 6; +const int TIXML_PATCH_VERSION = 2; + +/* Internal structure for tracking location of items + in the XML file. +*/ +struct TiXmlCursor +{ + TiXmlCursor() { Clear(); } + void Clear() { row = col = -1; } + + int row; // 0 based. + int col; // 0 based. +}; + + +/** + Implements the interface to the "Visitor pattern" (see the Accept() method.) + If you call the Accept() method, it requires being passed a TiXmlVisitor + class to handle callbacks. For nodes that contain other nodes (Document, Element) + you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves + are simply called with Visit(). + + If you return 'true' from a Visit method, recursive parsing will continue. If you return + false, no children of this node or its sibilings will be Visited. + + All flavors of Visit methods have a default implementation that returns 'true' (continue + visiting). You need to only override methods that are interesting to you. + + Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting. + + You should never change the document from a callback. + + @sa TiXmlNode::Accept() +*/ +class TiXmlVisitor +{ +public: + virtual ~TiXmlVisitor() {} + + /// Visit a document. + virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; } + /// Visit a document. + virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; } + + /// Visit an element. + virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; } + /// Visit an element. + virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; } + + /// Visit a declaration + virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; } + /// Visit a text node + virtual bool Visit( const TiXmlText& /*text*/ ) { return true; } + /// Visit a comment node + virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; } + /// Visit an unknown node + virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; } +}; + +// Only used by Attribute::Query functions +enum +{ + TIXML_SUCCESS, + TIXML_NO_ATTRIBUTE, + TIXML_WRONG_TYPE +}; + + +// Used by the parsing routines. +enum TiXmlEncoding +{ + TIXML_ENCODING_UNKNOWN, + TIXML_ENCODING_UTF8, + TIXML_ENCODING_LEGACY +}; + +const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; + +/** TiXmlBase is a base class for every class in TinyXml. + It does little except to establish that TinyXml classes + can be printed and provide some utility functions. + + In XML, the document and elements can contain + other elements and other types of nodes. + + @verbatim + A Document can contain: Element (container or leaf) + Comment (leaf) + Unknown (leaf) + Declaration( leaf ) + + An Element can contain: Element (container or leaf) + Text (leaf) + Attributes (not on tree) + Comment (leaf) + Unknown (leaf) + + A Decleration contains: Attributes (not on tree) + @endverbatim +*/ +class TiXmlBase +{ + friend class TiXmlNode; + friend class TiXmlElement; + friend class TiXmlDocument; + +public: + TiXmlBase() : userData(0) {} + virtual ~TiXmlBase() {} + + /** All TinyXml classes can print themselves to a filestream + or the string class (TiXmlString in non-STL mode, std::string + in STL mode.) Either or both cfile and str can be null. + + This is a formatted print, and will insert + tabs and newlines. + + (For an unformatted stream, use the << operator.) + */ + virtual void Print( FILE* cfile, int depth ) const = 0; + + /** The world does not agree on whether white space should be kept or + not. In order to make everyone happy, these global, static functions + are provided to set whether or not TinyXml will condense all white space + into a single space or not. The default is to condense. Note changing this + value is not thread safe. + */ + static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } + + /// Return the current white space setting. + static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } + + /** Return the position, in the original source file, of this node or attribute. + The row and column are 1-based. (That is the first row and first column is + 1,1). If the returns values are 0 or less, then the parser does not have + a row and column value. + + Generally, the row and column value will be set when the TiXmlDocument::Load(), + TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set + when the DOM was created from operator>>. + + The values reflect the initial load. Once the DOM is modified programmatically + (by adding or changing nodes and attributes) the new values will NOT update to + reflect changes in the document. + + There is a minor performance cost to computing the row and column. Computation + can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. + + @sa TiXmlDocument::SetTabSize() + */ + int Row() const { return location.row + 1; } + int Column() const { return location.col + 1; } ///< See Row() + + void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. + void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. + const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. + + // Table that returs, for a given lead byte, the total number of bytes + // in the UTF-8 sequence. + static const int utf8ByteTable[256]; + + virtual const char* Parse( const char* p, + TiXmlParsingData* data, + TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; + + /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, + or they will be transformed into entities! + */ + static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out ); + + enum + { + TIXML_NO_ERROR = 0, + TIXML_ERROR, + TIXML_ERROR_OPENING_FILE, + TIXML_ERROR_PARSING_ELEMENT, + TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, + TIXML_ERROR_READING_ELEMENT_VALUE, + TIXML_ERROR_READING_ATTRIBUTES, + TIXML_ERROR_PARSING_EMPTY, + TIXML_ERROR_READING_END_TAG, + TIXML_ERROR_PARSING_UNKNOWN, + TIXML_ERROR_PARSING_COMMENT, + TIXML_ERROR_PARSING_DECLARATION, + TIXML_ERROR_DOCUMENT_EMPTY, + TIXML_ERROR_EMBEDDED_NULL, + TIXML_ERROR_PARSING_CDATA, + TIXML_ERROR_DOCUMENT_TOP_ONLY, + + TIXML_ERROR_STRING_COUNT + }; + +protected: + + static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); + + inline static bool IsWhiteSpace( char c ) + { + return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); + } + inline static bool IsWhiteSpace( int c ) + { + if ( c < 256 ) + return IsWhiteSpace( (char) c ); + return false; // Again, only truly correct for English/Latin...but usually works. + } + + #ifdef TIXML_USE_STL + static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); + static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); + #endif + + /* Reads an XML name into the string provided. Returns + a pointer just past the last character of the name, + or 0 if the function has an error. + */ + static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); + + /* Reads text. Returns a pointer past the given end tag. + Wickedly complex options, but it keeps the (sensitive) code in one place. + */ + static const char* ReadText( const char* in, // where to start + TIXML_STRING* text, // the string read + bool ignoreWhiteSpace, // whether to keep the white space + const char* endTag, // what ends this text + bool ignoreCase, // whether to ignore case in the end tag + TiXmlEncoding encoding ); // the current encoding + + // If an entity has been found, transform it into a character. + static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); + + // Get a character, while interpreting entities. + // The length can be from 0 to 4 bytes. + inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) + { + assert( p ); + if ( encoding == TIXML_ENCODING_UTF8 ) + { + *length = utf8ByteTable[ *((const unsigned char*)p) ]; + assert( *length >= 0 && *length < 5 ); + } + else + { + *length = 1; + } + + if ( *length == 1 ) + { + if ( *p == '&' ) + return GetEntity( p, _value, length, encoding ); + *_value = *p; + return p+1; + } + else if ( *length ) + { + //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), + // and the null terminator isn't needed + for( int i=0; p[i] && i<*length; ++i ) { + _value[i] = p[i]; + } + return p + (*length); + } + else + { + // Not valid text. + return 0; + } + } + + // Return true if the next characters in the stream are any of the endTag sequences. + // Ignore case only works for english, and should only be relied on when comparing + // to English words: StringEqual( p, "version", true ) is fine. + static bool StringEqual( const char* p, + const char* endTag, + bool ignoreCase, + TiXmlEncoding encoding ); + + static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; + + TiXmlCursor location; + + /// Field containing a generic user pointer + void* userData; + + // None of these methods are reliable for any language except English. + // Good for approximation, not great for accuracy. + static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); + static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); + inline static int ToLower( int v, TiXmlEncoding encoding ) + { + if ( encoding == TIXML_ENCODING_UTF8 ) + { + if ( v < 128 ) return tolower( v ); + return v; + } + else + { + return tolower( v ); + } + } + static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); + +private: + TiXmlBase( const TiXmlBase& ); // not implemented. + void operator=( const TiXmlBase& base ); // not allowed. + + struct Entity + { + const char* str; + unsigned int strLength; + char chr; + }; + enum + { + NUM_ENTITY = 5, + MAX_ENTITY_LENGTH = 6 + + }; + static Entity entity[ NUM_ENTITY ]; + static bool condenseWhiteSpace; +}; + + +/** The parent class for everything in the Document Object Model. + (Except for attributes). + Nodes have siblings, a parent, and children. A node can be + in a document, or stand on its own. The type of a TiXmlNode + can be queried, and it can be cast to its more defined type. +*/ +class TiXmlNode : public TiXmlBase +{ + friend class TiXmlDocument; + friend class TiXmlElement; + +public: + #ifdef TIXML_USE_STL + + /** An input stream operator, for every class. Tolerant of newlines and + formatting, but doesn't expect them. + */ + friend std::istream& operator >> (std::istream& in, TiXmlNode& base); + + /** An output stream operator, for every class. Note that this outputs + without any newlines or formatting, as opposed to Print(), which + includes tabs and new lines. + + The operator<< and operator>> are not completely symmetric. Writing + a node to a stream is very well defined. You'll get a nice stream + of output, without any extra whitespace or newlines. + + But reading is not as well defined. (As it always is.) If you create + a TiXmlElement (for example) and read that from an input stream, + the text needs to define an element or junk will result. This is + true of all input streams, but it's worth keeping in mind. + + A TiXmlDocument will read nodes until it reads a root element, and + all the children of that root element. + */ + friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); + + /// Appends the XML node or attribute to a std::string. + friend std::string& operator<< (std::string& out, const TiXmlNode& base ); + + #endif + + /** The types of XML nodes supported by TinyXml. (All the + unsupported types are picked up by UNKNOWN.) + */ + enum NodeType + { + TINYXML_DOCUMENT, + TINYXML_ELEMENT, + TINYXML_COMMENT, + TINYXML_UNKNOWN, + TINYXML_TEXT, + TINYXML_DECLARATION, + TINYXML_TYPECOUNT + }; + + virtual ~TiXmlNode(); + + /** The meaning of 'value' changes for the specific type of + TiXmlNode. + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + + The subclasses will wrap this function. + */ + const char *Value() const { return value.c_str (); } + + #ifdef TIXML_USE_STL + /** Return Value() as a std::string. If you only use STL, + this is more efficient than calling Value(). + Only available in STL mode. + */ + const std::string& ValueStr() const { return value; } + #endif + + const TIXML_STRING& ValueTStr() const { return value; } + + /** Changes the value of the node. Defined as: + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + */ + void SetValue(const char * _value) { value = _value;} + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetValue( const std::string& _value ) { value = _value; } + #endif + + /// Delete all the children of this node. Does not affect 'this'. + void Clear(); + + /// One step up the DOM. + TiXmlNode* Parent() { return parent; } + const TiXmlNode* Parent() const { return parent; } + + const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. + TiXmlNode* FirstChild() { return firstChild; } + const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. + /// The first child of this node with the matching 'value'. Will be null if none found. + TiXmlNode* FirstChild( const char * _value ) { + // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) + // call the method, cast the return back to non-const. + return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); + } + const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. + TiXmlNode* LastChild() { return lastChild; } + + const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. + TiXmlNode* LastChild( const char * _value ) { + return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. + #endif + + /** An alternate way to walk the children of a node. + One way to iterate over nodes is: + @verbatim + for( child = parent->FirstChild(); child; child = child->NextSibling() ) + @endverbatim + + IterateChildren does the same thing with the syntax: + @verbatim + child = 0; + while( child = parent->IterateChildren( child ) ) + @endverbatim + + IterateChildren takes the previous child as input and finds + the next one. If the previous child is null, it returns the + first. IterateChildren will return null when done. + */ + const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const TiXmlNode* previous ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); + } + + /// This flavor of IterateChildren searches for children with a particular 'value' + const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + #endif + + /** Add a new node related to this. Adds a child past the LastChild. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); + + + /** Add a new node related to this. Adds a child past the LastChild. + + NOTE: the node to be added is passed by pointer, and will be + henceforth owned (and deleted) by tinyXml. This method is efficient + and avoids an extra copy, but should be used with care as it + uses a different memory model than the other insert functions. + + @sa InsertEndChild + */ + TiXmlNode* LinkEndChild( TiXmlNode* addThis ); + + /** Add a new node related to this. Adds a child before the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); + + /** Add a new node related to this. Adds a child after the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); + + /** Replace a child of this node. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); + + /// Delete a child of this node. + bool RemoveChild( TiXmlNode* removeThis ); + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling() const { return prev; } + TiXmlNode* PreviousSibling() { return prev; } + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling( const char * ) const; + TiXmlNode* PreviousSibling( const char *_prev ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Navigate to a sibling node. + const TiXmlNode* NextSibling() const { return next; } + TiXmlNode* NextSibling() { return next; } + + /// Navigate to a sibling node with the given 'value'. + const TiXmlNode* NextSibling( const char * ) const; + TiXmlNode* NextSibling( const char* _next ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); + } + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement() const; + TiXmlElement* NextSiblingElement() { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); + } + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement( const char * ) const; + TiXmlElement* NextSiblingElement( const char *_next ) { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement() const; + TiXmlElement* FirstChildElement() { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); + } + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement( const char * _value ) const; + TiXmlElement* FirstChildElement( const char * _value ) { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /** Query the type (as an enumerated value, above) of this node. + The possible types are: TINYXML_DOCUMENT, TINYXML_ELEMENT, TINYXML_COMMENT, + TINYXML_UNKNOWN, TINYXML_TEXT, and TINYXML_DECLARATION. + */ + int Type() const { return type; } + + /** Return a pointer to the Document this node lives in. + Returns null if not in a document. + */ + const TiXmlDocument* GetDocument() const; + TiXmlDocument* GetDocument() { + return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); + } + + /// Returns true if this node has no children. + bool NoChildren() const { return !firstChild; } + + virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + + virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + + /** Create an exact duplicate of this node and return it. The memory must be deleted + by the caller. + */ + virtual TiXmlNode* Clone() const = 0; + + /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the + XML tree will be conditionally visited and the host will be called back + via the TiXmlVisitor interface. + + This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse + the XML for the callbacks, so the performance of TinyXML is unchanged by using this + interface versus any other.) + + The interface has been based on ideas from: + + - http://www.saxproject.org/ + - http://c2.com/cgi/wiki?HierarchicalVisitorPattern + + Which are both good references for "visiting". + + An example of using Accept(): + @verbatim + TiXmlPrinter printer; + tinyxmlDoc.Accept( &printer ); + const char* xmlcstr = printer.CStr(); + @endverbatim + */ + virtual bool Accept( TiXmlVisitor* visitor ) const = 0; + +protected: + TiXmlNode( NodeType _type ); + + // Copy to the allocated object. Shared functionality between Clone, Copy constructor, + // and the assignment operator. + void CopyTo( TiXmlNode* target ) const; + + #ifdef TIXML_USE_STL + // The real work of the input operator. + virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; + #endif + + // Figure out what is at *p, and parse it. Returns null if it is not an xml node. + TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); + + TiXmlNode* parent; + NodeType type; + + TiXmlNode* firstChild; + TiXmlNode* lastChild; + + TIXML_STRING value; + + TiXmlNode* prev; + TiXmlNode* next; + +private: + TiXmlNode( const TiXmlNode& ); // not implemented. + void operator=( const TiXmlNode& base ); // not allowed. +}; + + +/** An attribute is a name-value pair. Elements have an arbitrary + number of attributes, each with a unique name. + + @note The attributes are not TiXmlNodes, since they are not + part of the tinyXML document object model. There are other + suggested ways to look at this problem. +*/ +class TiXmlAttribute : public TiXmlBase +{ + friend class TiXmlAttributeSet; + +public: + /// Construct an empty attribute. + TiXmlAttribute() : TiXmlBase() + { + document = 0; + prev = next = 0; + } + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlAttribute( const std::string& _name, const std::string& _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + #endif + + /// Construct an attribute with a name and value. + TiXmlAttribute( const char * _name, const char * _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + + const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. + const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. + #ifdef TIXML_USE_STL + const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. + #endif + int IntValue() const; ///< Return the value of this attribute, converted to an integer. + double DoubleValue() const; ///< Return the value of this attribute, converted to a double. + + // Get the tinyxml string representation + const TIXML_STRING& NameTStr() const { return name; } + + /** QueryIntValue examines the value string. It is an alternative to the + IntValue() method with richer error checking. + If the value is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. + + A specialized but useful call. Note that for success it returns 0, + which is the opposite of almost all other TinyXml calls. + */ + int QueryIntValue( int* _value ) const; + /// QueryDoubleValue examines the value string. See QueryIntValue(). + int QueryDoubleValue( double* _value ) const; + + void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. + void SetValue( const char* _value ) { value = _value; } ///< Set the value. + + void SetIntValue( int _value ); ///< Set the value from an integer. + void SetDoubleValue( double _value ); ///< Set the value from a double. + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetName( const std::string& _name ) { name = _name; } + /// STL std::string form. + void SetValue( const std::string& _value ) { value = _value; } + #endif + + /// Get the next sibling attribute in the DOM. Returns null at end. + const TiXmlAttribute* Next() const; + TiXmlAttribute* Next() { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); + } + + /// Get the previous sibling attribute in the DOM. Returns null at beginning. + const TiXmlAttribute* Previous() const; + TiXmlAttribute* Previous() { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); + } + + bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } + bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } + bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } + + /* Attribute parsing starts: first letter of the name + returns: the next char after the value end quote + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + // Prints this Attribute to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const { + Print( cfile, depth, 0 ); + } + void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; + + // [internal use] + // Set the document pointer so the attribute can report errors. + void SetDocument( TiXmlDocument* doc ) { document = doc; } + +private: + TiXmlAttribute( const TiXmlAttribute& ); // not implemented. + void operator=( const TiXmlAttribute& base ); // not allowed. + + TiXmlDocument* document; // A pointer back to a document, for error reporting. + TIXML_STRING name; + TIXML_STRING value; + TiXmlAttribute* prev; + TiXmlAttribute* next; +}; + + +/* A class used to manage a group of attributes. + It is only used internally, both by the ELEMENT and the DECLARATION. + + The set can be changed transparent to the Element and Declaration + classes that use it, but NOT transparent to the Attribute + which has to implement a next() and previous() method. Which makes + it a bit problematic and prevents the use of STL. + + This version is implemented with circular lists because: + - I like circular lists + - it demonstrates some independence from the (typical) doubly linked list. +*/ +class TiXmlAttributeSet +{ +public: + TiXmlAttributeSet(); + ~TiXmlAttributeSet(); + + void Add( TiXmlAttribute* attribute ); + void Remove( TiXmlAttribute* attribute ); + + const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + + TiXmlAttribute* Find( const char* _name ) const; + TiXmlAttribute* FindOrCreate( const char* _name ); + +# ifdef TIXML_USE_STL + TiXmlAttribute* Find( const std::string& _name ) const; + TiXmlAttribute* FindOrCreate( const std::string& _name ); +# endif + + +private: + //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), + //*ME: this class must be also use a hidden/disabled copy-constructor !!! + TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed + void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) + + TiXmlAttribute sentinel; +}; + + +/** The element is a container class. It has a value, the element name, + and can contain other elements, text, comments, and unknowns. + Elements also contain an arbitrary number of attributes. +*/ +class TiXmlElement : public TiXmlNode +{ +public: + /// Construct an element. + TiXmlElement (const char * in_value); + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlElement( const std::string& _value ); + #endif + + TiXmlElement( const TiXmlElement& ); + + TiXmlElement& operator=( const TiXmlElement& base ); + + virtual ~TiXmlElement(); + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + */ + const char* Attribute( const char* name ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an integer, + the integer value will be put in the return 'i', if 'i' + is non-null. + */ + const char* Attribute( const char* name, int* i ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an double, + the double value will be put in the return 'd', if 'd' + is non-null. + */ + const char* Attribute( const char* name, double* d ) const; + + /** QueryIntAttribute examines the attribute - it is an alternative to the + Attribute() method with richer error checking. + If the attribute is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. If the attribute + does not exist, then TIXML_NO_ATTRIBUTE is returned. + */ + int QueryIntAttribute( const char* name, int* _value ) const; + /// QueryUnsignedAttribute examines the attribute - see QueryIntAttribute(). + int QueryUnsignedAttribute( const char* name, unsigned* _value ) const; + /** QueryBoolAttribute examines the attribute - see QueryIntAttribute(). + Note that '1', 'true', or 'yes' are considered true, while '0', 'false' + and 'no' are considered false. + */ + int QueryBoolAttribute( const char* name, bool* _value ) const; + /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). + int QueryDoubleAttribute( const char* name, double* _value ) const; + /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). + int QueryFloatAttribute( const char* name, float* _value ) const { + double d; + int result = QueryDoubleAttribute( name, &d ); + if ( result == TIXML_SUCCESS ) { + *_value = (float)d; + } + return result; + } + + #ifdef TIXML_USE_STL + /// QueryStringAttribute examines the attribute - see QueryIntAttribute(). + int QueryStringAttribute( const char* name, std::string* _value ) const { + const char* cstr = Attribute( name ); + if ( cstr ) { + *_value = std::string( cstr ); + return TIXML_SUCCESS; + } + return TIXML_NO_ATTRIBUTE; + } + + /** Template form of the attribute query which will try to read the + attribute into the specified type. Very easy, very powerful, but + be careful to make sure to call this with the correct type. + + NOTE: This method doesn't work correctly for 'string' types that contain spaces. + + @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE + */ + template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const + { + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + + std::stringstream sstream( node->ValueStr() ); + sstream >> *outValue; + if ( !sstream.fail() ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; + } + + int QueryValueAttribute( const std::string& name, std::string* outValue ) const + { + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + *outValue = node->ValueStr(); + return TIXML_SUCCESS; + } + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char* name, const char * _value ); + + #ifdef TIXML_USE_STL + const std::string* Attribute( const std::string& name ) const; + const std::string* Attribute( const std::string& name, int* i ) const; + const std::string* Attribute( const std::string& name, double* d ) const; + int QueryIntAttribute( const std::string& name, int* _value ) const; + int QueryDoubleAttribute( const std::string& name, double* _value ) const; + + /// STL std::string form. + void SetAttribute( const std::string& name, const std::string& _value ); + ///< STL std::string form. + void SetAttribute( const std::string& name, int _value ); + ///< STL std::string form. + void SetDoubleAttribute( const std::string& name, double value ); + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char * name, int value ); + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetDoubleAttribute( const char * name, double value ); + + /** Deletes an attribute with the given name. + */ + void RemoveAttribute( const char * name ); + #ifdef TIXML_USE_STL + void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. + #endif + + const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. + TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } + const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. + TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, GetText() is limited compared to getting the TiXmlText child + and accessing it directly. + + If the first child of 'this' is a TiXmlText, the GetText() + returns the character string of the Text node, else null is returned. + + This is a convenient method for getting the text of simple contained text: + @verbatim + This is text + const char* str = fooElement->GetText(); + @endverbatim + + 'str' will be a pointer to "This is text". + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + This is text + @endverbatim + + then the value of str would be null. The first child node isn't a text node, it is + another element. From this XML: + @verbatim + This is text + @endverbatim + GetText() will return "This is ". + + WARNING: GetText() accesses a child node - don't become confused with the + similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are + safe type casts on the referenced node. + */ + const char* GetText() const; + + /// Creates a new Element and returns it - the returned element is a copy. + virtual TiXmlNode* Clone() const; + // Print the Element to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: next char past '<' + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* visitor ) const; + +protected: + + void CopyTo( TiXmlElement* target ) const; + void ClearThis(); // like clear, but initializes 'this' object as well + + // Used to be public [internal use] + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + /* [internal use] + Reads the "value" of the element -- another element, or text. + This should terminate with the current end tag. + */ + const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); + +private: + TiXmlAttributeSet attributeSet; +}; + + +/** An XML comment. +*/ +class TiXmlComment : public TiXmlNode +{ +public: + /// Constructs an empty comment. + TiXmlComment() : TiXmlNode( TiXmlNode::TINYXML_COMMENT ) {} + /// Construct a comment from text. + TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::TINYXML_COMMENT ) { + SetValue( _value ); + } + TiXmlComment( const TiXmlComment& ); + TiXmlComment& operator=( const TiXmlComment& base ); + + virtual ~TiXmlComment() {} + + /// Returns a copy of this Comment. + virtual TiXmlNode* Clone() const; + // Write this Comment to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: at the ! of the !-- + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* visitor ) const; + +protected: + void CopyTo( TiXmlComment* target ) const; + + // used to be public + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif +// virtual void StreamOut( TIXML_OSTREAM * out ) const; + +private: + +}; + + +/** XML text. A text node can have 2 ways to output the next. "normal" output + and CDATA. It will default to the mode it was parsed from the XML file and + you generally want to leave it alone, but you can change the output mode with + SetCDATA() and query it with CDATA(). +*/ +class TiXmlText : public TiXmlNode +{ + friend class TiXmlElement; +public: + /** Constructor for text element. By default, it is treated as + normal, encoded text. If you want it be output as a CDATA text + element, set the parameter _cdata to 'true' + */ + TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TINYXML_TEXT) + { + SetValue( initValue ); + cdata = false; + } + virtual ~TiXmlText() {} + + #ifdef TIXML_USE_STL + /// Constructor. + TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TINYXML_TEXT) + { + SetValue( initValue ); + cdata = false; + } + #endif + + TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TINYXML_TEXT ) { copy.CopyTo( this ); } + TiXmlText& operator=( const TiXmlText& base ) { base.CopyTo( this ); return *this; } + + // Write this text object to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /// Queries whether this represents text using a CDATA section. + bool CDATA() const { return cdata; } + /// Turns on or off a CDATA representation of text. + void SetCDATA( bool _cdata ) { cdata = _cdata; } + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* content ) const; + +protected : + /// [internal use] Creates a new Element and returns it. + virtual TiXmlNode* Clone() const; + void CopyTo( TiXmlText* target ) const; + + bool Blank() const; // returns true if all white space and new lines + // [internal use] + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + bool cdata; // true if this should be input and output as a CDATA style text element +}; + + +/** In correct XML the declaration is the first entry in the file. + @verbatim + + @endverbatim + + TinyXml will happily read or write files without a declaration, + however. There are 3 possible attributes to the declaration: + version, encoding, and standalone. + + Note: In this version of the code, the attributes are + handled as special cases, not generic attributes, simply + because there can only be at most 3 and they are always the same. +*/ +class TiXmlDeclaration : public TiXmlNode +{ +public: + /// Construct an empty declaration. + TiXmlDeclaration() : TiXmlNode( TiXmlNode::TINYXML_DECLARATION ) {} + +#ifdef TIXML_USE_STL + /// Constructor. + TiXmlDeclaration( const std::string& _version, + const std::string& _encoding, + const std::string& _standalone ); +#endif + + /// Construct. + TiXmlDeclaration( const char* _version, + const char* _encoding, + const char* _standalone ); + + TiXmlDeclaration( const TiXmlDeclaration& copy ); + TiXmlDeclaration& operator=( const TiXmlDeclaration& copy ); + + virtual ~TiXmlDeclaration() {} + + /// Version. Will return an empty string if none was found. + const char *Version() const { return version.c_str (); } + /// Encoding. Will return an empty string if none was found. + const char *Encoding() const { return encoding.c_str (); } + /// Is this a standalone document? + const char *Standalone() const { return standalone.c_str (); } + + /// Creates a copy of this Declaration and returns it. + virtual TiXmlNode* Clone() const; + // Print this declaration to a FILE stream. + virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; + virtual void Print( FILE* cfile, int depth ) const { + Print( cfile, depth, 0 ); + } + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* visitor ) const; + +protected: + void CopyTo( TiXmlDeclaration* target ) const; + // used to be public + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + + TIXML_STRING version; + TIXML_STRING encoding; + TIXML_STRING standalone; +}; + + +/** Any tag that tinyXml doesn't recognize is saved as an + unknown. It is a tag of text, but should not be modified. + It will be written back to the XML, unchanged, when the file + is saved. + + DTD tags get thrown into TiXmlUnknowns. +*/ +class TiXmlUnknown : public TiXmlNode +{ +public: + TiXmlUnknown() : TiXmlNode( TiXmlNode::TINYXML_UNKNOWN ) {} + virtual ~TiXmlUnknown() {} + + TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::TINYXML_UNKNOWN ) { copy.CopyTo( this ); } + TiXmlUnknown& operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); return *this; } + + /// Creates a copy of this Unknown and returns it. + virtual TiXmlNode* Clone() const; + // Print this Unknown to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* content ) const; + +protected: + void CopyTo( TiXmlUnknown* target ) const; + + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + +}; + + +/** Always the top level node. A document binds together all the + XML pieces. It can be saved, loaded, and printed to the screen. + The 'value' of a document node is the xml file name. +*/ +class TiXmlDocument : public TiXmlNode +{ +public: + /// Create an empty document, that has no name. + TiXmlDocument(); + /// Create a document with a name. The name of the document is also the filename of the xml. + TiXmlDocument( const char * documentName ); + + #ifdef TIXML_USE_STL + /// Constructor. + TiXmlDocument( const std::string& documentName ); + #endif + + TiXmlDocument( const TiXmlDocument& copy ); + TiXmlDocument& operator=( const TiXmlDocument& copy ); + + virtual ~TiXmlDocument() {} + + /** Load a file using the current document value. + Returns true if successful. Will delete any existing + document data before loading. + */ + bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the current document value. Returns true if successful. + bool SaveFile() const; + /// Load a file using the given filename. Returns true if successful. + bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the given filename. Returns true if successful. + bool SaveFile( const char * filename ) const; + /** Load a file using the given FILE*. Returns true if successful. Note that this method + doesn't stream - the entire object pointed at by the FILE* + will be interpreted as an XML file. TinyXML doesn't stream in XML from the current + file location. Streaming may be added in the future. + */ + bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the given FILE*. Returns true if successful. + bool SaveFile( FILE* ) const; + + #ifdef TIXML_USE_STL + bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. + { + return LoadFile( filename.c_str(), encoding ); + } + bool SaveFile( const std::string& filename ) const ///< STL std::string version. + { + return SaveFile( filename.c_str() ); + } + #endif + + /** Parse the given null terminated block of xml data. Passing in an encoding to this + method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml + to use that encoding, regardless of what TinyXml might otherwise try to detect. + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + + /** Get the root element -- the only top level element -- of the document. + In well formed XML, there should only be one. TinyXml is tolerant of + multiple elements at the document level. + */ + const TiXmlElement* RootElement() const { return FirstChildElement(); } + TiXmlElement* RootElement() { return FirstChildElement(); } + + /** If an error occurs, Error will be set to true. Also, + - The ErrorId() will contain the integer identifier of the error (not generally useful) + - The ErrorDesc() method will return the name of the error. (very useful) + - The ErrorRow() and ErrorCol() will return the location of the error (if known) + */ + bool Error() const { return error; } + + /// Contains a textual (english) description of the error if one occurs. + const char * ErrorDesc() const { return errorDesc.c_str (); } + + /** Generally, you probably want the error string ( ErrorDesc() ). But if you + prefer the ErrorId, this function will fetch it. + */ + int ErrorId() const { return errorId; } + + /** Returns the location (if known) of the error. The first column is column 1, + and the first row is row 1. A value of 0 means the row and column wasn't applicable + (memory errors, for example, have no row/column) or the parser lost the error. (An + error in the error reporting, in that case.) + + @sa SetTabSize, Row, Column + */ + int ErrorRow() const { return errorLocation.row+1; } + int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() + + /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) + to report the correct values for row and column. It does not change the output + or input in any way. + + By calling this method, with a tab size + greater than 0, the row and column of each node and attribute is stored + when the file is loaded. Very useful for tracking the DOM back in to + the source file. + + The tab size is required for calculating the location of nodes. If not + set, the default of 4 is used. The tabsize is set per document. Setting + the tabsize to 0 disables row/column tracking. + + Note that row and column tracking is not supported when using operator>>. + + The tab size needs to be enabled before the parse or load. Correct usage: + @verbatim + TiXmlDocument doc; + doc.SetTabSize( 8 ); + doc.Load( "myfile.xml" ); + @endverbatim + + @sa Row, Column + */ + void SetTabSize( int _tabsize ) { tabsize = _tabsize; } + + int TabSize() const { return tabsize; } + + /** If you have handled the error, it can be reset with this call. The error + state is automatically cleared if you Parse a new XML block. + */ + void ClearError() { error = false; + errorId = 0; + errorDesc = ""; + errorLocation.row = errorLocation.col = 0; + //errorLocation.last = 0; + } + + /** Write the document to standard out using formatted printing ("pretty print"). */ + void Print() const { Print( stdout, 0 ); } + + /* Write the document to a string using formatted printing ("pretty print"). This + will allocate a character array (new char[]) and return it as a pointer. The + calling code pust call delete[] on the return char* to avoid a memory leak. + */ + //char* PrintToMemory() const; + + /// Print this Document to a FILE stream. + virtual void Print( FILE* cfile, int depth = 0 ) const; + // [internal use] + void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); + + virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* content ) const; + +protected : + // [internal use] + virtual TiXmlNode* Clone() const; + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + void CopyTo( TiXmlDocument* target ) const; + + bool error; + int errorId; + TIXML_STRING errorDesc; + int tabsize; + TiXmlCursor errorLocation; + bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. +}; + + +/** + A TiXmlHandle is a class that wraps a node pointer with null checks; this is + an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml + DOM structure. It is a separate utility class. + + Take an example: + @verbatim + + + + + + + @endverbatim + + Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very + easy to write a *lot* of code that looks like: + + @verbatim + TiXmlElement* root = document.FirstChildElement( "Document" ); + if ( root ) + { + TiXmlElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + TiXmlElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + TiXmlElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. + @endverbatim + + And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity + of such code. A TiXmlHandle checks for null pointers so it is perfectly safe + and correct to use: + + @verbatim + TiXmlHandle docHandle( &document ); + TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); + if ( child2 ) + { + // do something useful + @endverbatim + + Which is MUCH more concise and useful. + + It is also safe to copy handles - internally they are nothing more than node pointers. + @verbatim + TiXmlHandle handleCopy = handle; + @endverbatim + + What they should not be used for is iteration: + + @verbatim + int i=0; + while ( true ) + { + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); + if ( !child ) + break; + // do something + ++i; + } + @endverbatim + + It seems reasonable, but it is in fact two embedded while loops. The Child method is + a linear walk to find the element, so this code would iterate much more than it needs + to. Instead, prefer: + + @verbatim + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); + + for( child; child; child=child->NextSiblingElement() ) + { + // do something + } + @endverbatim +*/ +class TiXmlHandle +{ +public: + /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. + TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } + /// Copy constructor + TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } + TiXmlHandle operator=( const TiXmlHandle& ref ) { if ( &ref != this ) this->node = ref.node; return *this; } + + /// Return a handle to the first child node. + TiXmlHandle FirstChild() const; + /// Return a handle to the first child node with the given name. + TiXmlHandle FirstChild( const char * value ) const; + /// Return a handle to the first child element. + TiXmlHandle FirstChildElement() const; + /// Return a handle to the first child element with the given name. + TiXmlHandle FirstChildElement( const char * value ) const; + + /** Return a handle to the "index" child with the given name. + The first child is 0, the second 1, etc. + */ + TiXmlHandle Child( const char* value, int index ) const; + /** Return a handle to the "index" child. + The first child is 0, the second 1, etc. + */ + TiXmlHandle Child( int index ) const; + /** Return a handle to the "index" child element with the given name. + The first child element is 0, the second 1, etc. Note that only TiXmlElements + are indexed: other types are not counted. + */ + TiXmlHandle ChildElement( const char* value, int index ) const; + /** Return a handle to the "index" child element. + The first child element is 0, the second 1, etc. Note that only TiXmlElements + are indexed: other types are not counted. + */ + TiXmlHandle ChildElement( int index ) const; + + #ifdef TIXML_USE_STL + TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } + TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } + + TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } + TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } + #endif + + /** Return the handle as a TiXmlNode. This may return null. + */ + TiXmlNode* ToNode() const { return node; } + /** Return the handle as a TiXmlElement. This may return null. + */ + TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } + /** Return the handle as a TiXmlText. This may return null. + */ + TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } + /** Return the handle as a TiXmlUnknown. This may return null. + */ + TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } + + /** @deprecated use ToNode. + Return the handle as a TiXmlNode. This may return null. + */ + TiXmlNode* Node() const { return ToNode(); } + /** @deprecated use ToElement. + Return the handle as a TiXmlElement. This may return null. + */ + TiXmlElement* Element() const { return ToElement(); } + /** @deprecated use ToText() + Return the handle as a TiXmlText. This may return null. + */ + TiXmlText* Text() const { return ToText(); } + /** @deprecated use ToUnknown() + Return the handle as a TiXmlUnknown. This may return null. + */ + TiXmlUnknown* Unknown() const { return ToUnknown(); } + +private: + TiXmlNode* node; +}; + + +/** Print to memory functionality. The TiXmlPrinter is useful when you need to: + + -# Print to memory (especially in non-STL mode) + -# Control formatting (line endings, etc.) + + When constructed, the TiXmlPrinter is in its default "pretty printing" mode. + Before calling Accept() you can call methods to control the printing + of the XML document. After TiXmlNode::Accept() is called, the printed document can + be accessed via the CStr(), Str(), and Size() methods. + + TiXmlPrinter uses the Visitor API. + @verbatim + TiXmlPrinter printer; + printer.SetIndent( "\t" ); + + doc.Accept( &printer ); + fprintf( stdout, "%s", printer.CStr() ); + @endverbatim +*/ +class TiXmlPrinter : public TiXmlVisitor +{ +public: + TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ), + buffer(), indent( " " ), lineBreak( "\n" ) {} + + virtual bool VisitEnter( const TiXmlDocument& doc ); + virtual bool VisitExit( const TiXmlDocument& doc ); + + virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); + virtual bool VisitExit( const TiXmlElement& element ); + + virtual bool Visit( const TiXmlDeclaration& declaration ); + virtual bool Visit( const TiXmlText& text ); + virtual bool Visit( const TiXmlComment& comment ); + virtual bool Visit( const TiXmlUnknown& unknown ); + + /** Set the indent characters for printing. By default 4 spaces + but tab (\t) is also useful, or null/empty string for no indentation. + */ + void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } + /// Query the indention string. + const char* Indent() { return indent.c_str(); } + /** Set the line breaking string. By default set to newline (\n). + Some operating systems prefer other characters, or can be + set to the null/empty string for no indenation. + */ + void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; } + /// Query the current line breaking string. + const char* LineBreak() { return lineBreak.c_str(); } + + /** Switch over to "stream printing" which is the most dense formatting without + linebreaks. Common when the XML is needed for network transmission. + */ + void SetStreamPrinting() { indent = ""; + lineBreak = ""; + } + /// Return the result. + const char* CStr() { return buffer.c_str(); } + /// Return the length of the result string. + size_t Size() { return buffer.size(); } + + #ifdef TIXML_USE_STL + /// Return the result. + const std::string& Str() { return buffer; } + #endif + +private: + void DoIndent() { + for( int i=0; i +#include + +#include "tinyxml.h" + +//#define DEBUG_PARSER +#if defined( DEBUG_PARSER ) +# if defined( DEBUG ) && defined( _MSC_VER ) +# include +# define TIXML_LOG OutputDebugString +# else +# define TIXML_LOG printf +# endif +#endif + +// Note tha "PutString" hardcodes the same list. This +// is less flexible than it appears. Changing the entries +// or order will break putstring. +TiXmlBase::Entity TiXmlBase::entity[ TiXmlBase::NUM_ENTITY ] = +{ + { "&", 5, '&' }, + { "<", 4, '<' }, + { ">", 4, '>' }, + { """, 6, '\"' }, + { "'", 6, '\'' } +}; + +// Bunch of unicode info at: +// http://www.unicode.org/faq/utf_bom.html +// Including the basic of this table, which determines the #bytes in the +// sequence from the lead byte. 1 placed for invalid sequences -- +// although the result will be junk, pass it through as much as possible. +// Beware of the non-characters in UTF-8: +// ef bb bf (Microsoft "lead bytes") +// ef bf be +// ef bf bf + +const unsigned char TIXML_UTF_LEAD_0 = 0xefU; +const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; +const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; + +const int TiXmlBase::utf8ByteTable[256] = +{ + // 0 1 2 3 4 5 6 7 8 9 a b c d e f + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0 + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte + 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid +}; + + +void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) +{ + const unsigned long BYTE_MASK = 0xBF; + const unsigned long BYTE_MARK = 0x80; + const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + + if (input < 0x80) + *length = 1; + else if ( input < 0x800 ) + *length = 2; + else if ( input < 0x10000 ) + *length = 3; + else if ( input < 0x200000 ) + *length = 4; + else + { *length = 0; return; } // This code won't covert this correctly anyway. + + output += *length; + + // Scary scary fall throughs. + switch (*length) + { + case 4: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 3: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 2: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 1: + --output; + *output = (char)(input | FIRST_BYTE_MARK[*length]); + } +} + + +/*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) +{ + // This will only work for low-ascii, everything else is assumed to be a valid + // letter. I'm not sure this is the best approach, but it is quite tricky trying + // to figure out alhabetical vs. not across encoding. So take a very + // conservative approach. + +// if ( encoding == TIXML_ENCODING_UTF8 ) +// { + if ( anyByte < 127 ) + return isalpha( anyByte ); + else + return 1; // What else to do? The unicode set is huge...get the english ones right. +// } +// else +// { +// return isalpha( anyByte ); +// } +} + + +/*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) +{ + // This will only work for low-ascii, everything else is assumed to be a valid + // letter. I'm not sure this is the best approach, but it is quite tricky trying + // to figure out alhabetical vs. not across encoding. So take a very + // conservative approach. + +// if ( encoding == TIXML_ENCODING_UTF8 ) +// { + if ( anyByte < 127 ) + return isalnum( anyByte ); + else + return 1; // What else to do? The unicode set is huge...get the english ones right. +// } +// else +// { +// return isalnum( anyByte ); +// } +} + + +class TiXmlParsingData +{ + friend class TiXmlDocument; + public: + void Stamp( const char* now, TiXmlEncoding encoding ); + + const TiXmlCursor& Cursor() const { return cursor; } + + private: + // Only used by the document! + TiXmlParsingData( const char* start, int _tabsize, int row, int col ) + { + assert( start ); + stamp = start; + tabsize = _tabsize; + cursor.row = row; + cursor.col = col; + } + + TiXmlCursor cursor; + const char* stamp; + int tabsize; +}; + + +void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding ) +{ + assert( now ); + + // Do nothing if the tabsize is 0. + if ( tabsize < 1 ) + { + return; + } + + // Get the current row, column. + int row = cursor.row; + int col = cursor.col; + const char* p = stamp; + assert( p ); + + while ( p < now ) + { + // Treat p as unsigned, so we have a happy compiler. + const unsigned char* pU = (const unsigned char*)p; + + // Code contributed by Fletcher Dunn: (modified by lee) + switch (*pU) { + case 0: + // We *should* never get here, but in case we do, don't + // advance past the terminating null character, ever + return; + + case '\r': + // bump down to the next line + ++row; + col = 0; + // Eat the character + ++p; + + // Check for \r\n sequence, and treat this as a single character + if (*p == '\n') { + ++p; + } + break; + + case '\n': + // bump down to the next line + ++row; + col = 0; + + // Eat the character + ++p; + + // Check for \n\r sequence, and treat this as a single + // character. (Yes, this bizarre thing does occur still + // on some arcane platforms...) + if (*p == '\r') { + ++p; + } + break; + + case '\t': + // Eat the character + ++p; + + // Skip to next tab stop + col = (col / tabsize + 1) * tabsize; + break; + + case TIXML_UTF_LEAD_0: + if ( encoding == TIXML_ENCODING_UTF8 ) + { + if ( *(p+1) && *(p+2) ) + { + // In these cases, don't advance the column. These are + // 0-width spaces. + if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) + p += 3; + else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU ) + p += 3; + else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU ) + p += 3; + else + { p +=3; ++col; } // A normal character. + } + } + else + { + ++p; + ++col; + } + break; + + default: + if ( encoding == TIXML_ENCODING_UTF8 ) + { + // Eat the 1 to 4 byte utf8 character. + int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)]; + if ( step == 0 ) + step = 1; // Error case from bad encoding, but handle gracefully. + p += step; + + // Just advance one column, of course. + ++col; + } + else + { + ++p; + ++col; + } + break; + } + } + cursor.row = row; + cursor.col = col; + assert( cursor.row >= -1 ); + assert( cursor.col >= -1 ); + stamp = p; + assert( stamp ); +} + + +const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) +{ + if ( !p || !*p ) + { + return 0; + } + if ( encoding == TIXML_ENCODING_UTF8 ) + { + while ( *p ) + { + const unsigned char* pU = (const unsigned char*)p; + + // Skip the stupid Microsoft UTF-8 Byte order marks + if ( *(pU+0)==TIXML_UTF_LEAD_0 + && *(pU+1)==TIXML_UTF_LEAD_1 + && *(pU+2)==TIXML_UTF_LEAD_2 ) + { + p += 3; + continue; + } + else if(*(pU+0)==TIXML_UTF_LEAD_0 + && *(pU+1)==0xbfU + && *(pU+2)==0xbeU ) + { + p += 3; + continue; + } + else if(*(pU+0)==TIXML_UTF_LEAD_0 + && *(pU+1)==0xbfU + && *(pU+2)==0xbfU ) + { + p += 3; + continue; + } + + if ( IsWhiteSpace( *p ) ) // Still using old rules for white space. + ++p; + else + break; + } + } + else + { + while ( *p && IsWhiteSpace( *p ) ) + ++p; + } + + return p; +} + +#ifdef TIXML_USE_STL +/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ) +{ + for( ;; ) + { + if ( !in->good() ) return false; + + int c = in->peek(); + // At this scope, we can't get to a document. So fail silently. + if ( !IsWhiteSpace( c ) || c <= 0 ) + return true; + + *tag += (char) in->get(); + } +} + +/*static*/ bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag ) +{ + //assert( character > 0 && character < 128 ); // else it won't work in utf-8 + while ( in->good() ) + { + int c = in->peek(); + if ( c == character ) + return true; + if ( c <= 0 ) // Silent failure: can't get document at this scope + return false; + + in->get(); + *tag += (char) c; + } + return false; +} +#endif + +// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The +// "assign" optimization removes over 10% of the execution time. +// +const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) +{ + // Oddly, not supported on some comilers, + //name->clear(); + // So use this: + *name = ""; + assert( p ); + + // Names start with letters or underscores. + // Of course, in unicode, tinyxml has no idea what a letter *is*. The + // algorithm is generous. + // + // After that, they can be letters, underscores, numbers, + // hyphens, or colons. (Colons are valid ony for namespaces, + // but tinyxml can't tell namespaces from names.) + if ( p && *p + && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) + { + const char* start = p; + while( p && *p + && ( IsAlphaNum( (unsigned char ) *p, encoding ) + || *p == '_' + || *p == '-' + || *p == '.' + || *p == ':' ) ) + { + //(*name) += *p; // expensive + ++p; + } + if ( p-start > 0 ) { + name->assign( start, p-start ); + } + return p; + } + return 0; +} + +const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding ) +{ + // Presume an entity, and pull it out. + TIXML_STRING ent; + int i; + *length = 0; + + if ( *(p+1) && *(p+1) == '#' && *(p+2) ) + { + unsigned long ucs = 0; + ptrdiff_t delta = 0; + unsigned mult = 1; + + if ( *(p+2) == 'x' ) + { + // Hexadecimal. + if ( !*(p+3) ) return 0; + + const char* q = p+3; + q = strchr( q, ';' ); + + if ( !q || !*q ) return 0; + + delta = q-p; + --q; + + while ( *q != 'x' ) + { + if ( *q >= '0' && *q <= '9' ) + ucs += mult * (*q - '0'); + else if ( *q >= 'a' && *q <= 'f' ) + ucs += mult * (*q - 'a' + 10); + else if ( *q >= 'A' && *q <= 'F' ) + ucs += mult * (*q - 'A' + 10 ); + else + return 0; + mult *= 16; + --q; + } + } + else + { + // Decimal. + if ( !*(p+2) ) return 0; + + const char* q = p+2; + q = strchr( q, ';' ); + + if ( !q || !*q ) return 0; + + delta = q-p; + --q; + + while ( *q != '#' ) + { + if ( *q >= '0' && *q <= '9' ) + ucs += mult * (*q - '0'); + else + return 0; + mult *= 10; + --q; + } + } + if ( encoding == TIXML_ENCODING_UTF8 ) + { + // convert the UCS to UTF-8 + ConvertUTF32ToUTF8( ucs, value, length ); + } + else + { + *value = (char)ucs; + *length = 1; + } + return p + delta + 1; + } + + // Now try to match it. + for( i=0; iappend( cArr, len ); + } + } + else + { + bool whitespace = false; + + // Remove leading white space: + p = SkipWhiteSpace( p, encoding ); + while ( p && *p + && !StringEqual( p, endTag, caseInsensitive, encoding ) ) + { + if ( *p == '\r' || *p == '\n' ) + { + whitespace = true; + ++p; + } + else if ( IsWhiteSpace( *p ) ) + { + whitespace = true; + ++p; + } + else + { + // If we've found whitespace, add it before the + // new character. Any whitespace just becomes a space. + if ( whitespace ) + { + (*text) += ' '; + whitespace = false; + } + int len; + char cArr[4] = { 0, 0, 0, 0 }; + p = GetChar( p, cArr, &len, encoding ); + if ( len == 1 ) + (*text) += cArr[0]; // more efficient + else + text->append( cArr, len ); + } + } + } + if ( p && *p ) + p += strlen( endTag ); + return ( p && *p ) ? p : 0; +} + +#ifdef TIXML_USE_STL + +void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + // The basic issue with a document is that we don't know what we're + // streaming. Read something presumed to be a tag (and hope), then + // identify it, and call the appropriate stream method on the tag. + // + // This "pre-streaming" will never read the closing ">" so the + // sub-tag can orient itself. + + if ( !StreamTo( in, '<', tag ) ) + { + SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + + while ( in->good() ) + { + int tagIndex = (int) tag->length(); + while ( in->good() && in->peek() != '>' ) + { + int c = in->get(); + if ( c <= 0 ) + { + SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + break; + } + (*tag) += (char) c; + } + + if ( in->good() ) + { + // We now have something we presume to be a node of + // some sort. Identify it, and call the node to + // continue streaming. + TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); + + if ( node ) + { + node->StreamIn( in, tag ); + bool isElement = node->ToElement() != 0; + delete node; + node = 0; + + // If this is the root element, we're done. Parsing will be + // done by the >> operator. + if ( isElement ) + { + return; + } + } + else + { + SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + } + } + // We should have returned sooner. + SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); +} + +#endif + +const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding ) +{ + ClearError(); + + // Parse away, at the document level. Since a document + // contains nothing but other tags, most of what happens + // here is skipping white space. + if ( !p || !*p ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + // Note that, for a document, this needs to come + // before the while space skip, so that parsing + // starts from the pointer we are given. + location.Clear(); + if ( prevData ) + { + location.row = prevData->cursor.row; + location.col = prevData->cursor.col; + } + else + { + location.row = 0; + location.col = 0; + } + TiXmlParsingData data( p, TabSize(), location.row, location.col ); + location = data.Cursor(); + + if ( encoding == TIXML_ENCODING_UNKNOWN ) + { + // Check for the Microsoft UTF-8 lead bytes. + const unsigned char* pU = (const unsigned char*)p; + if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0 + && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1 + && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 ) + { + encoding = TIXML_ENCODING_UTF8; + useMicrosoftBOM = true; + } + } + + p = SkipWhiteSpace( p, encoding ); + if ( !p ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + while ( p && *p ) + { + TiXmlNode* node = Identify( p, encoding ); + if ( node ) + { + p = node->Parse( p, &data, encoding ); + LinkEndChild( node ); + } + else + { + break; + } + + // Did we get encoding info? + if ( encoding == TIXML_ENCODING_UNKNOWN + && node->ToDeclaration() ) + { + TiXmlDeclaration* dec = node->ToDeclaration(); + const char* enc = dec->Encoding(); + assert( enc ); + + if ( *enc == 0 ) + encoding = TIXML_ENCODING_UTF8; + else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) ) + encoding = TIXML_ENCODING_UTF8; + else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) ) + encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice + else + encoding = TIXML_ENCODING_LEGACY; + } + + p = SkipWhiteSpace( p, encoding ); + } + + // Was this empty? + if ( !firstChild ) { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding ); + return 0; + } + + // All is well. + return p; +} + +void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + // The first error in a chain is more accurate - don't set again! + if ( error ) + return; + + assert( err > 0 && err < TIXML_ERROR_STRING_COUNT ); + error = true; + errorId = err; + errorDesc = errorString[ errorId ]; + + errorLocation.Clear(); + if ( pError && data ) + { + data->Stamp( pError, encoding ); + errorLocation = data->Cursor(); + } +} + + +TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding ) +{ + TiXmlNode* returnNode = 0; + + p = SkipWhiteSpace( p, encoding ); + if( !p || !*p || *p != '<' ) + { + return 0; + } + + p = SkipWhiteSpace( p, encoding ); + + if ( !p || !*p ) + { + return 0; + } + + // What is this thing? + // - Elements start with a letter or underscore, but xml is reserved. + // - Comments: "; + + if ( !StringEqual( p, startTag, false, encoding ) ) + { + if ( document ) + document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); + return 0; + } + p += strlen( startTag ); + + // [ 1475201 ] TinyXML parses entities in comments + // Oops - ReadText doesn't work, because we don't want to parse the entities. + // p = ReadText( p, &value, false, endTag, false, encoding ); + // + // from the XML spec: + /* + [Definition: Comments may appear anywhere in a document outside other markup; in addition, + they may appear within the document type declaration at places allowed by the grammar. + They are not part of the document's character data; an XML processor MAY, but need not, + make it possible for an application to retrieve the text of comments. For compatibility, + the string "--" (double-hyphen) MUST NOT occur within comments.] Parameter entity + references MUST NOT be recognized within comments. + + An example of a comment: + + + */ + + value = ""; + // Keep all the white space. + while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) + { + value.append( p, 1 ); + ++p; + } + if ( p && *p ) + p += strlen( endTag ); + + return p; +} + + +const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p ) return 0; + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + // Read the name, the '=' and the value. + const char* pErr = p; + p = ReadName( p, &name, encoding ); + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); + return 0; + } + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p || *p != '=' ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); + return 0; + } + + ++p; // skip '=' + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); + return 0; + } + + const char* end; + const char SINGLE_QUOTE = '\''; + const char DOUBLE_QUOTE = '\"'; + + if ( *p == SINGLE_QUOTE ) + { + ++p; + end = "\'"; // single quote in string + p = ReadText( p, &value, false, end, false, encoding ); + } + else if ( *p == DOUBLE_QUOTE ) + { + ++p; + end = "\""; // double quote in string + p = ReadText( p, &value, false, end, false, encoding ); + } + else + { + // All attribute values should be in single or double quotes. + // But this is such a common error that the parser will try + // its best, even without them. + value = ""; + while ( p && *p // existence + && !IsWhiteSpace( *p ) // whitespace + && *p != '/' && *p != '>' ) // tag end + { + if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) { + // [ 1451649 ] Attribute values with trailing quotes not handled correctly + // We did not have an opening quote but seem to have a + // closing one. Give up and throw an error. + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); + return 0; + } + value += *p; + ++p; + } + } + return p; +} + +#ifdef TIXML_USE_STL +void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + while ( in->good() ) + { + int c = in->peek(); + if ( !cdata && (c == '<' ) ) + { + return; + } + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + + (*tag) += (char) c; + in->get(); // "commits" the peek made above + + if ( cdata && c == '>' && tag->size() >= 3 ) { + size_t len = tag->size(); + if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) { + // terminator of cdata. + return; + } + } + } +} +#endif + +const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + value = ""; + TiXmlDocument* document = GetDocument(); + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + + const char* const startTag = ""; + + if ( cdata || StringEqual( p, startTag, false, encoding ) ) + { + cdata = true; + + if ( !StringEqual( p, startTag, false, encoding ) ) + { + if ( document ) + document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); + return 0; + } + p += strlen( startTag ); + + // Keep all the white space, ignore the encoding, etc. + while ( p && *p + && !StringEqual( p, endTag, false, encoding ) + ) + { + value += *p; + ++p; + } + + TIXML_STRING dummy; + p = ReadText( p, &dummy, false, endTag, false, encoding ); + return p; + } + else + { + bool ignoreWhite = true; + + const char* end = "<"; + p = ReadText( p, &value, ignoreWhite, end, false, encoding ); + if ( p && *p ) + return p-1; // don't truncate the '<' + return 0; + } +} + +#ifdef TIXML_USE_STL +void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + while ( in->good() ) + { + int c = in->get(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + (*tag) += (char) c; + + if ( c == '>' ) + { + // All is well. + return; + } + } +} +#endif + +const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) +{ + p = SkipWhiteSpace( p, _encoding ); + // Find the beginning, find the end, and look for + // the stuff in-between. + TiXmlDocument* document = GetDocument(); + if ( !p || !*p || !StringEqual( p, "SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); + return 0; + } + if ( data ) + { + data->Stamp( p, _encoding ); + location = data->Cursor(); + } + p += 5; + + version = ""; + encoding = ""; + standalone = ""; + + while ( p && *p ) + { + if ( *p == '>' ) + { + ++p; + return p; + } + + p = SkipWhiteSpace( p, _encoding ); + if ( StringEqual( p, "version", true, _encoding ) ) + { + TiXmlAttribute attrib; + p = attrib.Parse( p, data, _encoding ); + version = attrib.Value(); + } + else if ( StringEqual( p, "encoding", true, _encoding ) ) + { + TiXmlAttribute attrib; + p = attrib.Parse( p, data, _encoding ); + encoding = attrib.Value(); + } + else if ( StringEqual( p, "standalone", true, _encoding ) ) + { + TiXmlAttribute attrib; + p = attrib.Parse( p, data, _encoding ); + standalone = attrib.Value(); + } + else + { + // Read over whatever it is. + while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) + ++p; + } + } + return 0; +} + +bool TiXmlText::Blank() const +{ + for ( unsigned i=0; i