Wednesday, May 8, 2013

Call .NET ( asmx webservice )

 I use this code to request URL and then parse xml
but the problem is that status code returned is zero
??


     RequestBuilder rb =
 new RequestBuilder(RequestBuilder.GET, URL.encode("http://www.w3schools.com/webservices/tempconvert.asmx/CelsiusToFahrenheit?Celsius=50"));       

     
     try{
         
     
   
    rb.sendRequest(null, new RequestCallback() {
       
       
        @Override
        public void onResponseReceived(Request request, Response response) {
            // TODO Auto-generated method stub
       
       
      
     if(response.getStatusCode() == 200){
                String aid = response.getText(); //this just parses the response in order to get the string I need
               Window.alert("Sucess: "+ aid);
            
           }
        
              
        
        }
       
        @Override
        public void onError(Request request, Throwable exception) {
            // TODO Auto-generated method stub
            System.out.print("Error Occure ");
        }
    });
     }
     
     catch(Exception ex){
         System.out.print(ex);
     }
     
    
    is there any another code or classes used to call webservice ??
   


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment