SoapConnection api vs URLConnection api

时间:2014-07-11 18:46:41

标签: java groovy http-headers

我通过HttpsUrlConnection和默认SoapConnection.connect()传递相同的肥皂请求。

但是,HttpsUrlConnection与HTTP响应415和/或500崩溃。但是,SoapConnection.connect()运行正常。错误代码是否表示请求或响应有问题?

我正在构建httpsUrlConnection:

     conn = (HttpsURLConnection)endpoint.openConnection()
     conn.setRequestMethod("GET")
     conn.setRequestProperty("SOAPAction",endpoint)
     conn.setRequestProperty("Content-Type","text/xml")
     conn.setRequestProperty("Accept","text/xml")
     conn.setDoOutput(true)
     conn.connect()

这是正确的设置吗?

由于

0 个答案:

没有答案