Conversion C# to VB .Net

  • Thread starter Thread starter Giovanni Maraschine
  • Start date Start date
G

Giovanni Maraschine

Guest
Hello.


I have an code, write in C#:

[SoapDocumentMethod("http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4/nfeStatusServicoNF", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Bare)]
[return: XmlElement("nfeResultMsg", Namespace = "http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4")]
[WebMethod(MessageName = "nfeStatusServicoNF")]
public XmlNode Execute([XmlElement(Namespace = "http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4")] XmlNode nfeDadosMsg)
{
var results = Invoke("nfeStatusServicoNF", new object[] { nfeDadosMsg });
return (XmlNode)(results[0]);
}


Using Telerik Code Converter (http://converter.telerik.com/), the code in VB .Net is:

<SoapDocumentMethod("http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4/nfeStatusServicoNF", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Bare)>
<XmlElement("nfeResultMsg", [Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4")>
<WebMethod(MessageName:="nfeStatusServicoNF")>
Public Function Execute(
<XmlElement([Namespace]:="http://www.portalfiscal.inf.br/nfe/wsdl/NFeStatusServico4")> ByVal nfeDadosMsg As XmlNode) As XmlNode
Dim results = Invoke("nfeStatusServicoNF", New Object() {nfeDadosMsg})
Return CType((results(0)), XmlNode)
End Function


However, apparently, the XmlElement (in VB .Net) can't be applied with Public Function. So, the translated code, can't be used.


Help-me with this translate! =)

Continue reading...
 
Back
Top