Dim jo As New Foxtable.XObject
Dim s1 As String = "XThirdParty"
Dim PO_DOC As String = "A350-202004150001"
Dim ja As New JArray
jo("request")= New JObject
jo("request")("@type")= "sync"
jo("request")("@key")= "e3839305c3fc25529335d489247d0f21"
jo("request")("host")= New JObject
jo("request")("host")("@prod")= "XThirdParty"
jo("request")("host")("@ver")= "1.0"
jo("request")("host")("@id")= ""
jo("request")("host")("@lang")= "zh_CN"
jo("request")("host")("@timestamp")= "20170426161604037"
jo("request")("host")("@acct")= "db_nsyt"
jo("request")("service") = New JObject
jo("request")("service")("@prod")="E10"
jo("request")("service")("@name")="PURCHASE_ARRIVAL.ImportData"
jo("request")("service")("@ip")="192.168.1.2"
jo("request")("service")("@id")="demo"
jo("request")("payload")= New Jobject
jo("request")("payload")("param")= New JObject
jo("request")("payload")("param")("@key")="std_data"
jo("request")("payload")("param")("@type")="xml"
jo("request")("payload")("param")("data_request")= New JObject
jo("request")("payload")("param")("data_request")("datainfo")= New JObject
jo("request")("payload")("param")("data_request")("datainfo")=ja
Dim so As New JObject
so("parameter")= New JObject
so("parameter")("@key")="productName" ’这个结果参数没出现在 XML语句中
so("parameter")("@type")="string" ’这个结果参数没出现在 XML语句中
so("parameter")= s1 '这人有值
ja.add(so)
Output.Show(jo.ToXML)
’---结果如下:
<xml><request type="sync" key="e3839305c3fc25529335d489247d0f21"><host prod="XThirdParty" ver="1.0" id="" lang="zh_CN" timestamp="20170426161604037" acct="db_nsyt" /><service prod="E10" name="PURCHASE_ARRIVAL.ImportData" ip="192.168.1.2" id="demo" /><payload><param key="std_data" type="xml"><data_request><datainfo><parameter>XThirdParty</parameter></datainfo></data_request></param></payload></request></xml>
请专家指点! 谢谢你!