相关疑难解决方法(0)

尝试调用WCF Web服务4.0时获取返回类型无效错误

我正在尝试编写并调用WCF Web服务,下面是详细信息:

Web.config文件:

<add relativeAddress="FetchData.svc" service="WCF.Services.FetchData" />

<service name="WCF.Services.FetchData">
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="" name="FetchData" contract="WCF.Services.FetchData" />
</service>
Run Code Online (Sandbox Code Playgroud)

FetchData类(示例代码):

using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Web;
using System.Xml;
using Webservices.Services;
using Data = Webservices.Data;
using System.ServiceModel.Web;
using System.IO;
using System.Net;
using System.ServiceModel.Channels;
using System.Web.UI;
using System.Text;


namespace WCF.Services
{    
    [ServiceContract(Namespace = "urn:WCF.Services.FetchData")]
    public class FetchData
    {
        Data.GetConnect mConnect = new Data.GetConnect();
        private Message RetrievePublishedData(String pub, int number)
        {
            String strOutput = String.Empty; 
            if (!String.IsNullOrEmpty(pub))
            {
                Boolean …
Run Code Online (Sandbox Code Playgroud)

wcf web-services c#-4.0

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

c#-4.0 ×1

wcf ×1

web-services ×1