468,134 Members | 1,214 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,134 developers. It's quick & easy.

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

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()
{

ContactAddress cAddr = new ContactAddress();
cAddr.setAddresses1("AAAAAAAAAAAAA");
cAddr.setAddresses2("BBBBBBBBBBBBB");
cAddr.setAddresses3("CCCCCCCCCCCCC");

return cAddr;
}

and the code for ContactAddress is


public class ContactAddress {
// member variables
private String addresses1;

private String addresses2;

private String addresses3;

public String getAddresses1() {
return addresses1;
}

public void setAddresses1(String addresses1) {
this.addresses1 = addresses1;
}

public String getAddresses2() {
return addresses2;
}

public void setAddresses2(String addresses2) {
this.addresses2 = addresses2;
}

public String getAddresses3() {
return addresses3;
}

public void setAddresses3(String addresses3) {
this.addresses3 = addresses3;
}

}

when I'm exposing the method as webservice...I'm gettting this error.

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


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


<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://v:9090/services/Test" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://v:9090/services/Test" xmlns:intf="http://v:9090/services/Test" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)

-->
- <wsdl:types>
- <schema targetNamespace="http://v:9090/services/Test" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="ContactAddress">
- <sequence>
<element name="addresses1" nillable="true" type="soapenc:string" />
<element name="addresses2" nillable="true" type="soapenc:string" />
<element name="addresses3" nillable="true" type="soapenc:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="addRequest">
<wsdl:part name="x" type="soapenc:string" />
</wsdl:message>
Mar 8 '07 #1
1 2482
r035198x
13,262 8TB
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()
{

ContactAddress cAddr = new ContactAddress();
cAddr.setAddresses1("AAAAAAAAAAAAA");
cAddr.setAddresses2("BBBBBBBBBBBBB");
cAddr.setAddresses3("CCCCCCCCCCCCC");

return cAddr;
}

and the code for ContactAddress is


public class ContactAddress {
// member variables
private String addresses1;

private String addresses2;

private String addresses3;

public String getAddresses1() {
return addresses1;
}

public void setAddresses1(String addresses1) {
this.addresses1 = addresses1;
}

public String getAddresses2() {
return addresses2;
}

public void setAddresses2(String addresses2) {
this.addresses2 = addresses2;
}

public String getAddresses3() {
return addresses3;
}

public void setAddresses3(String addresses3) {
this.addresses3 = addresses3;
}

}

when I'm exposing the method as webservice...I'm gettting this error.

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


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


<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://v:9090/services/Test" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://v:9090/services/Test" xmlns:intf="http://v:9090/services/Test" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)

-->
- <wsdl:types>
- <schema targetNamespace="http://v:9090/services/Test" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="ContactAddress">
- <sequence>
<element name="addresses1" nillable="true" type="soapenc:string" />
<element name="addresses2" nillable="true" type="soapenc:string" />
<element name="addresses3" nillable="true" type="soapenc:string" />
</sequence>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="addRequest">
<wsdl:part name="x" type="soapenc:string" />
</wsdl:message>
1.)Check that the XML document is no well formed. Check for any special characters. You my need to use a hex editor for this.
2.)Pass a fresh input stream which is opened and has not read anything before parsing.
Mar 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

19 posts views Thread by subramanian100in | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.