[jboss-user] [JBoss Web Services] - Re: Jax-ws client Return Null

Rui Nogueira do-not-reply at jboss.com
Fri Jun 24 05:17:57 EDT 2011


Rui Nogueira [http://community.jboss.org/people/kumandus] created the discussion

"Re: Jax-ws client Return Null"

To view the discussion, visit: http://community.jboss.org/message/611799#611799

--------------------------------------------------------------
I made a little breakthrough i implemented a SOAPHandler. Like a said on my desktopstation everything runs nice, so by implementing this handler i could see that in the mainFrame i am getting a response from the webmethod but when i do the cast to the object, the object remains null. My guess is that is something wrong on deserializabling the message to the object.

private static String getValoresFicheiro( String[] message )
    {

        String messageReturn = "";

        try {
            /*
            log.info( "Connecting..." );        
            Service service = new Service(); //Cria o servico
            log.info( "Connecting established with service: " + service.getServiceName() );

            log.info( "Adding port to Service..." );
            PortObject port =  service.getPort();

            log.info( "Inserting autentication..." );
            ( ( BindingProvider )port ).getRequestContext().put( BindingProvider.USERNAME_PROPERTY, "******" );
            ( ( BindingProvider )port ).getRequestContext().put( BindingProvider.PASSWORD_PROPERTY, "*****" );

            ( ( BindingProvider )port ).getRequestContext().put( StubExt.PROPERTY_CLIENT_TIMEOUT, new Integer(300000) );

            Binding binding = ( ( BindingProvider )port ).getBinding();
            // Add the logging handler
            List handlerList = binding.getHandlerChain();
            if (handlerList == null)
                   handlerList = new ArrayList();
            LoggingHandler loggingHandler = new LoggingHandler();
            handlerList.add(loggingHandler);
            binding.setHandlerChain(handlerList);

            log.info( "Initializing request structure..." );
            RequestObject pedido = arrayStringToEstruturaPedido( message );

            log.info("Executing Function getValoresFicheiro..." );
            ResponseObject resposta = new ResponseObject();
            resposta = port.getValoresFicheiro( pedido );

            if ( resposta == null ){
                log.info(  "Resposta null" );  ->IN the MainFrame This message Appears
            }

            log.info( "Composing the response message..." );            
            messageReturn = estruturaRespostaToString( resposta );

            log.info("Message Response: " + messageReturn);

            handlerList = binding.getHandlerChain();
            if (handlerList != null && loggingHandler != null)
                handlerList.remove(loggingHandler);
        } 
        catch ( IIException e ) {
            //@TODO depois remover isto
            log.error( e.toString() );
            messageReturn = ErrorMessageFactory.getErrorMessage( WsConstants.ERRORSTR + e.toString() );
        } 
        catch ( WSException e ) {
            //@TODO depois remover isto
            log.error( e.toString() );    
            messageReturn = ErrorMessageFactory.getErrorMessage ( WsConstants.ERRORSTR + e.toString() );
        } 
        catch ( Exception e ) {
            log.error( e.toString() );
            messageReturn = ErrorMessageFactory.getErrorMessage( WsConstants.ERRORSTR + e.toString() );
        }
        return messageReturn;
    }

The Webservice is not mine i'am just invoque him. Does anyone have a clue about wahts going on?!
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/611799#611799]

Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110624/73151921/attachment-0001.html 


More information about the jboss-user mailing list