xml-soap-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kutac" <ku...@intersystems.cz>
Subject Apache SOAP bug?
Date Tue, 11 Jun 2002 10:25:48 GMT
Hi,

this simple code:

 public static void main( String[] args) {

  try {
    //URL url = new URL(http://localhost/csp/demos/WS.Calc.cls);
    URL url = new URL("http://localhost:8080/csp/demos/WS.Calc.cls");
    String urn = "";

    // Build the call.
    Call call = new Call();


    call.setTargetObjectURI("http://tempuri.org/webservices/WS.Calc.Add");
    call.setMethodName ("Add");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

    Vector params = new Vector ();
    params.addElement (new Parameter("a", Float.class, new Float(1), null));
    params.addElement (new Parameter("b", Float.class, new Float(2), null));
    call.setParams (params);

    // make the call: note that the action URI is empty because the
    // XML-SOAP rpc router does not need this. This may change in the
    // future.
    Response resp = call.invoke (/* router URL */ url, /* actionURI */
urn );

    // Check the response.
    if (resp.generatedFault ()) {
      Fault fault = resp.getFault ();
      System.out.println ("Ouch, the call failed: ");
      System.out.println ("  Fault Code   = " + fault.getFaultCode ());
      System.out.println ("  Fault String = " + fault.getFaultString ());
    } else {
      Parameter result = resp.getReturnValue ();
      System.out.println (result.getValue ());
    }

    } catch (Exception e) {
      e.printStackTrace();
    }

puts <SOAP-ENV:encodingStyle ..> tag into envelope's body.

<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:Add xmlns:ns1="http://tempuri.org/webservices/WS.Calc.Add"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <a xsi:type="xsd:float">1.0</a>
  <b xsi:type="xsd:float">2.0</b>
  </ns1:Add>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>


Why? Is this a bug or do I miss something?

Thanks a lot for any help



Dan

Mime
View raw message