CarvalR2, neste exemplo que vc deu, se eu entendi, a minha aplicação seria o cliente e o webservice o qual quero consumir seria o servidor. Tendo em vista que não foi alterado nada na minha aplicação e que a comunicação estava sendo realizada normalmente a alguns dias atrás, o problema poderia ser que foi alterada a forma de compressão esperada pelo webservice que recebe essa mensagem SOAP?
a classe que que gera a mensagem soap e realiza o envio ao webservice:
public String recepcionarloterps( String gxTp_xml )
{
String returnRecepcionarLoteRps ;
initialize();
returnRecepcionarLoteRps = "";
context.globals.nSOAPErr = (short)(0) ;
context.globals.sSOAPErrMsg = "" ;
SoapParm.assignlocationproperties( context, "br_com_issnetonline_wwwwebservice_nfd_Homologacao_Servicos", GXSoapHTTPClient);
GXSoapHTTPClient.addHeader("Content-type", "text/xml;charset=utf-8");
GXSoapHTTPClient.addHeader("Connection", "close");
GXSoapHTTPClient.addHeader("SOAPAction", "http://www.issnetonline.com.br/webservice/nfd/RecepcionarLoteRps");
GXSoapXMLWriter.openRequest(GXSoapHTTPClient);
GXSoapXMLWriter.writeStartDocument("utf-8", (byte)(0));
GXSoapXMLWriter.writeStartElement("SOAP-ENV:Envelope");
GXSoapXMLWriter.writeAttribute("xmlns:SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/");
GXSoapXMLWriter.writeAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
GXSoapXMLWriter.writeAttribute("xmlns:SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/");
GXSoapXMLWriter.writeAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
if ( ! ( soapHeaders == null ) )
{
if ( ( soapHeaders.size() > 0 ) )
{
soapHeaders.writexml(GXSoapXMLWriter, "SOAP-ENV:Header", "");
}
}
GXSoapXMLWriter.writeStartElement("SOAP-ENV:Body");
GXSoapXMLWriter.writeStartElement("RecepcionarLoteRps");
GXSoapXMLWriter.writeAttribute("xmlns", "http://www.issnetonline.com.br/webservice/nfd");
GXSoapXMLWriter.writeElement("xml", GXutil.rtrim( gxTp_xml));
GXSoapXMLWriter.writeEndElement();
GXSoapXMLWriter.writeEndElement();
GXSoapXMLWriter.writeEndElement();
GXSoapXMLWriter.close();
GXSoapHTTPClient.execute("POST", "servicos.asmx");
if ( ( GXSoapHTTPClient.getErrCode() == 0 ) )
{
GXSoapXMLReader.openResponse(GXSoapHTTPClient);
GXSoapError = GXSoapXMLReader.read() ;
while ( ( GXSoapError > 0 ) )
{
if ( ( GXutil.strSearch( GXSoapXMLReader.getName(), "Body", 1) > 0 ) )
{
if (true) break;
}
GXSoapError = GXSoapXMLReader.read() ;
}
if ( ( GXSoapError > 0 ) )
{
GXSoapError = GXSoapXMLReader.read() ;
if ( ( GXSoapError > 0 ) && ( GXutil.strcmp(GXSoapXMLReader.getLocalName(), "Fault") == 0 ) )
{
soapFault = (short)(1) ;
}
}
sTagName = GXSoapXMLReader.getName() ;
if ( ( soapFault == 0 ) )
{
GXSoapError = GXSoapXMLReader.read() ;
if ( ( GXSoapError > 0 ) && ( GXutil.strcmp(GXSoapXMLReader.getLocalName(), "Fault") == 0 ) )
{
soapFault = (short)(1) ;
}
}
if ( ( soapFault == 1 ) )
{
GXSoapXMLReader.read();
while ( ! ( ( GXutil.strcmp(GXSoapXMLReader.getLocalName(), "Fault") == 0 ) && ( GXSoapXMLReader.getNodeType() == 2 ) ) )
{
if ( ( GXutil.strcmp(GXutil.lower( GXSoapXMLReader.getName()), "faultcode") == 0 ) )
{
sFaultCode = GXSoapXMLReader.getValue() ;
}
else if ( ( GXutil.strcmp(GXutil.lower( GXSoapXMLReader.getName()), "faultstring") == 0 ) )
{
sFaultString = GXSoapXMLReader.getValue() ;
}
else if ( ( GXutil.strcmp(GXutil.lower( GXSoapXMLReader.getName()), "detail") == 0 ) )
{
sDetail = GXSoapXMLReader.getValue() ;
}
GXSoapXMLReader.read();
}
if ( ( GXutil.strcmp(GXutil.lower( sFaultCode), "soap-env:client") == 0 ) )
{
currSoapErr = (short)(-20004) ;
currSoapErrmsg = "Error in client request." + GXutil.newLine( ) + "Message: " + sFaultString + GXutil.newLine( ) + "Detail: " + sDetail ;
}
else if ( ( GXutil.strcmp(GXutil.lower( sFaultCode), "soap-env:server") == 0 ) )
{
currSoapErr = (short)(-20005) ;
currSoapErrmsg = "Error in server execution." + GXutil.newLine( ) + "Message: " + sFaultString + GXutil.newLine( ) + "Detail: " + sDetail ;
}
else
{
currSoapErr = (short)(-20006) ;
currSoapErrmsg = "Unknown error: " + sFaultCode + GXutil.newLine( ) + "Message: " + sFaultString + GXutil.newLine( ) + "Detail: " + sDetail ;
}
}
else
{
nOutParmCount = (short)(0) ;
while ( ( ( GXutil.strcmp(GXSoapXMLReader.getName(), sTagName) != 0 ) || ( GXSoapXMLReader.getNodeType() == 1 ) ) && ( GXSoapError > 0 ) )
{
readOk = (short)(0) ;
if ( ( GXutil.strcmp(GXSoapXMLReader.getLocalName(), "RecepcionarLoteRpsResult") == 0 ) && ( ( GXutil.strcmp(GXSoapXMLReader.getNamespaceURI(), "http://www.issnetonline.com.br/webservice/nfd") == 0 ) || ( GXutil.strcmp(GXSoapXMLReader.getNamespaceURI(), "") == 0 ) ) )
{
returnRecepcionarLoteRps = GXSoapXMLReader.getValue() ;
if ( ( GXSoapError > 0 ) )
{
readOk = (short)(1) ;
}
}
GXSoapError = GXSoapXMLReader.read() ;
nOutParmCount = (short)(nOutParmCount+1) ;
if ( ( readOk == 0 ) )
{
context.globals.sSOAPErrMsg = context.globals.sSOAPErrMsg + "Error reading " + sTagName + GXutil.newLine( ) ;
GXSoapError = (short)(nOutParmCount*-1) ;
}
}
}
GXSoapXMLReader.close();
}
else
{
currSoapErr = (short)(GXSoapHTTPClient.getErrCode()*-1-10000) ;
currSoapErrmsg = GXSoapHTTPClient.getErrDescription() + " (HTTP Error: " + GXutil.trim( GXutil.str( GXSoapHTTPClient.getStatusCode(), 10, 0)) + " " + GXSoapHTTPClient.getReasonLine() + ")" ;
}
if ( ( currSoapErr == 0 ) )
{
if ( ( GXSoapError < 0 ) )
{
currSoapErr = (short)(GXSoapError*-1) ;
currSoapErrmsg = context.globals.sSOAPErrMsg ;
}
else
{
if ( ( GXSoapXMLReader.getErrCode() > 0 ) )
{
currSoapErr = (short)(GXSoapXMLReader.getErrCode()*-1) ;
currSoapErrmsg = GXSoapXMLReader.getErrDescription() ;
}
else
{
if ( ( GXSoapError == 0 ) )
{
currSoapErr = (short)(-20001) ;
currSoapErrmsg = "Malformed SOAP message." ;
}
else
{
currSoapErr = (short)(0) ;
currSoapErrmsg = "No error." ;
}
}
}
}
if ( ( currSoapErr != 0 ) )
{
oLocation = SoapParm.getlocation(context, "br_com_issnetonline_wwwwebservice_nfd_Homologacao_Servicos") ;
if ( ( oLocation.getCancelOnError() == 0 ) || ( oLocation.getCancelOnError() == 1 ) )
{
throw new RuntimeException(currSoapErrmsg + "(" + currSoapErr+ ")"); // A Exceção é lançada aqui....
}
}
context.globals.nSOAPErr = currSoapErr ;
context.globals.sSOAPErrMsg = currSoapErrmsg ;
return returnRecepcionarLoteRps ;
}