You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Andreas Fey <fe...@the-agent-factory.de> on 2007/07/06 14:30:58 UTC
String[] as return type
Hello,
i've set up a webservice with serveral methods; some of them (A) return
just simple types like int and long, and some of them (B) return a array
of string.
While i get results with (A), with (B) just an error is shown:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement return
org.apache.axis2.AxisFault.makeFault(AxisFault.java:404)
de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.fromOM(AppGeneratorServiceStub.java:18945)
de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.getDeviceVendors(AppGeneratorServiceStub.java:340)
org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...blablabla...
The webservice method i call is the following:
public String[] getDeviceVendors();
The stubs were created with wsdl2java.
Anybody an idea?
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: String[] as return type
Posted by Joe Nathan <jo...@yahoo.com>.
This may be the answer for your question:
http://www.nabble.com/-Axis2--returning-Array-versus-List-%2C-and-more-tf4035642.html
http://www.nabble.com/-Axis2--returning-Array-versus-List-%2C-and-more-tf4035642.html
--
View this message in context: http://www.nabble.com/String---as-return-type-tf4035249.html#a11483266
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: String[] as return type
Posted by Andreas Fey <fe...@the-agent-factory.de>.
Hi,
thats exactly what i did, the error reported appeared after this change.
Am Montag, den 09.07.2007, 12:39 -0700 schrieb Mike Patton:
> Andreas,
>
> I think the best way is to create a class that has an array of
> deviceVendors and return that in type in your web service. Do not
> directly return an array. Wrap it in a class and return an that new
> type.
> Mike
>
>
> Andreas Fey <fe...@the-agent-factory.de> wrote:
> Hi,
>
> i've done that now; i can get the array out of the
> DeviceVendors class
> and i can determine how much entries are in it; but when i
> want to
> access a single element in this array (e.g. using vendor[0]
> with an
> array of size 2), each element returns "null", despite the
> service sets
> a valid value.
>
> Any Ideas?
> Thanks,
>
> Andreas
>
>
> Am Sonntag, den 08.07.2007, 09:19 -0400 schrieb Anne Thomas
> Manes:
> > I recommend that you create a bean called DeviceVendors
> which contains
> > an array of strings. Return that.
> >
> > Anne
> >
> > On 7/6/07, Andreas Fey wrote:
> > > Hello,
> > >
> > > i've set up a webservice with serveral methods; some of
> them (A) return
> > > just simple types like int and long, and some of them (B)
> return a array
> > > of string.
> > >
> > > While i get results with (A), with (B) just an error is
> shown:
> > >
> > > Stacktrace:
> > >
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
> > >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
> > >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > >
> > > root cause
> > >
> > > org.apache.axis2.AxisFault:
> org.apache.axis2.databinding.ADBException: Unexpected
> subelement return
> > > org.apache.axis2.AxisFault.makeFault(AxisFault.java:404)
> > >
> de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.fromOM(AppGeneratorServiceStub.java:18945)
> > >
> de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.getDeviceVendors(AppGeneratorServiceStub.java:340)
> > > org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
> > >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > >
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
> > >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > >
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> > >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > >
> > > ...blablabla...
> > >
> > > The webservice method i call is the following:
> > > public String[] getDeviceVendors();
> > >
> > > The stubs were created with wsdl2java.
> > >
> > > Anybody an idea?
> > >
> > > Andreas
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail:
> axis-user-help@ws.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> axis-user-help@ws.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
>
> ______________________________________________________________________
> Got a little couch potato?
> Check out fun summer activities for kids.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: wss4j and axis2?
Posted by Mi...@servicecanada.gc.ca.
Thanks Paul,
Yes, the wss4j code does contain
org.apache.ws.axis*
packages, but three classes in wss4j depend on
org.apache.axis.*
classes.
I just realized that only 3 classes in wss4j depend on the old axis, and the code I was running through Rampart didn't use those classes, which is why I didn't get the error.
cheers,
md
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Monday, July 09, 2007 7:05 PM
> To: axis-user@ws.apache.org
> Subject: Re: wss4j and axis2?
>
>
> Michael
>
> WSS4J really contains the security handling code, based on a DOM view
> of the SOAP messages. Rampart contains the bridging logic from the
> Axis2 module/handler model to that code. And something called DOOM
> (DOM over Axiom) provides the DOM interface to the Axis2 messages.
>
> Paul
>
> PS the code in wss4j is org.apache.ws.axis.* which is actually
> something different to org.apache.axis.* AFAIK
>
> On 7/9/07, Michael.Davis@servicecanada.gc.ca
> <Mi...@servicecanada.gc.ca> wrote:
> > Hi,
> >
> > I've been digging around the source code of wss4j (the
> WS-Security library used by Rampart), and there's something
> very fundamental I don't understand.
> >
> > As far as I know, I've got the most recent versions of
> these (axis2 1.2, wss4j 1.5.2). The strange thing is, wss4j
> seems to use the older axis 1 libraries, with package names
> like org.apache.axis.*, whereas axis2 has package names like
> org.apache.axis2.*.
> >
> > I would expect to get a lot of ClassNotFound exceptions,
> but it seems to work fine. Is there some strange trickery
> going on, or am I just confused?
> >
> > Thanks
> > Michael Davis
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: wss4j and axis2?
Posted by Paul Fremantle <pz...@gmail.com>.
Michael
WSS4J really contains the security handling code, based on a DOM view
of the SOAP messages. Rampart contains the bridging logic from the
Axis2 module/handler model to that code. And something called DOOM
(DOM over Axiom) provides the DOM interface to the Axis2 messages.
Paul
PS the code in wss4j is org.apache.ws.axis.* which is actually
something different to org.apache.axis.* AFAIK
On 7/9/07, Michael.Davis@servicecanada.gc.ca
<Mi...@servicecanada.gc.ca> wrote:
> Hi,
>
> I've been digging around the source code of wss4j (the WS-Security library used by Rampart), and there's something very fundamental I don't understand.
>
> As far as I know, I've got the most recent versions of these (axis2 1.2, wss4j 1.5.2). The strange thing is, wss4j seems to use the older axis 1 libraries, with package names like org.apache.axis.*, whereas axis2 has package names like org.apache.axis2.*.
>
> I would expect to get a lot of ClassNotFound exceptions, but it seems to work fine. Is there some strange trickery going on, or am I just confused?
>
> Thanks
> Michael Davis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
blog: http://pzf.fremantle.org
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
wss4j and axis2?
Posted by Mi...@servicecanada.gc.ca.
Hi,
I've been digging around the source code of wss4j (the WS-Security library used by Rampart), and there's something very fundamental I don't understand.
As far as I know, I've got the most recent versions of these (axis2 1.2, wss4j 1.5.2). The strange thing is, wss4j seems to use the older axis 1 libraries, with package names like org.apache.axis.*, whereas axis2 has package names like org.apache.axis2.*.
I would expect to get a lot of ClassNotFound exceptions, but it seems to work fine. Is there some strange trickery going on, or am I just confused?
Thanks
Michael Davis
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: String[] as return type
Posted by Mike Patton <m_...@yahoo.com>.
Andreas,
I think the best way is to create a class that has an array of deviceVendors and return that in type in your web service. Do not directly return an array. Wrap it in a class and return an that new type.
Mike
Andreas Fey <fe...@the-agent-factory.de> wrote:
Hi,
i've done that now; i can get the array out of the DeviceVendors class
and i can determine how much entries are in it; but when i want to
access a single element in this array (e.g. using vendor[0] with an
array of size 2), each element returns "null", despite the service sets
a valid value.
Any Ideas?
Thanks,
Andreas
Am Sonntag, den 08.07.2007, 09:19 -0400 schrieb Anne Thomas Manes:
> I recommend that you create a bean called DeviceVendors which contains
> an array of strings. Return that.
>
> Anne
>
> On 7/6/07, Andreas Fey wrote:
> > Hello,
> >
> > i've set up a webservice with serveral methods; some of them (A) return
> > just simple types like int and long, and some of them (B) return a array
> > of string.
> >
> > While i get results with (A), with (B) just an error is shown:
> >
> > Stacktrace:
> > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > root cause
> >
> > org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement return
> > org.apache.axis2.AxisFault.makeFault(AxisFault.java:404)
> > de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.fromOM(AppGeneratorServiceStub.java:18945)
> > de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.getDeviceVendors(AppGeneratorServiceStub.java:340)
> > org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > ...blablabla...
> >
> > The webservice method i call is the following:
> > public String[] getDeviceVendors();
> >
> > The stubs were created with wsdl2java.
> >
> > Anybody an idea?
> >
> > Andreas
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------
Got a little couch potato?
Check out fun summer activities for kids.
Re: String[] as return type
Posted by Andreas Fey <fe...@the-agent-factory.de>.
Hi,
i've done that now; i can get the array out of the DeviceVendors class
and i can determine how much entries are in it; but when i want to
access a single element in this array (e.g. using vendor[0] with an
array of size 2), each element returns "null", despite the service sets
a valid value.
Any Ideas?
Thanks,
Andreas
Am Sonntag, den 08.07.2007, 09:19 -0400 schrieb Anne Thomas Manes:
> I recommend that you create a bean called DeviceVendors which contains
> an array of strings. Return that.
>
> Anne
>
> On 7/6/07, Andreas Fey <fe...@the-agent-factory.de> wrote:
> > Hello,
> >
> > i've set up a webservice with serveral methods; some of them (A) return
> > just simple types like int and long, and some of them (B) return a array
> > of string.
> >
> > While i get results with (A), with (B) just an error is shown:
> >
> > Stacktrace:
> > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > root cause
> >
> > org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement return
> > org.apache.axis2.AxisFault.makeFault(AxisFault.java:404)
> > de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.fromOM(AppGeneratorServiceStub.java:18945)
> > de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.getDeviceVendors(AppGeneratorServiceStub.java:340)
> > org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > ...blablabla...
> >
> > The webservice method i call is the following:
> > public String[] getDeviceVendors();
> >
> > The stubs were created with wsdl2java.
> >
> > Anybody an idea?
> >
> > Andreas
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: String[] as return type
Posted by Anne Thomas Manes <at...@gmail.com>.
I recommend that you create a bean called DeviceVendors which contains
an array of strings. Return that.
Anne
On 7/6/07, Andreas Fey <fe...@the-agent-factory.de> wrote:
> Hello,
>
> i've set up a webservice with serveral methods; some of them (A) return
> just simple types like int and long, and some of them (B) return a array
> of string.
>
> While i get results with (A), with (B) just an error is shown:
>
> Stacktrace:
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:423)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> root cause
>
> org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement return
> org.apache.axis2.AxisFault.makeFault(AxisFault.java:404)
> de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.fromOM(AppGeneratorServiceStub.java:18945)
> de.tafmobile.server.remoteservices.appgenerator.AppGeneratorServiceStub.getDeviceVendors(AppGeneratorServiceStub.java:340)
> org.apache.jsp.index_jsp._jspService(index_jsp.java:105)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> ...blablabla...
>
> The webservice method i call is the following:
> public String[] getDeviceVendors();
>
> The stubs were created with wsdl2java.
>
> Anybody an idea?
>
> Andreas
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org