Hi,
Which version of SAAJ are you using. Why not try using JAXWS for
doing this kind of things. I also see that you are doing some kind of
SOAP Message security, for that you can make use of WSIT.
If you think the problem is occuring with the latest version of SAAJ
then can you send us a Reproducable Testcase that i can run.
Thanks.
Luiz Ricardo wrote:
> Hi everyone,
>
> I'm from Aracaju - SE, Brazil. I'm with problems invoking
> the getSOAPBody() method. It was developed a web service using the
> SAAJ API and subclassing SAAJServlet and now when a client sends a
> request with length nearly 400 kb my servlets hangs just at this
> point, that is, invoking the getSOAPBody() method.
>
> Follow below the piece of code:
>
> ...
> @Override
> public SOAPMessage onMessage(SOAPMessage message, HttpServletRequest
> request) {
> try {
> String response = null;
> // it hangs here!!!! :(((
> *SOAPBody body = message.getSOAPBody();
> * // recupera a URI do namespace do serviço
> String namespaceUri = getNamespaceUri();
> // recupera o conteúdo XML da área de cabeçalho da mensagem
> String nfeCabecMsg = body.getElementsByTagNameNS(namespaceUri,
> "nfeCabecMsg").item(0).getTextContent();
> // recupera o conteúdo XML da área de dados da mensagem
> String nfeDadosMsg = body.getElementsByTagNameNS(namespaceUri,
> "nfeDadosMsg").item(0).getTextContent();
> // recupera o nome do método do web service que está sendo
> invocado pelo cliente
> String metodo = body.getFirstChild().getNodeName();
> // testa se o nome do método invocado coincide com o nome do serviço
> if (!metodo.equals(getNomeMetodoServico())) {
> String msg = "Chamada ao método " + metodo + " quando o
> esperado era " + getNomeMetodoServico() + ".";
> logger.error(msg);
> throw new IllegalArgumentException(msg);
> }
>
> X509Certificate[] cert = (X509Certificate[])
> request.getAttribute("javax.servlet.request.X509Certificate");
>
> TORequisicaoCliente rc = new TORequisicaoCliente();
> rc.setXmlCabec(nfeCabecMsg);
> rc.setXmlDados(nfeDadosMsg);
> rc.setX509Cert(cert[0]);
> response = validacaoInicial(rc,
> WS_NFE_RECEPCAO.equals(getServletName()));
> return montarMensagemSOAP(response);
> } catch (DOMException dome) {
> logger.error("Erro ao tentar recuperar partes do corpo da
> mensagem SOAP.", dome);
> } catch (SOAPException soape) {
> logger.error("Erro ao tentar recuperar/criar mensagem SOAP.",
> soape);
> } catch (Exception e) {
> logger.error("Erro inesperado.", e);
> }
> return null;
> }
> ...
>
> Please, help us! Me and my team are waiting to resolve this problem!
> Any help is welcome!
>
> Regards,
>
> Luiz Ricardo Belém Santos
> Sun Certified Programmer for the Java 2 Platform
>
> Flickr agora em português. Você clica, todo mundo vê. Saiba mais
> <http://br.rd.yahoo.com/mail/taglines/flickr/*http://www.flickr.com.br/>.