2
A
回答
0
的问题是有点太含糊给出一个明确的答案,但是,采取猜你问,是你已经能够读取Web服务数据( GET),但您现在想要将(POST/PUT)数据写入Web服务。
如果是这样,您最好的选择是使用脚本任务并使用C#(或VB)调用所述Web服务。我也推荐这样做GET请求,而不是SSIS Web服务任务,它不处理“更新”的Web服务协议,比如oAuth认证。
粗糙样本情况如下:
using System.Net
using System.IO
string url
= "http://webservicehere.org";
// create the request
HttpWebRequest request
= (HttpWebRequest)HttpWebRequest.Create(url);
// set the method to POST
request.Method
= "POST";
// set the content type, usually application/json or application/xml
request.ContentType
= "application/json";
// handle authentication, in this case the web service
// requires the authentication token to be passed in as a
// header called "Cookie"
request.Headers.Add("Cookie", SqlAuthCookie);
// get the stream object to use to write the request data
StreamWriter requestWriter
= new StreamWriter(request.GetRequestStream());
// write the data to the web service
// where (data) is the JSON/XML that you are
// sending to the endpoint
requestWriter.Write(data);
// close the connection upon completion
requestWriter.Close();
try
{
// read the response received from the web service
HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse();
// code to handle the response goes here
// i.e. deserialise json/xml to strongly typed objects
}
catch (WebException we)
{
// catch any exceptions thrown by the web service here
}
catch (Exception e)
{
// catch other exceptions here
}
相关问题
- 1. SSIS Web服务
- 2. SSIS Web服务任务
- 3. SSIS Web服务任务
- 4. SSIS Web服务任务XmlNode输入POSSIBLE?
- 5. Web服务或Web服务
- 6. 服务器到服务器Web服务
- 7. SSIS Web服务任务的超时值
- 8. SSIS Web服务任务解析结果
- 9. web服务入门
- 10. 到.NET Web服务
- 11. 得到web服务
- 12. Web服务协调的CRUD web服务
- 13. Web服务与Web服务引用DLL
- 14. 调用Web服务的Web服务
- 15. 春季Web服务 - Web服务通信
- 16. Spring Web服务与Axis2 Web服务
- 17. WCF web服务和java web服务
- 18. 在C/C++中写入web服务
- 19. 为.NET Web服务编写输入
- 20. 图像写入使用web服务
- 21. 写入.net Web服务消耗自SAP
- 22. 将文件写入Web服务器 - ASP.NET
- 23. web服务VS WCF服务
- 24. Web服务的服务器
- 25. Web服务TCP服务器
- 26. Web服务,服务形象
- 27. Windows服务或Web服务?
- 28. SSIS 2008:crm dynamics 2013 web服务超时
- 29. SSIS pacakge中输入Web服务任务动态的参数
- 30. SSIS ETL vs REST风格的Web服务vs服务总线
我相信“读书”是指“呼叫”,这意味着Web服务是做既可以是操作读或写,谁知道? – 2013-02-14 16:42:54
你有什么尝试?你能提供一个不适合你的代码样本吗? – 2013-02-18 23:59:06