读书人

MFC 调用C# webservice解决思路

发布时间: 2012-05-16 11:12:12 作者: rapoo

MFC 调用C# webservice
C++ 如何调用c# 发布的websrvice ?
我能调用 但不能 进行byte[] 数组传递;
webservice

C# code
[WebMethod]    public string uplowadfile(byte[] fidata)    {        try        {            MemoryStream ms = new MemoryStream(fidata);            string filepath = @"G:\\test.txt";            FileStream stream = new FileStream(filepath , FileMode.OpenOrCreate);            ms.WriteTo(stream);            ms.Close();            stream.Close();            ms = null;            stream = null;                        return "finish";        }


C++
C/C++ code
array<byte> aa=gcnew array<byte>('0xff','0x11');


如何 在c++定义一个byte[].传递给webserviceuplowadfile(byte[] fidata)



错误:
错误2error C3149: “cli::array<Type>”: 此处没有顶级“^”,不能使用此类型
错误3error C2767: 托管数组维度不匹配: 应为 1 个参数,但提供了 2 个
错误4error C2440: “初始化”: 无法从“cli::array<Type,dimension> ^”转换为“cli::array<Type> ^”



我是想把客户端c++ 从文件得到的数据流char *p; 传递给webservice,求救 求救

[解决办法]
用花括号,不是用括号

读书人网 >VC/MFC

热点推荐