cloud3.0创建的webservice如何调用?
金蝶云社区-云小爱
云小爱
0人赞赏了该文章 1,098次浏览 未经作者许可,禁止转载编辑于2014年12月11日 16:22:30

using ConsoleApplication1.ServiceReference1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication.WebServiceTest
{
class Program
{
static void Main(string[] args)
{
string EndpointUri = "h-t-t-p-:-//-115-.29.7-7.13-5:80-01-/K3-Clou-dServ-iceInterfa-ce1/so-ap-12";//有链接帖子发不出,所以加了很多中划线

var binding = new System.ServiceModel.WSHttpBinding
{
MaxReceivedMessageSize = int.MaxValue,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferPoolSize = 524288,
};
binding.Security.Mode = SecurityMode.None;
binding.AllowCookies = true;

SyncReplyClient client = new SyncReplyClient(binding, new EndpointAddress(EndpointUri));

AuthResult res = client.Auth("credentials", "Administrator", "888888", false, false);
if (res.ResponseStatus.IsSuccess)
{

FA_CARD_Save save = new FA_CARD_Save();
save.Model = new FA_CARD();
//资产组织
save.Model.FAssetOrgID = new FA_CARD_ORG_Organizations { FNUMBER = "101.1" };
//货主组织
save.Model.FOwnerOrgID = new FA_CARD_ORG_Organizations { FNUMBER = "101.1" };
//资产类别
save.Model.FAssetTypeID = new FA_CARD_FA_ASSETTYPE { FNUMBER = "ZCLB01_SYS" };
//卡片编码(无需赋值)
//save.Model.FNumber = "ZCLB028";
//资产名称
save.Model.FName = "行行行";
//计量单位
save.Model.FUnitID = new FA_CARD_BD_UNIT { FNumber = "Bag" };
//资产数量
save.Model.FQuantity = 1.000000M;
//资产状态(默认值)
save.Model.FAssetStatusID = new FA_CARD_FA_STATUS { FNumber = "ZCZT01_SYS" };
//变动方式(默认值)
save.Model.FAlterModeID = new FA_CARD_FA_ALTERMODE { FNumber = "BDFS01_SYS" };
//开始使用日期
save.Model.FBeginUseDate = new DateTime(2014, 8, 31);
//财务信息
save.Model.FA_CARD__FFinance = new FA_CARD__FFinance[] {
new FA_CARD__FFinance(){
//会计政策(KJZC01_SYS为中国准则会计政策)
FAcctPolicyID = new FA_CARD_BD_ACCTPOLICY{FNumber= "KJZC01_SYS"},
//入账日期
FAcctDate = new DateTime(2014,9,30),
//未税成本
FOriginalCost = 20000000.0000000000M,
//资产原值
FOrgVal = 20000000.0000000000M,
//账面价值(无需赋值,与未税成本一致)
//预计残值
FResidualvalue = 1000000.0000000000M,
//折旧方法
FDeprMethod = "1",
//预计使用期间
FLifePeriods = 120,
//币别(默认值:人民币)
FFinanceCurrencyID = new FA_CARD_BD_Currency{FNumber="PRE001"},
//购进原值
FPurchaseValue = 55000.0000000000M,
}
};
//实物信息
save.Model.FA_CARD__FCardDetail = new FA_CARD__FCardDetail[] {
new FA_CARD__FCardDetail(){
//资产编码
FAssetNO = "21",
//资产位置
FPositionID = new FA_CARD_FA_POSITION{FNumber="ZCWZ0001"},
//数量
FDetailQuantity = 1

}
};
//使用分配
save.Model.FA_CARD__FAllocation = new FA_CARD__FAllocation[]{
new FA_CARD__FAllocation(){
//资产编码
FAllocAssetNO = "21",
//使用部门
FAllocUseDeptID = new FA_CARD_BD_Department{FNumber="BM000008"},
//分配比例
FAllocRatio = 100,
//费用项目
FAllocCostItemID = new FA_CARD_BD_Expense{FNumber="FYXM01_SYS"},
//开始日期
FAllocBeginDate = new DateTime(2014,8,31),
//结束日期
FAllocEndDate = new DateTime(2014,9,30)
}
};
//发票
save.Model.FA_CARD__FInvoice = new FA_CARD__FInvoice[]{
new FA_CARD__FInvoice(){
//资产编码
FInvoiceAssetNO = "21",
//发票号
FINVOICENO = "ncy0000001",
//开票单位
FSUPPLIERNAME = "nccccy"
}
};
FA_CARD_SaveResponseResult result = client.FA_CARD_Save("demo", save.Model, null);
System.Console.Write(result.ResponseStatus);
//return result;
}
}

}

}
在本机cloud5.0的环境下到“动态表单服务列表”里新增一个固定资产卡片的保存接口。然后写了个控制台应用程序调用,发现是没有问题的。
在远程服务器cloud3.0的环境下,新增同样的接口就各种报错。少了很多代理类,包括FA_Card_Save、 FA_CARD_SaveResponse等等都没有,client没有FA_CARD_Save()方法
谁有3.0的webservice的调用示例啊?
急求! 客户买的是3.0的版本,现在要做系统集成。