在Visual Studio中访问WCF服务 [英] Accessing WCF service in Visual studio

查看:63
本文介绍了在Visual Studio中访问WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为学习SharePoint的一部分,我需要从在Windows中设计的工作流访问一项WCF服务. Visual Studio 2015 . WCF服务具有一种功能,可以在承载WCF服务的服务器的本地驱动器中创建文本文件.它有一个字符串参数,该参数将用于写入文本文件.

As part of learning SharePoint , I need to access one WCF service from the workflow designed in visual studio 2015. WCF service having one functionality to create a text file in local drive of the server where WCF service is hosted. It has one string argument which will be used to write in the text file.

服务编码

 公共字符串Welcome(字符串名称)
        {
            StreamWriter sw =新的StreamWriter("e:\\ first.txt");
            sw.WriteLine(name);
            sw.Close();
           返回成功创建文件";
        }

 public string Welcome(string name)
        {
            StreamWriter sw = new StreamWriter("e:\\first.txt");
            sw.WriteLine(name);
            sw.Close();
            return "Succesfully file created";
        }

请让我详细了解在VS 2015中要完成此任务必须使用的操作顺序.

Kindly let me know in detail which sequence of actions I have to use to achieve this task in VS 2015.

致谢

J.Jayakumar

K.Jayakumar

推荐答案

K.Jayakumar,

您可以使用HttpSend活动调用自定义WCF服务. HttpSend使您可以调用最简单的Web服务,或者对于更复杂的任务,可以提供HTTP动词并提供特定的 HTTP标头.

You can call the custom WCF service using HttpSend activity. HttpSend lets you call into the simplest web services or, for more complex tasks, provides HTTP verbs and provides specific HTTP headers.

有关使用Visual Studio在SharePoint工作流中使用Web服务的更多信息:

https://docs.microsoft.com/zh-CN/sharepoint/dev/general-development/使用Visual Studio 2012与Web服务共享工作流中的工作

尽管本文使用的是Visual Studio 2012,但也适用于Visual Studio 2015.

最好的问候,

Linda Zhang


这篇关于在Visual Studio中访问WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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