我正在使用Coldfusion9与第三方SOAP服务进行交互,我需要使用它来发送和接收带附件的SOAP.通过在HTTP内容周围使用ToString()将SOAP Body转换为可用的字符串,我在接收可能有也可能没有二进制附件的SOAP方面没有任何问题,但是服务要求我也使用附件发回我的响应这是我要撤消的地方.我在ColdFusion中从未这样做过,我不确定如何将其呈现给原始服务,以便通过ID引用SOAP主体.
下面是使用附件解析传入的SOAP数据:
<cfset soapData = GetHttpRequestData()>
<!--- Loop over the HTTP headers and dump the SOAP content into a variable --->
<cfsavecontent variable="soapContent">
<cfoutput>
<cfloop collection = #soapData.headers# item = "http_item">
#http_item#: #StructFind(soapData.headers, http_item)# #chr(10)##chr(13)#
</cfloop>
request_method: #soapData.method# #chr(10)##chr(13)#
server_protocol: #soapData.protocol# #chr(10)##chr(13)#
http_content --- #chr(10)##chr(13)#
#toString(soapData.content)#
</cfoutput>
</cfsavecontent>
<!--- Save file to flat file --->
<cffile action = "write"
file = "#expandPath('../')#logs/#dateFormat(now(),'dd-mm-yyyy')#_#timeFormat(now(),'HHmmss')#.txt"
output = "#soapContent#">
Run Code Online (Sandbox Code Playgroud)
现在,我正在将响应呈现为一个完整的SOAP XML响应,其中包含作为内联XML的主体以及所需的STATUSCODE(参见下文).
<cfsavecontent variable="strResponse">
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<SOAPENV:Body>
<ns1:processResponse xmlns:ns1="urn:TripFlow" …
Run Code Online (Sandbox Code Playgroud) 我们有一个用Coldfusion9编写的静默登录服务,该服务接受来自外部系统的加密字符串,然后根据约定的算法/编码设置进行解密.多年来,从运行ASP/JAVA/PHP的系统开始,这一点没有问题,但我们现在有一个客户别无选择,只能使用CryptoJS来执行加密,而对于我的生活,我无法理解为什么这不会在Coldfusion中解密.
我的加密知识并不精彩,但我注意到的是CryptoJS加密的密文,完全相同的字符串/密钥每次执行加密时都不同,而在Coldfusion/Java中,我总能期望完全相同的加密字符串.我不确定这是否与编码相关,但我从来没有遇到过这个问题,之前接受来自任何其他系统的加密字符串,所以我希望这是我在CryptoJS中加密的方式不正确.
<cfoutput>
<!--- Set String and Key --->
<cfset theKey = toBase64("1234567812345678")>
<cfset string = "max.brenner@google.com.au">
<!--- CryptoJS AES Libraries --->
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script>
<script>
// Encrypt String using CryptoJS AES
var encrypted = CryptoJS.AES.encrypt("#string#", "#theKey#");
console.log(encrypted.toString());
// Decrypt String using CryptoJS AES
var decrypted = CryptoJS.AES.decrypt(encrypted, "#theKey#");
console.log(decrypted.toString(CryptoJS.enc.Utf8));
</script>
<!--- Coldfusion Decrypt String / FAILS --->
Decrypted: #decrypt(encryptedEmail, "#theKey#", "AES", "BASE64")#
</cfoutput>
Run Code Online (Sandbox Code Playgroud) 我在电子商务商店存储过程中遇到了递归搜索的棘手问题.基本上,这个单个过程将返回基本过滤器和分页中的所有产品,并使用父/子类别表在层次结构中执行递归检查.这是非常有效的,CTE运行得非常快,但是最近添加的关键字搜索需要搜索类别名称,产品名称和样式编号,这引起了戏剧性的问题.
这看起来非常简单,因为第一个CTE已经基于提供的@categoryid生成了层次结构中所有相关类别的表,然后连接到所有过滤的产品特定表的其余部分.产品名称和样式编号搜索工作正常,但我不能在我的生活中获得类别名称搜索工作,因为它需要在层次树中从顶部开始搜索任何匹配的类别树.
例如,Category层次结构的子集如下所示:
Mens
- Polos
- Jerseys
- Pants
Womens
- Pants
- Shirts
- Polos
Supporters
- State Of Origin
- Mens
- Womens
- Kids
- Bulldogs
- Jerserys
- Pants
- Shirts
- Caps
- Warratahs
Run Code Online (Sandbox Code Playgroud)
在下面的示例代码中,我传递了一个搜索词"origin mens",它应该返回"原产国"类别中同样属于"男士"类别的所有产品.它唯一匹配的是以"Origin"开头的产品名称,而不是别的,因为产品级别的类别不是"原产国",因为这是父级.这里的任何帮助都太棒了!
-- Variable Declarations
DECLARE @categoryid int
DECLARE @minprice int
DECLARE @maxprice int
DECLARE @sizefilter int
DECLARE @colourfilter int
DECLARE @searchstring varchar(255)
DECLARE @totalrows int
-- Variables values for testing
SET @categoryid = 0
SET @minprice = 0 …
Run Code Online (Sandbox Code Playgroud) coldfusion ×2
aes ×1
cryptojs ×1
encryption ×1
javascript ×1
search ×1
soap ×1
sql-server ×1
t-sql ×1