Ok, I found the problem: the response has a blank line in it that causes a
problem in the org.apache.soap.util.net.HTTPUtils post() method.

The soap response is
======
<?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/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";> 
<SOAP-ENV:Body> 
<ns1:IntToRomanResponse xmlns:ns1="urn:Roman-IRoman"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<NS1:return xsi:type="xsd:string">X</NS1:return> 
</ns1:IntToRomanResponse>

</SOAP-ENV:Body> 
</SOAP-ENV:Envelope>
======

I notice the fix is in the latest nightly source...

Regards,

Neil

-----Original Message-----
From: Neil Smyth [mailto:[EMAIL PROTECTED]]
Sent: 20 September 2001 16:23
To: '[EMAIL PROTECTED]'
Subject: StringOutOfBoundsException when invoking


I'm using Apache Soap v2.2, and by and large it is working fine in calling
basic services over the web. However when I call the service at

http://www.ebob42.com/cgi-bin/Romulan.exe/soap/IRoman
 =======
public static void main(String[] args) {
    try {
      // Build the call.
      Call call = new Call();
      call.setTargetObjectURI("URIurn:Roman-IRoman");
      call.setMethodName("IntToRoman");
      call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
      Vector soapParams = new Vector();

      soapParams.addElement(new Parameter("Int", int.class,
                                        new Integer(10), null));
      call.setParams(soapParams);

      // make the call: 
      Response resp = call.invoke(new
URL("http://www.ebob42.com/cgi-bin/Romulan.exe/soap/IRoman";), 
                                  "");
    } catch (Exception e) {
      System.out.println(e.toString());
    }
  }
=======
gives result 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1

I get a StringIndexOutOfBounds in the invoke() method. Has anyone else come
across this or something similar? It looks to me like it might be a soap
compatibility issue as the service is hosted on another implementation
(delphi).

Comments/thoughts appreciated!

Neil

Neil Smyth
Senior Software Engineer, Altio
T: +44(0) 20 8580 4519
F: +44(0) 20 8580 2050
nsmyth_at_altio.com
http://www.altio.com

Reply via email to