2 Replies Latest reply on Feb 7, 2014 10:13 AM by Demian Diaz

    WebServiceException StringIndexOutOfBoundsException

    Demian Diaz Newbie

      I'm trying to make a simple hello word web service example.

      I have coded both client and service.

      When I run the client, receive this error


      Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1

          at java.lang.String.substring(String.java:1937)

          at org.jboss.ws.core.client.EndpointInfo.lowerCaseProtocol(EndpointInfo.java:114)

          at org.jboss.ws.core.client.EndpointInfo.<init>(EndpointInfo.java:49)

          at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:353)

          at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:232)

          at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:171)

          at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:157)

          at $Proxy17.sayHelloWorldFrom(Unknown Source)

          at org.calc.cliente.HelloWorldClient.main(HelloWorldClient.java:14)


      the code in the client is this


      public class HelloWorldClient {

        public static void main(String[] argv) {

            IHelloWorld_Service service = new IHelloWorld_Service();

            IHelloWorld port = service.getIHelloWorldPort();

            System.out.print(port.sayHelloWorldFrom("xxxxxxx"));    //--this is the line that throws the exception




      WService it's ok deployed and UP in a JBoss EAP 5.1.2...in default config

      WClient compiles ok with already generated stubs with wsimport from the command line pointing to .wsdl file in the WService.

      Running in localhost. Using Intellij 13, Win XP, JDK 1.6


      In the errPoint.jpg attached file thers a image of the callstack. Marked in blue is the point where exception is thrown. Wsdl file also attached.


      I spend last 3 days searching in the web for a solution and try any suggestions but can't find anything that solve the problem.

      Shortly I will have to develop a WS and a WS client in my job, so I need to practice to learn about this.

      Let me know if any other information about my environment/code is needed and I'll post it.

      Any help will be very appreciated,

      Thanks a lot!