简体   繁体   English

如何使用C#webservice?

[英]How to consume C# webservice?

I practice some web service to know more about the limit of input and output they can receive. 我练习一些Web服务来了解更多关于他们可以接收的输入和输出的限制。 Is any parameter can use (include instance data type) in webservice? 是否可以在webservice中使用任何参数(包括实例数据类型)? If true how can I consume this webservice? 如果是,我如何使用此Web服务?

[WebMethod]
public string uploadFile(string path, string fileName, string mimeType, byte[] documentContent){
    return ECMApi.createDocumentByPath(path, fileName, mimeType, documentContent);
}

If by instance type you are referring to a reference object as opposed to value type, then yes you can you them. 如果按实例类型指的是引用对象而不是值类型,那么是的,你可以使用它们。 There may be different constraints if you are using REST, or WCF, or calling web methods via ajax. 如果您使用REST或WCF,或通过ajax调用Web方法,则可能存在不同的约束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM