first commit

main
熊朝柱 2 weeks ago
commit 99bb3abd3d

63
.gitattributes vendored

@ -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

340
.gitignore vendored

@ -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

@ -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
> 配置<detail name="GI">下的field标签信息
> ```
>
> Connor_ERP_wl_pli
>
> ```text
> 配置<detail name="PLI">下的field标签信息
> ```
#### 2. BOM接口
> Connor_ERP_BOM:
>
> ```text
> 配置host, service, parameter标签信息
> ```
>
> Connor_ERP_BOM_parent:
>
> ```text
> 配置<data name="BOM">下的field标签信息导出对象是BOM父行
> ```
>
> Connor_ERP_BOM_child
>
> ```text
> 配置<detail name="BOM_D">下的field标签信息导出对象是BOM子行
> ```
>
> Connor_ERP_BOM_parent_zizhi:
>
> ```text
> 配置<data name="BOM">下的field标签信息导出对象是底层自制件
> ```
>
> Connor_ERP_BOM_child_zizhi
>
> ```text
> 配置<detail name="BOM_D">下的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中后的结果为“<field name="ERP字段名称" type="ERP字段类型">属性提取配置获得的值</field>”
```
**属性提取配置**
属性提取配置分为三种类型:固定值,非引用属性,引用属性
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
> 配置<data name="item">下的field标签信息
> ```
#### 2. BOP接口
> Connor_MES_BOP:
>
> ```text
> 配置host, service等标签信息
> ```
>
> Connor_MES_BOP_parent:
>
> ```text
> 配置<data name="process">下的field标签信息导出对象是BOM父行
> ```
>
> Connor_MES_BOP_opstaiton_detail
>
> ```text
> 配置<detail name="opstaiton_detail">下的field标签信息导出对象是工序行
> ```
>
> Connor_MES_BOP_opresource_detail
>
> ```text
> 配置<detail name="opresource_detail">下的field标签信息导出对象是工艺资源行
> ```
>
> Connor_MES_BOP_opsup_detail
>
> ```text
> 配置<detail name="opsup_detail">下的field标签信息导出对象是工艺辅料行
> ```
>
> Connor_MES_BOP_material_detail
>
> ```text
> 配置<detail name="material_detail">下的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中后的结果为“<field name="ERP字段名称" type="ERP字段类型">属性提取配置获得的值</field>”
```
**属性提取配置**
属性提取配置分为三种类型:固定值,非引用属性,引用属性
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
```

@ -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

@ -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}
};

@ -0,0 +1,46 @@
#include "connor_erp_mes.h"
#include <base_utils/IFail.hxx>
#include <base_utils/TcResultStatus.hxx>
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;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,305 @@
#pragma warning (disable: 4996)
#pragma warning (disable: 4819)
#pragma warning (disable: 4995)
#include <cstdio>
#include <epm/epm.h>
#include <ict/ict_userservice.h>
#include <tccore/item.h>
#include <ae/ae.h>
#include <tc/folder.h>
#include <tccore/aom.h>
#include <sa/sa.h>
#include <tccore/aom_prop.h>
#include <tccore/workspaceobject.h>
#include <tccore//grm.h>
#include <tccore/grmtype.h>
#include <bom/bom.h>
#include <fclasses/tc_date.h>
#include <ics/ics.h>
#include <ics/ics2.h>
#include "connor_erp_mes.h"
// #include <stdio.h>
// #include <string.h>
#include <vector>
#include <epm/signoff.h>
#include <iostream>
#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");
//获取handler的参数的个数
arg_cnt = TC_number_of_arguments(msg.arguments);
printf("参数个数为:%d\n", arg_cnt);
if (arg_cnt > 0)
{
for (i = 0; i<arg_cnt; i++)
{
//获取下一个参数从0开始
arg = TC_next_argument(msg.arguments);
//获取参数的名称和值
ifail = ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue);
if (stricmp(argflag, "type") == 0)
{
//strcmp("","");
if (argvalue != NULL)
{
strcpy(arg1value, argvalue);
}
}
}
MEM_free(argflag);
MEM_free(argvalue);
}
printf("type : %s\n", arg1value);
tag_t task_tag = msg.task;
tag_t rootTask_tag = NULL;
int att_cnt = 0;
tag_t *attachments = NULL;
//获取根流程节点
ifail = EPM_ask_root_task(task_tag, &rootTask_tag);
//获取目标引用对象
ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments);
//循环目标对象
//通过首选项获取数据集模板QZ2bpmxb
/*vector<string> pref_vec1;
map<string, string> lov_map;//键属性名称leylovid
getPrefStrings1("JY8lovid", TC_preference_site, pref_vec1);
for (int i=0;i<pref_vec1.size();i++){
string lovid=pref_vec1[i];
vector<string> map_vec;
Split(lovid, "=", map_vec);
lov_map.insert(pair<string, string>(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<string, string> 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;
//获取某个属性
int classificationCount = 0;
char **values = NULL;
AOM_ask_value_strings(attachments[i], "jy8ClassLovInfo", &classificationCount, &values);
map<string, string> lovMap;
for (int i1 = 0; i1 < classificationCount; i1++)
{
string lovMapValue = values[i1];
vector<string> map_vec;
printf("values[i1].......%s\n", values[i1]);
Split(lovMapValue, "=", map_vec);
lovMap.insert(pair<string, string>(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<string, string>(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;
}

@ -0,0 +1,180 @@
// connor_erp_mes.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "connor_erp_mes.h"
#include <tc/envelope.h>
#include <tc/folder.h>
#include <stdlib.h>
#include <ict/ict_userservice.h>
#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

@ -0,0 +1,27 @@
#pragma once
#include <stdarg.h>
#include <tccore/custom.h>
#include <server_exits/user_server_exits.h>
#include "kutil.h"
#include <list>
#include <algorithm>
#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

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{fdad31da-c4b8-4b1e-ab61-4f2f37e068cf}</ProjectGuid>
<RootNamespace>connorerpmes</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;IPLIB=none;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\TC13\tclib\include_cpp;C:\TC13\tclib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>C:\TC13\tclib\lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libuser_exits.ar.lib</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="connor_erp_mes.cpp" />
<ClCompile Include="connor_send_envelop.cpp" />
<ClCompile Include="crossC.cpp" />
<ClCompile Include="crossClient.cpp" />
<ClCompile Include="kutil.cpp" />
<ClCompile Include="md5.cpp" />
<ClCompile Include="plugin.c" />
<ClCompile Include="QF_Delete_TCM.cpp" />
<ClCompile Include="QF_ERP_wl.cpp" />
<ClCompile Include="stdsoap2.cpp" />
<ClCompile Include="tinystr.cpp" />
<ClCompile Include="tinyxml.cpp" />
<ClCompile Include="tinyxmlerror.cpp" />
<ClCompile Include="tinyxmlparser.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="connor_erp_mes.h" />
<ClInclude Include="cross.h" />
<ClInclude Include="crossH.h" />
<ClInclude Include="crossStub.h" />
<ClInclude Include="kutil.h" />
<ClInclude Include="md5.h" />
<ClInclude Include="plugin.h" />
<ClInclude Include="stdsoap2.h" />
<ClInclude Include="tinystr.h" />
<ClInclude Include="tinyxml.h" />
</ItemGroup>
<ItemGroup>
<None Include="IntegrationEntrySoapBinding.nsmap" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="tinyxml">
<UniqueIdentifier>{ae45bcd9-07c3-42f7-adb6-89f12d05f98f}</UniqueIdentifier>
</Filter>
<Filter Include="webservice">
<UniqueIdentifier>{b7279c7f-ff82-4b91-8f5e-06851f556c98}</UniqueIdentifier>
</Filter>
<Filter Include="md5">
<UniqueIdentifier>{7c178b44-e75f-47ed-9958-67713d53b075}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="connor_erp_mes.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="kutil.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="QF_ERP_wl.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="tinystr.cpp">
<Filter>tinyxml</Filter>
</ClCompile>
<ClCompile Include="tinyxml.cpp">
<Filter>tinyxml</Filter>
</ClCompile>
<ClCompile Include="tinyxmlerror.cpp">
<Filter>tinyxml</Filter>
</ClCompile>
<ClCompile Include="tinyxmlparser.cpp">
<Filter>tinyxml</Filter>
</ClCompile>
<ClCompile Include="crossC.cpp">
<Filter>webservice</Filter>
</ClCompile>
<ClCompile Include="crossClient.cpp">
<Filter>webservice</Filter>
</ClCompile>
<ClCompile Include="stdsoap2.cpp">
<Filter>webservice</Filter>
</ClCompile>
<ClCompile Include="plugin.c">
<Filter>webservice</Filter>
</ClCompile>
<ClCompile Include="md5.cpp">
<Filter>md5</Filter>
</ClCompile>
<ClCompile Include="QF_Delete_TCM.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="connor_send_envelop.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="connor_erp_mes.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="kutil.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="tinystr.h">
<Filter>tinyxml</Filter>
</ClInclude>
<ClInclude Include="tinyxml.h">
<Filter>tinyxml</Filter>
</ClInclude>
<ClInclude Include="cross.h">
<Filter>webservice</Filter>
</ClInclude>
<ClInclude Include="crossH.h">
<Filter>webservice</Filter>
</ClInclude>
<ClInclude Include="crossStub.h">
<Filter>webservice</Filter>
</ClInclude>
<ClInclude Include="stdsoap2.h">
<Filter>webservice</Filter>
</ClInclude>
<ClInclude Include="plugin.h">
<Filter>webservice</Filter>
</ClInclude>
<ClInclude Include="md5.h">
<Filter>md5</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="IntegrationEntrySoapBinding.nsmap">
<Filter>webservice</Filter>
</None>
</ItemGroup>
</Project>

@ -0,0 +1,41 @@
#include <stdio.h>
#pragma warning (disable: 4996)
#pragma warning (disable: 4819)
#pragma warning (disable: 4995)
#include <tc/envelope.h>
#include <tc/folder.h>
#include <stdlib.h>
#include <ict/ict_userservice.h>
#include <tccore/aom.h>
#include <tccore/aom_prop.h>
#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(&copy_user_num, &copy_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<copy_user_num; i++)
{
MAIL_add_envelope_cc_receiver(envelope_tag, copy_user[i]);
}
//AOM_set_value_tags(envelope_tag, "contents", 1, tags);
FL_insert(envelope_tag, dataset, 1);
MAIL_send_envelope(envelope_tag);
return 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -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 */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,843 @@
#pragma warning (disable: 4996)
#pragma warning (disable: 4819)
#include "kutil.h"
#include <chrono>
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::milliseconds>(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<string>& 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<string>& 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<string> 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<string> 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<string> 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<tag_t>& 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<string>& 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<string>& 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<string> 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;
}

@ -0,0 +1,93 @@
#pragma once
#include <tc\tc_macros.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <property\propdesc.h>
#include <epm\epm.h>
#include <epm\epm_toolkit_tc_utils.h>
#include <tccore\item.h>
#include <tccore\grmtype.h>
#include <tchar.h>
#include <tccore\grm.h>
//#include <tccore\imantype.h>
#include <sa\am.h>
#include <sa\sa.h>
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <property\prop_errors.h>
#include <tccore\workspaceobject.h>
#include <qry\qry.h>
#include <bom\bom_attr.h>
#include <bom\bom.h>
#include <epm\signoff.h>
#include <pom\pom\pom.h>
#include <pom\pom\pom_errors.h>
#include <fclasses\tc_date.h>
#include <epm\cr.h>
#include <cfm\cfm.h>
#include <time.h>
#include <ae/ae.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <string>
#include <iostream>
#include <iterator>
#include <map>
#include <vector>
#include <sstream>
#include <fstream>
#include <res\reservation.h>
#ifdef WIN32
#include <io.h>
#include <direct.h>
#else
#include <unistd.h>
#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<string>& 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<string>& ans);
void Split(string strArg, string spliter, vector<string>& ans);
int getPrefStrings2(const char* preference, TC_preference_search_scope_t scope, char splitter, vector<string>& 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<tag_t>& targets, char* formType, char splitter);
bool inArray(vector<string> types, string type);
int getIndexInArray(vector<string> 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);

@ -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;
}

@ -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 <string>
#include <cstring>
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

@ -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;
}

@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -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<TiXmlString::size_type>( 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<TiXmlString::size_type>( strlen(a) );
tmp.reserve(a_len + b.length());
tmp.append(a, a_len);
tmp += b;
return tmp;
}
#endif // TIXML_USE_STL

@ -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 <assert.h>
#include <string.h>
/* 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<size_type>( 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<size_type>( 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<Rep*>(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<Rep*>( 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<int*>( 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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,52 @@
/*
www.sourceforge.net/projects/tinyxml
Original code (2.0 and earlier )copyright (c) 2000-2006 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 "tinyxml.h"
// The goal of the seperate error file is to make the first
// step towards localization. tinyxml (currently) only supports
// english error messages, but the could now be translated.
//
// It also cleans up the code a bit.
//
const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] =
{
"No error",
"Error",
"Failed to open file",
"Error parsing Element.",
"Failed to read Element name",
"Error reading Element value.",
"Error reading Attributes.",
"Error: empty tag.",
"Error reading end tag.",
"Error parsing Unknown.",
"Error parsing Comment.",
"Error parsing Declaration.",
"Error document empty.",
"Error null (0) or unexpected EOF found in input stream.",
"Error parsing CDATA.",
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
};

File diff suppressed because it is too large Load Diff

Binary file not shown.
Loading…
Cancel
Save