Skip to main content

Do I need to extend any of classes from AXIS to return multiple values?

1 reply [Last post]
v4u2chat
Offline
Joined: 2007-03-06
Points: 0

Do I need to extend any of classes from AXIS to return multiple values? I'm exposing the following method as web service through AXIS to return multiple values.

 public ContactAddress testService()<br />
	{</p>
<p>		ContactAddress	cAddr	=	new	ContactAddress();<br />
		cAddr.setAddresses1("AAAAAAAAAAAAA");<br />
		cAddr.setAddresses2("BBBBBBBBBBBBB");<br />
		cAddr.setAddresses3("CCCCCCCCCCCCC");</p>
<p>		return cAddr;<br />
	}

and the code for ContactAddress is

</p>
<p>public class ContactAddress {<br />
	// member variables<br />
	private String addresses1;</p>
<p>	private String addresses2;</p>
<p>	private String addresses3;</p>
<p>	public String getAddresses1() {<br />
		return addresses1;<br />
	}</p>
<p>	public void setAddresses1(String addresses1) {<br />
		this.addresses1 = addresses1;<br />
	}</p>
<p>	public String getAddresses2() {<br />
		return addresses2;<br />
	}</p>
<p>	public void setAddresses2(String addresses2) {<br />
		this.addresses2 = addresses2;<br />
	}</p>
<p>	public String getAddresses3() {<br />
		return addresses3;<br />
	}</p>
<p>	public void setAddresses3(String addresses3) {<br />
		this.addresses3 = addresses3;<br />
	}</p>
<p>}

when I'm exposing the method in following way...I'm gettting this error.

org.xml.sax.SAXParseException: Premature end of file.

The wsdl for this is .......

<br />
  <?xml version="1.0" encoding="UTF-8" ?><br />
-<br />
-<br />
-<br />
- </p>
<p>-<br />
- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>-<br />
- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>- </p>
<p>-<br />
- </p>
<p>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
oleksiys
Offline
Joined: 2006-01-25
Points: 0

Hello,
think you're not returning multiple values, but just one ContactAddress.

This is Sun's forum. We mostly support our own web services stack implementation JAX-WS [1]. And if AXIS is strong requirement for you - I'll advice to ask on apache forum.

Regards.

[1] jax-ws.dev.java.net