C# 需要帮助将VB.NETWebServiceSOAP方法转换为C吗#
我尝试过在线转换器,但在下面的函数调用中忽略了C# 需要帮助将VB.NETWebServiceSOAP方法转换为C吗#,c#,vb.net,C#,Vb.net,我尝试过在线转换器,但在下面的函数调用中忽略了 <WebMethod(), SoapHeader("Credentials", Direction:=SoapHeaderDirection.InOut)> _ Public Function GetPDFArray(ByVal id As Integer) As <Serialization.XmlElement("binaryData", DataType:=
<WebMethod(), SoapHeader("Credentials", Direction:=SoapHeaderDirection.InOut)> _
Public Function GetPDFArray(ByVal id As Integer) As <Serialization.XmlElement("binaryData", DataType:="base64Binary")> Byte()
_
公共函数GetPDFArray(ByVal id为整数)为Byte()
如果有人能提供帮助,我们将不胜感激。在C#中,您需要在方法标题之前具有“return”属性:
[WebMethod(), SoapHeader("Credentials", Direction=SoapHeaderDirection.InOut)]
[return: Serialization.XmlElement("binaryData", DataType="base64Binary")]
public byte[] GetPDFArray(int id)
{
...
}
谢谢你@Dave,它成功了,非常感谢@米拉利:没问题——我刚刚意识到我遗漏了“WebMethod”和“SoapHeader”属性。