以下代码在CF10上正常工作。cfhttp返回415 CF9上不受支持的介质类型
httpSvc = New http();
httpSvc.setMethod("post");
httpSvc.setCharset("utf-8");
httpSvc.setUrl(svcLocation);
httpSvc.setClientCert(certLocation);
httpSvc.setClientCertPassword(certPassword);
httpSvc.addParam(type="body", name="body",value=requestParameters);
result = httpSvc.send().getPrefix();
requestParameters的值是:
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:processCreditCard xmlns:ns2="urn:com.qvalent.payway.api">
<requestParameters>customer.orderNumber=5396&card.CVN=070&order.amount=101&customer.merchant=xxxx&card.expiryMonth=08&card.expiryYear=20&order.ECI=SSL&card.PAN=0000000000000008&card.currency=AUD&customer.username=xxxxxx&order.type=capture&customer.password=xxxxxxx</requestParameters>
</ns2:processCreditCard>
</S:Body>
</S:Envelope>
然而,当我把它放在一个CF9服务器上,响应FileContent是空的,我碰到下面的状态代码:
415 Unsupported Media Type
以下是显示完整回复的链接:http://www.onoffezy.com/_testing/gateway/
Trawling G oogle,415状态码指出客户端请求的MIME类型在服务器上不可用。但是我找不到可以为请求设置MIME类型的任何地方。在cf9和cf10之间,默认的mimetype有没有区别?
我仔细看过两个版本的文档,但找不到可以解释这个问题的差异。
如果任何人都可以对此有所了解,并让我知道我需要在CF9上做什么不同,我将非常感激。
非常感谢
很高兴你明白了。 – 2013-02-20 13:09:47