You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by olanga henry <ol...@hotmail.com> on 2008/05/05 22:12:35 UTC

cxf client to invoke strikeIron ws

Here is my client code to invoke the StrikeIron NFLTeam web service.  I generated the client artifacts using the wsdl2java utility with -exsh flag set to true after referring to http://www.jroller.com/gmazza/date/20071001 (Sending implicit SOAP Headers using JAX-WS).  

package client;

import java.util.*;
import javax.xml.ws.Holder;
import com.strikeiron.*;
import com.strikeiron.ws.*;
import org.apache.cxf.transports.http.configuration.*;
import org.apache.cxf.transport.http.*;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.endpoint.Client;

public class WSClient {

    private static void setProxyInfo(Object port)
    {
		Client client = ClientProxy.getClient( port );
                HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
                HTTPClientPolicy policy = new HTTPClientPolicy();
                policy.setProxyServer( "proxy.domain.com" );
                policy.setProxyServerPort( 8080 );
                httpConduit.setClient( policy );
    }

    private static LicenseInfo getLicenseInfo()
    {
	LicenseInfo licenseInfo = new LicenseInfo();
	RegisteredUser registeredUser = new RegisteredUser();
	registeredUser.setUserID("iam@email.com");
	registeredUser.setPassword("mypwd");
	licenseInfo.setRegisteredUser( registeredUser );
	return licenseInfo;
    }

    private static javax.xml.ws.Holder getSubscriptionInfo()
    {
	SubscriptionInfo sInfo = new SubscriptionInfo();
	javax.xml.ws.Holder holder = new javax.xml.ws.Holder( sInfo );

	return holder;	
    }

    public static void main (String[] args) {
        try {
            if (args.length != 1) {
                System.out.println("Usage: WSClient ");
                System.exit(0);
            }
            
            SDPNFLTeams sdpService = new SDPNFLTeams();
            SDPNFLTeamsSoap endpt = sdpService.getSDPNFLTeamsSoap();            
	    setProxyInfo( endpt );	
           
            com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );
	    List teamInfo = x.getServiceResult().getTeams().getNFLTeamInfo();
	    for(NFLTeamInfo tix: teamInfo) {
		System.out.println( tix.getNickname()+" "+tix.getDivision() );
	    }
	    

        } catch (Exception e) {
	    e.printStackTrace();
            System.out.println("Exception: " +  e.getMessage());
        }
    }
}

=================================================================================
Everthing seems fine till the execution point when I get an exception I cannot understand:

     [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
     [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
     [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
     [java]     at client.WSClient.main(WSClient.java:60)
     [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
     [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
     [java]     at java.util.ArrayList.get(ArrayList.java:321)
     [java]     at org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:79)
     [java]     at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:64)
     [java]     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
     [java]     at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
     [java]     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
     [java]     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
     [java]     at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
     [java]     at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
     [java]     at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
     [java]     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
     [java]     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
     [java]     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
     [java]     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
     [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
     [java]     ... 2 more
     [java] Exception: Index: 3, Size: 3
=================================================================================

Thanks,

_________________________________________________________________
Windows Live SkyDrive lets you share files with faraway friends.
http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_052008

RE: cxf client to invoke strikeIron ws

Posted by olanga henry <ol...@hotmail.com>.
Done!https://issues.apache.org/jira/browse/CXF-1568> Date: Mon, 5 May 2008 17:41:19 -0400> From: bimargulies@gmail.com> To: users@cxf.apache.org> Subject: Re: cxf client to invoke strikeIron ws> > Please make a JIRA for this.> > On Mon, May 5, 2008 at 4:12 PM, olanga henry <ol...@hotmail.com> wrote:> >> >  Here is my client code to invoke the StrikeIron NFLTeam web service.  I generated the client artifacts using the wsdl2java utility with -exsh flag set to true after referring to http://www.jroller.com/gmazza/date/20071001 (Sending implicit SOAP Headers using JAX-WS).> >> >  package client;> >> >  import java.util.*;> >  import javax.xml.ws.Holder;> >  import com.strikeiron.*;> >  import com.strikeiron.ws.*;> >  import org.apache.cxf.transports.http.configuration.*;> >  import org.apache.cxf.transport.http.*;> >  import org.apache.cxf.frontend.ClientProxy;> >  import org.apache.cxf.endpoint.Client;> >> >  public class WSClient {> >> >     private static void setProxyInfo(Object port)> >     {> >                 Client client = ClientProxy.getClient( port );> >                 HTTPConduit httpConduit = (HTTPConduit) client.getConduit();> >                 HTTPClientPolicy policy = new HTTPClientPolicy();> >                 policy.setProxyServer( "proxy.domain.com" );> >                 policy.setProxyServerPort( 8080 );> >                 httpConduit.setClient( policy );> >     }> >> >     private static LicenseInfo getLicenseInfo()> >     {> >         LicenseInfo licenseInfo = new LicenseInfo();> >         RegisteredUser registeredUser = new RegisteredUser();> >         registeredUser.setUserID("iam@email.com");> >         registeredUser.setPassword("mypwd");> >         licenseInfo.setRegisteredUser( registeredUser );> >         return licenseInfo;> >     }> >> >     private static javax.xml.ws.Holder getSubscriptionInfo()> >     {> >         SubscriptionInfo sInfo = new SubscriptionInfo();> >         javax.xml.ws.Holder holder = new javax.xml.ws.Holder( sInfo );> >> >         return holder;> >     }> >> >     public static void main (String[] args) {> >         try {> >             if (args.length != 1) {> >                 System.out.println("Usage: WSClient ");> >                 System.exit(0);> >             }> >> >             SDPNFLTeams sdpService = new SDPNFLTeams();> >             SDPNFLTeamsSoap endpt = sdpService.getSDPNFLTeamsSoap();> >             setProxyInfo( endpt );> >> >             com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );> >             List teamInfo = x.getServiceResult().getTeams().getNFLTeamInfo();> >             for(NFLTeamInfo tix: teamInfo) {> >                 System.out.println( tix.getNickname()+" "+tix.getDivision() );> >             }> >> >> >         } catch (Exception e) {> >             e.printStackTrace();> >             System.out.println("Exception: " +  e.getMessage());> >         }> >     }> >  }> >> >  =================================================================================> >  Everthing seems fine till the execution point when I get an exception I cannot understand:> >> >      [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3> >      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)> >      [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)> >      [java]     at client.WSClient.main(WSClient.java:60)> >      [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3> >      [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)> >      [java]     at java.util.ArrayList.get(ArrayList.java:321)> >      [java]     at org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:79)> >      [java]     at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:64)> >      [java]     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)> >      [java]     at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)> >      [java]     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)> >      [java]     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)> >      [java]     at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)> >      [java]     at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)> >      [java]     at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)> >      [java]     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)> >      [java]     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)> >      [java]     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)> >      [java]     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)> >      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)> >      [java]     ... 2 more> >      [java] Exception: Index: 3, Size: 3> >  =================================================================================> >> >  Thanks,> >> >  _________________________________________________________________> >  Windows Live SkyDrive lets you share files with faraway friends.> >  http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_052008
_________________________________________________________________
Stay in touch when you're away with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_messenger_052008

Re: cxf client to invoke strikeIron ws

Posted by Benson Margulies <bi...@gmail.com>.
Please make a JIRA for this.

On Mon, May 5, 2008 at 4:12 PM, olanga henry <ol...@hotmail.com> wrote:
>
>  Here is my client code to invoke the StrikeIron NFLTeam web service.  I generated the client artifacts using the wsdl2java utility with -exsh flag set to true after referring to http://www.jroller.com/gmazza/date/20071001 (Sending implicit SOAP Headers using JAX-WS).
>
>  package client;
>
>  import java.util.*;
>  import javax.xml.ws.Holder;
>  import com.strikeiron.*;
>  import com.strikeiron.ws.*;
>  import org.apache.cxf.transports.http.configuration.*;
>  import org.apache.cxf.transport.http.*;
>  import org.apache.cxf.frontend.ClientProxy;
>  import org.apache.cxf.endpoint.Client;
>
>  public class WSClient {
>
>     private static void setProxyInfo(Object port)
>     {
>                 Client client = ClientProxy.getClient( port );
>                 HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
>                 HTTPClientPolicy policy = new HTTPClientPolicy();
>                 policy.setProxyServer( "proxy.domain.com" );
>                 policy.setProxyServerPort( 8080 );
>                 httpConduit.setClient( policy );
>     }
>
>     private static LicenseInfo getLicenseInfo()
>     {
>         LicenseInfo licenseInfo = new LicenseInfo();
>         RegisteredUser registeredUser = new RegisteredUser();
>         registeredUser.setUserID("iam@email.com");
>         registeredUser.setPassword("mypwd");
>         licenseInfo.setRegisteredUser( registeredUser );
>         return licenseInfo;
>     }
>
>     private static javax.xml.ws.Holder getSubscriptionInfo()
>     {
>         SubscriptionInfo sInfo = new SubscriptionInfo();
>         javax.xml.ws.Holder holder = new javax.xml.ws.Holder( sInfo );
>
>         return holder;
>     }
>
>     public static void main (String[] args) {
>         try {
>             if (args.length != 1) {
>                 System.out.println("Usage: WSClient ");
>                 System.exit(0);
>             }
>
>             SDPNFLTeams sdpService = new SDPNFLTeams();
>             SDPNFLTeamsSoap endpt = sdpService.getSDPNFLTeamsSoap();
>             setProxyInfo( endpt );
>
>             com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );
>             List teamInfo = x.getServiceResult().getTeams().getNFLTeamInfo();
>             for(NFLTeamInfo tix: teamInfo) {
>                 System.out.println( tix.getNickname()+" "+tix.getDivision() );
>             }
>
>
>         } catch (Exception e) {
>             e.printStackTrace();
>             System.out.println("Exception: " +  e.getMessage());
>         }
>     }
>  }
>
>  =================================================================================
>  Everthing seems fine till the execution point when I get an exception I cannot understand:
>
>      [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
>      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
>      [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
>      [java]     at client.WSClient.main(WSClient.java:60)
>      [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
>      [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
>      [java]     at java.util.ArrayList.get(ArrayList.java:321)
>      [java]     at org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:79)
>      [java]     at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:64)
>      [java]     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
>      [java]     at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
>      [java]     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
>      [java]     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
>      [java]     at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
>      [java]     at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
>      [java]     at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>      [java]     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
>      [java]     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
>      [java]     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
>      [java]     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
>      [java]     ... 2 more
>      [java] Exception: Index: 3, Size: 3
>  =================================================================================
>
>  Thanks,
>
>  _________________________________________________________________
>  Windows Live SkyDrive lets you share files with faraway friends.
>  http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_052008

RE: cxf client to invoke strikeIron ws

Posted by olanga henry <ol...@hotmail.com>.
"It works fine with the other version of services that incorporate the authentication information into the request message".  I have not tried GlassFish Metro yet, will try it.> Date: Mon, 5 May 2008 19:00:23 -0400> From: glen.mazza@verizon.net> Subject: RE: cxf client to invoke strikeIron ws> To: users@cxf.apache.org> > What happens when you try using StrikeIron's version that *doesn't*> require implicit headers?  Also, does your implicit header code work> with GlassFish Metro?  The sample> (http://www.jroller.com/gmazza/date/20070929) provides information on> how to use either web service stack.> > If you're serious about learning web services it is best to get> acquainted with both web service stacks and test against both.  It very> quickly helps with debugging, because you find out whether or not the> problem is with the SOAP client or the web service stack; also, the two> stacks tend to give different error messages, also helpful with> debugging.> > Glen> > > 2008-05-05 olanga henry wrote:> > No, same results for Indianapolis or any other city names.> > > > ----------------------------------------> > > Date: Mon, 5 May 2008 18:34:15 -0400> > > From: glen.mazza@verizon.net> > > Subject: Re: cxf client to invoke strikeIron ws> > > To: users@cxf.apache.org> > > > > > Could it be that you misspelled Indianapolis, and your code can't handle> > > getting "null" back?> > > > > > Glen> > > > > > 2008-05-05 olanga henry wrote:> > >>            > > >>             com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );> > > > > > > > >> =================================================================================> > >> Everthing seems fine till the execution point when I get an exception I cannot understand:> > >> > > >>      [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3> > >>      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)> > >>      [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)> > >>      [java]     at client.WSClient.main(WSClient.java:60)> > >>      [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3> > >>      [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)> > >>      [java]     at java.util.ArrayList.get(ArrayList.java:321)> > > > > > > > > > _________________________________________________________________> > Make Windows Vista more reliable and secure with Windows Vista Service Pack 1.> > http://www.windowsvista.com/SP1?WT.mc_id=hotmailvistasp1banner> 
_________________________________________________________________
With Windows Live for mobile, your contacts travel with you.
http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_Refresh_mobile_052008

RE: cxf client to invoke strikeIron ws

Posted by Glen Mazza <gl...@verizon.net>.
What happens when you try using StrikeIron's version that *doesn't*
require implicit headers?  Also, does your implicit header code work
with GlassFish Metro?  The sample
(http://www.jroller.com/gmazza/date/20070929) provides information on
how to use either web service stack.

If you're serious about learning web services it is best to get
acquainted with both web service stacks and test against both.  It very
quickly helps with debugging, because you find out whether or not the
problem is with the SOAP client or the web service stack; also, the two
stacks tend to give different error messages, also helpful with
debugging.

Glen


2008-05-05 olanga henry wrote:
> No, same results for Indianapolis or any other city names.
> 
> ----------------------------------------
> > Date: Mon, 5 May 2008 18:34:15 -0400
> > From: glen.mazza@verizon.net
> > Subject: Re: cxf client to invoke strikeIron ws
> > To: users@cxf.apache.org
> > 
> > Could it be that you misspelled Indianapolis, and your code can't handle
> > getting "null" back?
> > 
> > Glen
> > 
> > 2008-05-05 olanga henry wrote:
> >>            
> >>             com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );
> > 
> > 
> >> =================================================================================
> >> Everthing seems fine till the execution point when I get an exception I cannot understand:
> >> 
> >>      [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
> >>      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
> >>      [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
> >>      [java]     at client.WSClient.main(WSClient.java:60)
> >>      [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
> >>      [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
> >>      [java]     at java.util.ArrayList.get(ArrayList.java:321)
> > 
> > 
> 
> _________________________________________________________________
> Make Windows Vista more reliable and secure with Windows Vista Service Pack 1.
> http://www.windowsvista.com/SP1?WT.mc_id=hotmailvistasp1banner


RE: cxf client to invoke strikeIron ws

Posted by olanga henry <ol...@hotmail.com>.
No, same results for Indianapolis or any other city names.

----------------------------------------
> Date: Mon, 5 May 2008 18:34:15 -0400
> From: glen.mazza@verizon.net
> Subject: Re: cxf client to invoke strikeIron ws
> To: users@cxf.apache.org
> 
> Could it be that you misspelled Indianapolis, and your code can't handle
> getting "null" back?
> 
> Glen
> 
> 2008-05-05 olanga henry wrote:
>>            
>>             com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );
> 
> 
>> =================================================================================
>> Everthing seems fine till the execution point when I get an exception I cannot understand:
>> 
>>      [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
>>      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
>>      [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
>>      [java]     at client.WSClient.main(WSClient.java:60)
>>      [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
>>      [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
>>      [java]     at java.util.ArrayList.get(ArrayList.java:321)
> 
> 

_________________________________________________________________
Make Windows Vista more reliable and secure with Windows Vista Service Pack 1.
http://www.windowsvista.com/SP1?WT.mc_id=hotmailvistasp1banner

Re: cxf client to invoke strikeIron ws

Posted by Glen Mazza <gl...@verizon.net>.
Could it be that you misspelled Indianapolis, and your code can't handle
getting "null" back?

Glen

2008-05-05 olanga henry wrote:
>            
>             com.strikeiron.NFLTeamOutput x = endpt.getTeamInfoByCity( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );


> =================================================================================
> Everthing seems fine till the execution point when I get an exception I cannot understand:
> 
>      [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
>      [java]     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
>      [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
>      [java]     at client.WSClient.main(WSClient.java:60)
>      [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
>      [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
>      [java]     at java.util.ArrayList.get(ArrayList.java:321)



RE: cxf client to invoke strikeIron ws

Posted by olanga henry <ol...@hotmail.com>.
Dan, result was the same with both the versions.  Thanks



> From: dkulp@apache.org
> To: users@cxf.apache.org
> Subject: Re: cxf client to invoke strikeIron ws
> Date: Tue, 6 May 2008 17:41:59 -0400
> 
> 
> Any chance you can try this with 2.0.6 or 2.1?   I fixed a couple  
> header issues with -exsh true  just before 2.1 and 2.0.6 were released.
> 
> Dan
> 
> 
> 
> On May 5, 2008, at 4:12 PM, olanga henry wrote:
> 
> >
> > Here is my client code to invoke the StrikeIron NFLTeam web  
> > service.  I generated the client artifacts using the wsdl2java  
> > utility with -exsh flag set to true after referring to http://www.jroller.com/gmazza/date/20071001 
> >  (Sending implicit SOAP Headers using JAX-WS).
> >
> > package client;
> >
> > import java.util.*;
> > import javax.xml.ws.Holder;
> > import com.strikeiron.*;
> > import com.strikeiron.ws.*;
> > import org.apache.cxf.transports.http.configuration.*;
> > import org.apache.cxf.transport.http.*;
> > import org.apache.cxf.frontend.ClientProxy;
> > import org.apache.cxf.endpoint.Client;
> >
> > public class WSClient {
> >
> >    private static void setProxyInfo(Object port)
> >    {
> > 		Client client = ClientProxy.getClient( port );
> >                HTTPConduit httpConduit = (HTTPConduit)  
> > client.getConduit();
> >                HTTPClientPolicy policy = new HTTPClientPolicy();
> >                policy.setProxyServer( "proxy.domain.com" );
> >                policy.setProxyServerPort( 8080 );
> >                httpConduit.setClient( policy );
> >    }
> >
> >    private static LicenseInfo getLicenseInfo()
> >    {
> > 	LicenseInfo licenseInfo = new LicenseInfo();
> > 	RegisteredUser registeredUser = new RegisteredUser();
> > 	registeredUser.setUserID("iam@email.com");
> > 	registeredUser.setPassword("mypwd");
> > 	licenseInfo.setRegisteredUser( registeredUser );
> > 	return licenseInfo;
> >    }
> >
> >    private static javax.xml.ws.Holder getSubscriptionInfo()
> >    {
> > 	SubscriptionInfo sInfo = new SubscriptionInfo();
> > 	javax.xml.ws.Holder holder = new javax.xml.ws.Holder( sInfo );
> >
> > 	return holder;	
> >    }
> >
> >    public static void main (String[] args) {
> >        try {
> >            if (args.length != 1) {
> >                System.out.println("Usage: WSClient ");
> >                System.exit(0);
> >            }
> >
> >            SDPNFLTeams sdpService = new SDPNFLTeams();
> >            SDPNFLTeamsSoap endpt = sdpService.getSDPNFLTeamsSoap();
> > 	    setProxyInfo( endpt );	
> >
> >            com.strikeiron.NFLTeamOutput x =  
> > endpt 
> > .getTeamInfoByCity 
> > ( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );
> > 	    List teamInfo = x.getServiceResult().getTeams().getNFLTeamInfo();
> > 	    for(NFLTeamInfo tix: teamInfo) {
> > 		System.out.println( tix.getNickname()+" "+tix.getDivision() );
> > 	    }
> > 	
> >
> >        } catch (Exception e) {
> > 	    e.printStackTrace();
> >            System.out.println("Exception: " +  e.getMessage());
> >        }
> >    }
> > }
> >
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Everthing seems fine till the execution point when I get an  
> > exception I cannot understand:
> >
> >     [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
> >     [java]     at  
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> > 175)
> >     [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
> >     [java]     at client.WSClient.main(WSClient.java:60)
> >     [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3,  
> > Size: 3
> >     [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
> >     [java]     at java.util.ArrayList.get(ArrayList.java:321)
> >     [java]     at  
> > org 
> > .apache.cxf.message.MessageContentsList.get(MessageContentsList.java: 
> > 79)
> >     [java]     at  
> > org 
> > .apache 
> > .cxf 
> > .jaxws 
> > .interceptors 
> > .HolderInInterceptor.handleMessage(HolderInInterceptor.java:64)
> >     [java]     at  
> > org 
> > .apache 
> > .cxf 
> > .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> > 208)
> >     [java]     at  
> > org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
> >     [java]     at org.apache.cxf.transport.http.HTTPConduit 
> > $WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
> >     [java]     at org.apache.cxf.transport.http.HTTPConduit 
> > $WrappedOutputStream.close(HTTPConduit.java:1791)
> >     [java]     at  
> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java: 
> > 66)
> >     [java]     at  
> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
> >     [java]     at org.apache.cxf.interceptor.MessageSenderInterceptor 
> > $ 
> > MessageSenderEndingInterceptor 
> > .handleMessage(MessageSenderInterceptor.java:62)
> >     [java]     at  
> > org 
> > .apache 
> > .cxf 
> > .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> > 208)
> >     [java]     at  
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
> >     [java]     at  
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
> >     [java]     at  
> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> >     [java]     at  
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> > 135)
> >     [java]     ... 2 more
> >     [java] Exception: Index: 3, Size: 3
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> >
> > Thanks,
> >
> > _________________________________________________________________
> > Windows Live SkyDrive lets you share files with faraway friends.
> > http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_052008
> 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 
> 

_________________________________________________________________
Make Windows Vista more reliable and secure with Windows Vista Service Pack 1.
http://www.windowsvista.com/SP1?WT.mc_id=hotmailvistasp1banner

Re: cxf client to invoke strikeIron ws

Posted by Daniel Kulp <dk...@apache.org>.
Any chance you can try this with 2.0.6 or 2.1?   I fixed a couple  
header issues with -exsh true  just before 2.1 and 2.0.6 were released.

Dan



On May 5, 2008, at 4:12 PM, olanga henry wrote:

>
> Here is my client code to invoke the StrikeIron NFLTeam web  
> service.  I generated the client artifacts using the wsdl2java  
> utility with -exsh flag set to true after referring to http://www.jroller.com/gmazza/date/20071001 
>  (Sending implicit SOAP Headers using JAX-WS).
>
> package client;
>
> import java.util.*;
> import javax.xml.ws.Holder;
> import com.strikeiron.*;
> import com.strikeiron.ws.*;
> import org.apache.cxf.transports.http.configuration.*;
> import org.apache.cxf.transport.http.*;
> import org.apache.cxf.frontend.ClientProxy;
> import org.apache.cxf.endpoint.Client;
>
> public class WSClient {
>
>    private static void setProxyInfo(Object port)
>    {
> 		Client client = ClientProxy.getClient( port );
>                HTTPConduit httpConduit = (HTTPConduit)  
> client.getConduit();
>                HTTPClientPolicy policy = new HTTPClientPolicy();
>                policy.setProxyServer( "proxy.domain.com" );
>                policy.setProxyServerPort( 8080 );
>                httpConduit.setClient( policy );
>    }
>
>    private static LicenseInfo getLicenseInfo()
>    {
> 	LicenseInfo licenseInfo = new LicenseInfo();
> 	RegisteredUser registeredUser = new RegisteredUser();
> 	registeredUser.setUserID("iam@email.com");
> 	registeredUser.setPassword("mypwd");
> 	licenseInfo.setRegisteredUser( registeredUser );
> 	return licenseInfo;
>    }
>
>    private static javax.xml.ws.Holder getSubscriptionInfo()
>    {
> 	SubscriptionInfo sInfo = new SubscriptionInfo();
> 	javax.xml.ws.Holder holder = new javax.xml.ws.Holder( sInfo );
>
> 	return holder;	
>    }
>
>    public static void main (String[] args) {
>        try {
>            if (args.length != 1) {
>                System.out.println("Usage: WSClient ");
>                System.exit(0);
>            }
>
>            SDPNFLTeams sdpService = new SDPNFLTeams();
>            SDPNFLTeamsSoap endpt = sdpService.getSDPNFLTeamsSoap();
> 	    setProxyInfo( endpt );	
>
>            com.strikeiron.NFLTeamOutput x =  
> endpt 
> .getTeamInfoByCity 
> ( "INDIANAPOLLIS",getLicenseInfo(),getSubscriptionInfo() );
> 	    List teamInfo = x.getServiceResult().getTeams().getNFLTeamInfo();
> 	    for(NFLTeamInfo tix: teamInfo) {
> 		System.out.println( tix.getNickname()+" "+tix.getDivision() );
> 	    }
> 	
>
>        } catch (Exception e) {
> 	    e.printStackTrace();
>            System.out.println("Exception: " +  e.getMessage());
>        }
>    }
> }
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Everthing seems fine till the execution point when I get an  
> exception I cannot understand:
>
>     [java] javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
>     [java]     at  
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> 175)
>     [java]     at $Proxy28.getTeamInfoByCity(Unknown Source)
>     [java]     at client.WSClient.main(WSClient.java:60)
>     [java] Caused by: java.lang.IndexOutOfBoundsException: Index: 3,  
> Size: 3
>     [java]     at java.util.ArrayList.RangeCheck(ArrayList.java:546)
>     [java]     at java.util.ArrayList.get(ArrayList.java:321)
>     [java]     at  
> org 
> .apache.cxf.message.MessageContentsList.get(MessageContentsList.java: 
> 79)
>     [java]     at  
> org 
> .apache 
> .cxf 
> .jaxws 
> .interceptors 
> .HolderInInterceptor.handleMessage(HolderInInterceptor.java:64)
>     [java]     at  
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 208)
>     [java]     at  
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)
>     [java]     at org.apache.cxf.transport.http.HTTPConduit 
> $WrappedOutputStream.handleResponse(HTTPConduit.java:1955)
>     [java]     at org.apache.cxf.transport.http.HTTPConduit 
> $WrappedOutputStream.close(HTTPConduit.java:1791)
>     [java]     at  
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java: 
> 66)
>     [java]     at  
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
>     [java]     at org.apache.cxf.interceptor.MessageSenderInterceptor 
> $ 
> MessageSenderEndingInterceptor 
> .handleMessage(MessageSenderInterceptor.java:62)
>     [java]     at  
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 208)
>     [java]     at  
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
>     [java]     at  
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
>     [java]     at  
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
>     [java]     at  
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java: 
> 135)
>     [java]     ... 2 more
>     [java] Exception: Index: 3, Size: 3
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>
> Thanks,
>
> _________________________________________________________________
> Windows Live SkyDrive lets you share files with faraway friends.
> http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_052008

Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog