axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mesaullion" <>
Subject serializing wrong number of elements: ArrayIndexOutOfBoundsException (java:rpc , wsdl, flash)
Date Sun, 25 Apr 2004 15:46:15 GMT
I want to calculate Parts of a Fractal on a Client (don't think about the
usability; it's just an example!).
When deploying my Class, which I want to serialize, Axis creates the correct
Datatype in the WSDL by usingthe get- and set-Methods.

Everything works fine, but the Problem is, that I don't want to send all the
Information in both directions (to and from server). So I don't want to send
an empty results-Tag via SOAP and either I don't want to receive the
coordinates I gave the client to calculate the Fractal from.

What Axis does, is that it only generates 1 Datatype in the WSDL using the
beanMapping. Although there are three elements in my Datatype, Axis only
sends two of them (sessionId and coords). This is what I want.
But I only want to sent two elements back to the server (sessionId and
results), but my client (mm flash, not java/axis) (which auto-generates the
stub from the WSDL) always sends three elements, because the wsdl (and
therefore axis) says so, resulting in an wrong number of parameters sent
back :

<faultstring>java.lang.ArrayIndexOutOfBoundsException: -125</faultstring>

What could I I missing something? 
Any help appreciated

Thanks a lot.



	<service name="FraktalService" provider="java:RPC">
		<parameter name="className" value="FraktalService" />
		<parameter name="allowedMethods" value="*" />
		<parameter name="scope" value="application" />

 		<beanMapping qname="myNS:Fraktal"
xmlns:myNS="urn:FraktalService" languageSpecificType="java:Fraktal" />

	// Methods (which I want to serialize)

	// send and receive the session
	public String getSessionId()
	public void setSessionId(String s)
	// only send the coordinates and receive the results
	public void getCoords(int[] c)
	public void setResults(int[] r)
	// Methods (which I don't want to serialize: so I renamed them)
	public void coordsSet(int[] c) {
	public int[] resultsGet()


// Datatype:
<complexType name="Fraktal">
      <element name="coords" nillable="true" type="impl:ArrayOf_xsd_int" /> 
      <element name="results" nillable="true" type="impl:ArrayOf_xsd_int" />
      <element name="sessionId" nillable="true" type="xsd:string" /> 

//public Fraktal getServiceFraktal():
<wsdl:message name="getServiceFraktalRequest" />
<wsdl:message name="getServiceFraktalResponse">
	<wsdl:part name="getServiceFraktalReturn" type="tns1:Fraktal" />

//public String setServiceFraktal(Fraktal f):
<wsdl:message name="setServiceFraktalRequest">
   <wsdl:part name="in0" type="tns1:Fraktal" />
<wsdl:message name="setServiceFraktalResponse">
	<wsdl:part name="setServiceFraktalReturn" type="xsd:string" />

View raw message