使用libcurl作为XML文件发送SOAP请求 [英] Sending SOAP requests using libcurl as XML file

查看:503
本文介绍了使用libcurl作为XML文件发送SOAP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用libcurl将SOAP http发布到Web服务.我已经在生成的XML文件中形成了SOAP请求.现在,我需要将这些XML文件转换为Web服务. N.B.我是写Web服务的新手(尤其是在C语言中).

I'm trying to use libcurl to do a SOAP http post to a web service. I have the SOAP requests already formed in XML files which I generate. Now I need to transefer these XML files to the webservice. N.B. I'm pretty new to writing webservices (especially in C).

有没有一种方法可以使用libcurl直接从XML文件发送SOAP请求?还是我必须将内容读入字符串?我仅限于使用C编程语言来完成任务.

Is there a way do send the SOAP requests straight from the XML file using libcurl? Or do I have to read the contents into a string? I'm restricted to using the C programming language to complete the task.

我一直在浏览文档和不同的代码片段,但是我似乎找不到任何可以执行请求的内容.该curl链接通过字符串 http://curl.haxx.se/libcurl /c/post-callback.html ).为了提高速度,我非常希望不必在发送字符串之前将其传递给字符串.

I've been looking through documentation and different code snippets but I can't seem to locate anything to do the requested. This curl link does it through a string http://curl.haxx.se/libcurl/c/post-callback.html). FOr speed purposes I would greatly prefer to not have to pass to a string before sending it.

推荐答案

您使用curl_easy_setopt()吗?那么您可能要看一下CURLOP_WRITEFUNCTION和CURLOPT_WRITEDATA.

you use curl_easy_setopt()? then you may want to take a look at CURLOP_WRITEFUNCTION and CURLOPT_WRITEDATA.

这篇关于使用libcurl作为XML文件发送SOAP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆