Hi Deepal!

Bellow, the code of my service:

------------------------------------------------------------------------------------------------
import javax.xml.stream.XMLStreamException;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;

public class Servicos {

     public OMElement fatorial(OMElement elemento)
                                throws XMLStreamException {
            //OMElement metodo = null;
            elemento.build();
            elemento.detach();
        
            String rootName = elemento.getLocalName();
            System.out.println("Reading "+rootName+" element");
            
            OMElement elementoFilho = elemento.getFirstElement();
            
            String valorxml = elementoFilho.getText();
            long valrecebido = Long.parseLong(valorxml);  
            
            long inicio = System.nanoTime();

            String resultado = Fatorial.retornaFatorial(valrecebido);           
                     
            
            OMFactory fac = OMAbstractFactory.getOMFactory();
            OMNamespace omNs =
fac.createOMNamespace("http://examplo1.org/exemplo1";, "exemplo");
            OMElement metodo = fac.createOMElement("fatorialResposta",omNs);
            OMElement valor = fac.createOMElement("greeting", omNs);
            valor.addChild(fac.createOMText(valor, "Resultado do Fatorial:
"+resultado));
            metodo.addChild(valor);
            
            long fim = System.nanoTime();

            double diferenca = (double)(fim-inicio)/1000000000;
            String diferencafile = Double.toString(diferenca);
            
            // Grava no arquivo o tempo necessário para a computação
            Arquivo arquivo = new Arquivo();
            arquivo.Escreve(diferencafile+"\n");
            
            return metodo;
     }
    
}
-------------------------------------------------------------------------------------------------------------------

I need to obtain the IP address when a client or many clients to access this
service. Then I have to write some routine inside the code that represents
the service.

Could you help me?

Thanks!

Julio


Deepal Jayasinghe-2 wrote:
> 
> http://wso2.org/library/480
> 
> Thanks
> deepal
>> Hi,
>>
>> I would like to kwow how can I get the client URL, (for example:
>> http://192.168.2.3) when the client make a invocation to the service in a
>> service provider?
>>
>> For example, I have the service called MyService, then when the cliente
>> MyClient make a connection to MyService, I would like to get the MyClient
>> IP
>> Address.
>>
>> I would be grateful if someone could explain how to make it.
>>
>> Thanks.
>>
>> Júlio 
>>
>> São Carlos - SP - Brazil
>>   
> 
> 
> -- 
> Thanks,
> Deepal
> ................................................................
> "The highest tower is built one brick at a time"
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-a-URL-from-a-Client-when-it-connects-to-service-provider--tf4807674.html#a13755800
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to