System.Threading.Threadabortexception: Thread was being undone. While consuming webservice operation

Asked

Viewed 1,472 times

3

I have the following code:

proxy_hom_recepcionarLoteRps.RecepcionarLoteRPS proxy = new 
proxy_hom_recepcionarLoteRps.RecepcionarLoteRPS();

proxy.Url = url + "/arecepcionarloterps";

string resp = proxy.Execute(CABECALHO, xmlEnvio);

Execute is a method imported from a WSDL:

public partial class RecepcionarLoteRPS : 
System.Web.Services.Protocols.SoapHttpClientProtocol
{

    /// <remarks/>
    public RecepcionarLoteRPS()
    {
        this.Url = "http://nfsev-prd.manaus.am.gov.br/nfsev/servlet/arecepcionarloterps";
    }

    /// <remarks/>
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.e-nfs.com.braction/ARECEPCIONARLOTERPS.Execute", RequestElementName="RecepcionarLoteRPS.Execute", RequestNamespace="http://www.e-nfs.com.br", ResponseElementName="RecepcionarLoteRPS.ExecuteResponse", ResponseNamespace="http://www.e-nfs.com.br", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("Outputxml")]
    public string Execute(string Nfsecabecmsg, string Nfsedadosmsg)
    {
        object[] results = this.Invoke("Execute", new object[] {
                    Nfsecabecmsg,
                    Nfsedadosmsg});
        return ((string)(results[0]));
    }

The Execute calls a web service request operation, but sometimes returns the exception:

System.Threading.Threadabortexception: The thread was being undone. in System.RuntimeMethodHandle. _Invokemethodfast(Object target, Object[] Arguments, Signaturestruct& Sig, Methodattributes methodAttributes, Runtimetypehandle typeOwner) in System.RuntimeMethodHandle.Invokemethodfast(Object target, Object[] Arguments, Signature Sig, Methodattributes methodAttributes, Runtimetypehandle typeOwner) in System.Reflection.Runtimemethodinfo.Invoke(Object obj, Bindingflags invokeAttr, Binder Binder, Object[] Parameters, Cultureinfo Culture, Boolean skipVisibilityChecks) System.Reflection.Runtimemethodinfo.Invoke(Object obj, Bindingflags invokeAttr, Binder Binder, Object[] Parameters, Cultureinfo Culture) em System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) in System.Type.Invokemember(String name, Bindingflags invokeAttr, Binder Binder, Object target, Object[] args) nfsews.LinxEnviarLoteRpsImpl.executes(String sending) in nfsews.IntegratorNFSe.Linxenviarloterps(String sending)

Would anyone know how to treat me ?

  • 1

    include your proxy code RecepcionarLoteRPS and the method Execute()

  • Included. Execute was imported from a WSDL

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.