Hi,

Doubles are sent on the wire as type xsd:double which is deserialized as
the primitive double. See
http://marc.theaimsgroup.com/?l=soap-user&m=99619205825314&w=2 for a
similar discussion involving primitive (de)serialization.

Nirmal.


                                                                                       
           
                    "Roger L.                                                          
           
                    Costello"            To:     [EMAIL PROTECTED]              
           
                    <costello@mitr       cc:                                           
           
                    e.org>               Subject:     Client passes a Double, server 
receives a   
                                          double?                                      
           
                    09/08/2001                                                         
           
                    12:50 PM                                                           
           
                    Please respond                                                     
           
                    to soap-user                                                       
           
                                                                                       
           
                                                                                       
           



Hi Folks,

I have written a very simple service to compute the square root of a
number:

  public Double getSqrt (Double num) {
      double d = num.doubleValue();
      double result = java.lang.Math.sqrt(d);
      return new Double(result);
  }

In my client I invoke this service, passing it a Double.

When I run the client I get this error message:

Fault String = Exception while handling service request:
SqrtService.getSqrt(double) -- no signature match

Apparently, SOAP is converting the Double class into a double simple
type.  Sure, enough, if I put this method in my service then it works:

  public Double getSqrt (double num) {
      double result = java.lang.Math.sqrt(num);
      return new Double(result);
  }

Note that the parameter is now of type double, rather than Double.

What is going on here?  The client passes a Double, but the server
receives a double ... why?  /Roger





Reply via email to