SQL调用SOAP服务无法获取数据,请求优化建议
新手求助:SQL调用SOAP服务获取数据失败,求优化思路
我是一名完全的新手,尝试通过SQL查询从SOAP服务获取数据。我先在reqbin.com上进行了测试,能正常获取响应,但使用以下SQL代码却无法获取数据,恳请各位提供优化思路。
DECLARE @xmlRequest NVARCHAR(MAX) = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <StatusNespolehlivyPlatceRequest xmlns="http://adis.mfcr.cz/rozhraniCRPDPH/"> <dic>27396819</dic> </StatusNespolehlivyPlatceRequest> </soapenv:Body> </soapenv:Envelope>'; DECLARE @response INT; DECLARE @responseText NVARCHAR(MAX); EXEC sp_OACreate 'MSXML2.ServerXMLHTTP', @response OUT; EXEC sp_OAMethod @response, 'open', NULL, 'POST', 'https://adisrws.mfcr.cz/dpr/axis2/services/rozhraniCRPDPH.rozhraniCRPDPHSOAP', 'false'; EXEC sp_OAMethod @response, 'setRequestHeader', NULL, 'Content-Type', 'text/xml; charset=utf-8'; EXEC sp_OAMethod @response, 'send', NULL, @xmlRequest; EXEC sp_OAMethod @response, 'responseText', @responseText OUT; -- Debugging: Print the raw response PRINT @responseText;
感谢各位的建议!
内容的提问来源于stack exchange,提问作者Marcel Lucansky
相关产品推荐
相关产品推荐

