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 Ma...@Emerson.com on 2008/09/08 22:22:17 UTC

Array question

Hi there.

 

I was wondering if someone could provide me with an example of (or point
me in the direction of) a java client which calls a web service that
returns an array of a bean.

I'm using Axis 1.4 dated April 22, 2006 and have already researched this
question only to find the majority of the responses were related to
earlier releases.

 

The relevant portion of my client code is:           

 

call.setOperationName( "getSites" );

call.setReturnType( XMLType.SOAP_ARRAY );

call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
javax.xml.rpc.ParameterMode.IN);

call.addParameter("username", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);

Object[] obj = (Object[]) call.invoke( new Object[] { tokenId, "test" }
);

 

I'm receiving the following exception:

org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO

 

I'm sure I'm missing something in the client but I don't know/understand
what it is.

I wrote the original interface and implementation and then used
Java2Wsdl and Wsdl2Java to generate the wsdl, server side code and wsdd.

 

Thanks,

Marc


Re: MTOM Attachment - OMElement using AXIOM

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,

1.Can I send in attachment(s) to webservice without change in the method
> signature and can I still access the attachments using the
> MessgeContext.getCurrentMessageContext().getAttachmentMap() ?? If so how do
> I do that?

You can send SwA type attachments without changing the methode signature or
your WSDL.


> myServiceMethod(String param0,String param1, String param2, OMElement
> attachment)
>
> I want to use myServiceMethod(String param0,String param1,String param2)
> and still be able to send the attachments using MTOM - how is it possible?

Unlike SwA, MTOM attachments needs to be reflected in the WSDL.. If you are
using POJO deployment then your service method must capture it...

You can change your method as follows..
myServiceMethod(String param0,String param1,String param2, Datahandler
yourAttachment)


> 2.Also another thing - I send in only one attachment to the webr service
> and I have three String parameters in the web service that I send in from my
> client, The last of the String parameters is an xml message and it shows up
> like an attachment in the AttachmentMap obtained from messageContext. the
> content type is obviously text/xml. But the only attachment I am sending is
> image. The Attachment Map has these two attachments where as I am expecting
> only one. Right now I am making it work by skipping the first in the
> AttachmentMap everytime. But how do I make sure I see only image in the
> attachmentMap?


The first attachment you see must be the SOAP envelope...  You can't avoid
it... SopaEnvelope gets transmit as an attachment when you use MTOM or
SwA...

BTW is there any particular reason for using OMElements in the client side..
It would be much easier if you used some another API like code generation or
RPCclient...

thanks,
Thilina

>
>
>
>
> This is how my client is sending the request to webservice
>
> ServiceClient sc= new ServiceClient()
>
> Options options = new Options();
>
> options.set..... // I set ENABLE_MTOM in one of these.
>
> sc.setOptions(options);
>
> sc.sendRecieve(payload)
>
>
>
> Where payload is created using Axiom.
>
> method.addChild(param0);
>
> method.addChild(param1);
>
> method.addChild(param2);
>
> method.addChild(attachment);
>
>
>
> Where attachment is a OMElement created by adding OMText obtained from the
> datahandlers of the attachments.
>
> Why does param2 show up as attachment in AttachmentMap of MessageContext.
>
>
>
> Any help is appreciated.
>
> Thanks a ton for looking into this in advance,
>
> Asmita
>
>
>
>
>
>  Hi Thilina,
>
>
>
> Thanks for such a detailed response.
>
> Yes I got the sample in
> http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html<
> http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html>
>  working and was able to retrieve the content on the server side. I used
> MTOM to get the contents of attachment from client to server. There was only
> one file in this case and also I was using wsdl generated client. Rather now
> I would like to use my own client by using ServiceClient /OperationClient to
> get the contents of the multiple attachments to the server side. The thing
> is I am using a service that is prewritten and I am not using the wsdl to
> generate either the client or the service.
>
> My service goes something like this, and I am using MTOM
>
> String MyServiceMethod(String s1, String s2, String s3), where String s1,s2
> and s3 - neither has got anything to do with the attachments. I have to use
> datahandlers on the client side to send the attachment to the service.
> Something like messageContext.addAttachment(datahandler[i]) where 'i'
> represents the ith attachment.
>
> Now on the service side when I do
>
> MessageContext msgContext = MessageContext.getCurrentMessageContext()
>
> msgContext.getAttachmentMap and retrieve contextIDs on the AttachmentMap, I
> don't see the content of attachment I passed in when I write the dataHandler
> into a file. Even the contextType doesn't match. Rather it has the s3 that I
> sent in the parameter of the MyServiceMethod.
>
> I will need to use tcpmon to see what exactly is happening to my messages.
>
> Thanks for your help,
>
> Asmita
>
>
>
>
>
> ________________________________
>
> From: Thilina Gunarathne [mailto:csethil@gmail.com]
> Sent: Wednesday, September 24, 2008 12:57 AM
> To: axis-user@ws.apache.org
> Subject: Re: Attachment SwA or MTOM
>
>
>
> Hi,
>
>        I was successfully able to write an independent web service with a
> client to test where the attachments' file name is passed as parameter in
> the web service method.
>
>        Based on the lines of
> http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html<
> http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html
> >
>
> Hope what u meant is that you were able to retrieve the content of the file
> in the server side.  Did u had a look at the MTOM sample that comes with
> Axis2? Axis2 MTOM sample uploads a file to a webservice
> using a WSDL generated client and a service.
>
>        My requirement in real world is that my web service may or may not
> have the attachments [0 or many attachments].
>
>        And my web service method should be able to support all the
> scenarios
>
>        There are obvious two ways of doing it:
>
>
>
>        *       Add the array of attachment filenames in the webservice
> method signature and send it using MTOM (based on the arcticle above )
>        *       Or send the attachments internal to soap message using data
> handlers using SwA (Can we do the same thing and say enableMTOM=true?) based
> on this article
>
> Attachments go externally when SwA is used. No..you can't mix SwA and
> MTOM..
>
> Looks like you are somehow confused with the filenames vs file content... I
> would suggest you to use MTOM, unless there is a requirement to support
> legacy web service clients (eg: axis 1.x)..
>
> First look at the MTOM sample and get it to working. Focus on getting the
> attachment content right.. When you can get the attachments to the service,
> getting file names is a piece of cake. Then you can modify the WSDL given
> with the sample to make it support an array of optional elements containing
> attachments..
>
> Adding max/minoccurs to the following element and wraping it using another
> parent element will do the trick.
> <xsd:element name="AttachmentRequest" type="tns:AttachmentType"
>  minOccurs="0" maxOccurs="unbounded" />
>
>
> Then you can code generate to your modified WSDL to write your new service
> and client. You can use MTOM sample client & service as references. You may
> also look at http://ws.apache.org/axis2/1_4_1/mtom-guide.html to get an
> idea about Axis2 attachments..
>
> Please use a http sniffer like tcpmon (ws.apache.org/commons/tcpmon) to
> trace your messages and to verify whether the attachments are there in the
> message.
>
> thanks,
> Thilina
>
>
>        *
>
>        http://wso2.org/library/1148 <http://wso2.org/library/1148>
>
>
>
>        When using method 1, how do we handle the array of Strings to send
> to the client, I want to use handwritten client so I am using
>
>        OMElement fileNamesArray = BeanUtil.getOMElement(new
> QName(omNs.getNamespaceURI(),"attchFileNames"), filenames, null, false,
> null);
>
>
>
>        But this does not get me the datasource for the file in the
> webservice.
>
>
>
>        When using method 2 and I access the datahandler from messageContext
> obtained using getCurrentMessageContext, my data handlers are empty.
>
>
>
>        So I am not able to achieve the solution to transfer the file from
> client to webservice by either of the ways.
>
>
>
>        Help is really appreciated as I am completely stuck!
>
>
>
>        Thanks in advance,
>
>        Asmita
>
>
>
>
> --
> Thilina Gunarathne - http://thilinag.blogspot.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

MTOM Attachment - OMElement using AXIOM

Posted by "Attharkar, Asmita" <aa...@telcordia.com>.
Hi All,



Ok I was successful in sending Attachment using MTOM from client to server. I needed to add OMElement in the my method signature. So the wsdl changes.

I have two things remaining to be resolved though:

1.Can I send in attachment(s) to webservice without change in the method signature and can I still access the attachments using the MessgeContext.getCurrentMessageContext().getAttachmentMap() ?? If so how do I do that?

myServiceMethod(String param0,String param1, String param2, OMElement attachment)

I want to use myServiceMethod(String param0,String param1,String param2) and still be able to send the attachments using MTOM - how is it possible?

2.Also another thing - I send in only one attachment to the webr service and I have three String parameters in the web service that I send in from my client, The last of the String parameters is an xml message and it shows up like an attachment in the AttachmentMap obtained from messageContext. the content type is obviously text/xml. But the only attachment I am sending is image. The Attachment Map has these two attachments where as I am expecting only one. Right now I am making it work by skipping the first in the AttachmentMap everytime. But how do I make sure I see only image in the attachmentMap?



This is how my client is sending the request to webservice

ServiceClient sc= new ServiceClient()

Options options = new Options();

options.set..... // I set ENABLE_MTOM in one of these.

sc.setOptions(options);

sc.sendRecieve(payload)



Where payload is created using Axiom.

method.addChild(param0);

method.addChild(param1);

method.addChild(param2);

method.addChild(attachment);



Where attachment is a OMElement created by adding OMText obtained from the datahandlers of the attachments.

Why does param2 show up as attachment in AttachmentMap of MessageContext.



Any help is appreciated.

Thanks a ton for looking into this in advance,

Asmita





 Hi Thilina,



Thanks for such a detailed response.

Yes I got the sample in http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html <http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html>  working and was able to retrieve the content on the server side. I used MTOM to get the contents of attachment from client to server. There was only one file in this case and also I was using wsdl generated client. Rather now I would like to use my own client by using ServiceClient /OperationClient to get the contents of the multiple attachments to the server side. The thing is I am using a service that is prewritten and I am not using the wsdl to generate either the client or the service.

My service goes something like this, and I am using MTOM

String MyServiceMethod(String s1, String s2, String s3), where String s1,s2 and s3 - neither has got anything to do with the attachments. I have to use datahandlers on the client side to send the attachment to the service. Something like messageContext.addAttachment(datahandler[i]) where 'i' represents the ith attachment.

Now on the service side when I do

MessageContext msgContext = MessageContext.getCurrentMessageContext()

msgContext.getAttachmentMap and retrieve contextIDs on the AttachmentMap, I don't see the content of attachment I passed in when I write the dataHandler into a file. Even the contextType doesn't match. Rather it has the s3 that I sent in the parameter of the MyServiceMethod.

I will need to use tcpmon to see what exactly is happening to my messages.

Thanks for your help,

Asmita





________________________________

From: Thilina Gunarathne [mailto:csethil@gmail.com]
Sent: Wednesday, September 24, 2008 12:57 AM
To: axis-user@ws.apache.org
Subject: Re: Attachment SwA or MTOM



Hi,

        I was successfully able to write an independent web service with a client to test where the attachments' file name is passed as parameter in the web service method.

        Based on the lines of  http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html <http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html>

Hope what u meant is that you were able to retrieve the content of the file in the server side.  Did u had a look at the MTOM sample that comes with Axis2? Axis2 MTOM sample uploads a file to a webservice
using a WSDL generated client and a service.

        My requirement in real world is that my web service may or may not have the attachments [0 or many attachments].

        And my web service method should be able to support all the scenarios

        There are obvious two ways of doing it:



        *       Add the array of attachment filenames in the webservice method signature and send it using MTOM (based on the arcticle above )
        *       Or send the attachments internal to soap message using data handlers using SwA (Can we do the same thing and say enableMTOM=true?) based on this article

Attachments go externally when SwA is used. No..you can't mix SwA and MTOM..

Looks like you are somehow confused with the filenames vs file content... I would suggest you to use MTOM, unless there is a requirement to support legacy web service clients (eg: axis 1.x)..

First look at the MTOM sample and get it to working. Focus on getting the attachment content right.. When you can get the attachments to the service, getting file names is a piece of cake. Then you can modify the WSDL given with the sample to make it support an array of optional elements containing attachments..

Adding max/minoccurs to the following element and wraping it using another parent element will do the trick.
<xsd:element name="AttachmentRequest" type="tns:AttachmentType"  minOccurs="0" maxOccurs="unbounded" />


Then you can code generate to your modified WSDL to write your new service and client. You can use MTOM sample client & service as references. You may also look at http://ws.apache.org/axis2/1_4_1/mtom-guide.html to get an idea about Axis2 attachments..

Please use a http sniffer like tcpmon (ws.apache.org/commons/tcpmon) to trace your messages and to verify whether the attachments are there in the message.

thanks,
Thilina


        *

        http://wso2.org/library/1148 <http://wso2.org/library/1148>



        When using method 1, how do we handle the array of Strings to send to the client, I want to use handwritten client so I am using

        OMElement fileNamesArray = BeanUtil.getOMElement(new QName(omNs.getNamespaceURI(),"attchFileNames"), filenames, null, false, null);



        But this does not get me the datasource for the file in the webservice.



        When using method 2 and I access the datahandler from messageContext obtained using getCurrentMessageContext, my data handlers are empty.



        So I am not able to achieve the solution to transfer the file from client to webservice by either of the ways.



        Help is really appreciated as I am completely stuck!



        Thanks in advance,

        Asmita




--
Thilina Gunarathne - http://thilinag.blogspot.com


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Attachment SwA or MTOM

Posted by "Attharkar, Asmita" <aa...@telcordia.com>.
Hi Thilina,

Thanks for such a detailed response.

Yes I got the sample in http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html working and was able to retrieve the content on the server side. I used MTOM to get the contents of attachment from client to server. There was only one file in this case and also I was using wsdl generated client. Rather now I would like to use my own client by using ServiceClient /OperationClient to get the contents of the multiple attachments to the server side. The thing is I am using a service that is prewritten and I am not using the wsdl to generate either the client or the service.

My service goes something like this, and I am using MTOM

String MyServiceMethod(String s1, String s2, String s3), where String s1,s2 and s3 - neither has got anything to do with the attachments. I have to use datahandlers on the client side to send the attachment to the service. Something like messageContext.addAttachment(datahandler[i]) where 'i' represents the ith attachment.

Now on the service side when I do

MessageContext msgContext = MessageContext.getCurrentMessageContext()

msgContext.getAttachmentMap and retrieve contextIDs on the AttachmentMap, I don't see the content of attachment I passed in when I write the dataHandler into a file. Even the contextType doesn't match. Rather it has the s3 that I sent in the parameter of the MyServiceMethod.

I will need to use tcpmon to see what exactly is happening to my messages.

Thanks for your help,

Asmita


________________________________
From: Thilina Gunarathne [mailto:csethil@gmail.com]
Sent: Wednesday, September 24, 2008 12:57 AM
To: axis-user@ws.apache.org
Subject: Re: Attachment SwA or MTOM

Hi,

I was successfully able to write an independent web service with a client to test where the attachments' file name is passed as parameter in the web service method.

Based on the lines of  http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html
Hope what u meant is that you were able to retrieve the content of the file in the server side.  Did u had a look at the MTOM sample that comes with Axis2? Axis2 MTOM sample uploads a file to a webservice
using a WSDL generated client and a service.

My requirement in real world is that my web service may or may not have the attachments [0 or many attachments].

And my web service method should be able to support all the scenarios

There are obvious two ways of doing it:



 *   Add the array of attachment filenames in the webservice method signature and send it using MTOM (based on the arcticle above )
 *   Or send the attachments internal to soap message using data handlers using SwA (Can we do the same thing and say enableMTOM=true?) based on this article
Attachments go externally when SwA is used. No..you can't mix SwA and MTOM..

Looks like you are somehow confused with the filenames vs file content... I would suggest you to use MTOM, unless there is a requirement to support legacy web service clients (eg: axis 1.x)..

First look at the MTOM sample and get it to working. Focus on getting the attachment content right.. When you can get the attachments to the service, getting file names is a piece of cake. Then you can modify the WSDL given with the sample to make it support an array of optional elements containing attachments..

Adding max/minoccurs to the following element and wraping it using another parent element will do the trick.
<xsd:element name="AttachmentRequest" type="tns:AttachmentType"  minOccurs="0" maxOccurs="unbounded" />


Then you can code generate to your modified WSDL to write your new service and client. You can use MTOM sample client & service as references. You may also look at http://ws.apache.org/axis2/1_4_1/mtom-guide.html to get an idea about Axis2 attachments..

Please use a http sniffer like tcpmon (ws.apache.org/commons/tcpmon<http://ws.apache.org/commons/tcpmon>) to trace your messages and to verify whether the attachments are there in the message.

thanks,
Thilina


 *

http://wso2.org/library/1148



When using method 1, how do we handle the array of Strings to send to the client, I want to use handwritten client so I am using

OMElement fileNamesArray = BeanUtil.getOMElement(new QName(omNs.getNamespaceURI(),"attchFileNames"), filenames, null, false, null);



But this does not get me the datasource for the file in the webservice.



When using method 2 and I access the datahandler from messageContext obtained using getCurrentMessageContext, my data handlers are empty.



So I am not able to achieve the solution to transfer the file from client to webservice by either of the ways.



Help is really appreciated as I am completely stuck!



Thanks in advance,

Asmita



--
Thilina Gunarathne - http://thilinag.blogspot.com

Re: Attachment SwA or MTOM

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,
>
> I was successfully able to write an independent web service with a client
> to test where the attachments' file name is passed as parameter in the web
> service method.
>
> Based on the lines of
> http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html
>
Hope what u meant is that you were able to retrieve the content of the file
in the server side.  Did u had a look at the MTOM sample that comes with
Axis2? Axis2 MTOM sample uploads a file to a webservice
using a WSDL generated client and a service.

> My requirement in real world is that my web service may or may not have the
> attachments [0 or many attachments].
>
> And my web service method should be able to support all the scenarios
>
> There are obvious two ways of doing it:
>
>
>
>    - Add the array of attachment filenames in the webservice method
>    signature and send it using MTOM (based on the arcticle above )
>    - Or send the attachments internal to soap message using data handlers
>    using SwA (Can we do the same thing and say enableMTOM=true?) based on this
>    article
>
> Attachments go externally when SwA is used. No..you can't mix SwA and
MTOM..

Looks like you are somehow confused with the filenames vs file content... I
would suggest you to use MTOM, unless there is a requirement to support
legacy web service clients (eg: axis 1.x)..

First look at the MTOM sample and get it to working. Focus on getting the
attachment content right.. When you can get the attachments to the service,
getting file names is a piece of cake. Then you can modify the WSDL given
with the sample to make it support an array of optional elements containing
attachments..

Adding max/minoccurs to the following element and wraping it using another
parent element will do the trick.
<xsd:element name="AttachmentRequest" type="tns:AttachmentType"
minOccurs="0" maxOccurs="unbounded" />


Then you can code generate to your modified WSDL to write your new service
and client. You can use MTOM sample client & service as references. You may
also look at http://ws.apache.org/axis2/1_4_1/mtom-guide.html to get an idea
about Axis2 attachments..

Please use a http sniffer like tcpmon (ws.apache.org/commons/tcpmon) to
trace your messages and to verify whether the attachments are there in the
message.

thanks,
Thilina


>
>    -
>
> http://wso2.org/library/1148
>
>
>
> *When using method 1*, how do we handle the array of Strings to send to
> the client, I want to use handwritten client so I am using
>
> OMElement fileNamesArray = BeanUtil.getOMElement(new
> QName(omNs.getNamespaceURI(),"attchFileNames"), filenames, null, false,
> null);
>
>
>
> But this does not get me the datasource for the file in the webservice.
>
>
>
> *When using method 2* and I access the datahandler from messageContext
> obtained using getCurrentMessageContext, my data handlers are empty.
>
>
>
> So I am not able to achieve the solution to transfer the file from client
> to webservice by either of the ways.
>
>
>
> Help is really appreciated as I am completely stuck!
>
>
>
> Thanks in advance,
>
> Asmita
>



-- 
Thilina Gunarathne - http://thilinag.blogspot.com

Attachment SwA or MTOM

Posted by "Attharkar, Asmita" <aa...@telcordia.com>.
Hi There,

I was successfully able to write an independent web service with a client to test where the attachments' file name is passed as parameter in the web service method.
Based on the lines of  http://thilinag.blogspot.com/2008/04/download-file-from-axis2-web-service.html

But

My requirement in real world is that my web service may or may not have the attachments [0 or many attachments].
And my web service method should be able to support all the scenarios
There are obvious two ways of doing it:


 *   Add the array of attachment filenames in the webservice method signature and send it using MTOM (based on the arcticle above )
 *   Or send the attachments internal to soap message using data handlers using SwA (Can we do the same thing and say enableMTOM=true?) based on this article
http://wso2.org/library/1148

When using method 1, how do we handle the array of Strings to send to the client, I want to use handwritten client so I am using
OMElement fileNamesArray = BeanUtil.getOMElement(new QName(omNs.getNamespaceURI(),"attchFileNames"), filenames, null, false, null);

But this does not get me the datasource for the file in the webservice.

When using method 2 and I access the datahandler from messageContext obtained using getCurrentMessageContext, my data handlers are empty.

So I am not able to achieve the solution to transfer the file from client to webservice by either of the ways.

Help is really appreciated as I am completely stuck!

Thanks in advance,
Asmita

RE: Array question

Posted by Ma...@Emerson.com.
I meant a posting AT forums.sun.com I got it.
Someone posted a simple example of what I was looking for and your
response helped me find it.

Thanks again,
Marc

-----Original Message-----
From: Marc.Horvath@Emerson.com [mailto:Marc.Horvath@Emerson.com] 
Sent: Friday, September 12, 2008 10:50 AM
To: axis-user@ws.apache.org
Subject: RE: Array question

Thanks.
Between this and posting at forums.sun.com I got it.

-----Original Message-----
From: Anne Thomas Manes [mailto:atmanes@gmail.com] 
Sent: Friday, September 12, 2008 8:00 AM
To: axis-user@ws.apache.org
Subject: Re: Array question

Marc,

You must register a type mapping for the SiteDTO type. (I suggest
using a BeanMapping.)

Anne

On Thu, Sep 11, 2008 at 5:26 PM,  <Ma...@emerson.com> wrote:
> Thanks for your help!
>
>
>
> Marc
>
>
>
> ________________________________
>
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Thursday, September 11, 2008 5:14 PM
> To: axis-user@ws.apache.org
> Subject: RE: Array question
>
>
>
> sounds like the service faulted
> pls supply the wsdl so we can try
>
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
Sender
> does not endorse distribution to any party other than intended
recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
> ________________________________
>
> Subject: RE: Array question
> Date: Thu, 11 Sep 2008 15:51:48 -0500
> From: Marc.Horvath@Emerson.com
> To: axis-user@ws.apache.org
>
> Hi Martin,
>
>
>
> Thanks for the input but it didn't work.
>
> Here's the code with the additional line you indicated I needed.
>
> I'm still getting: org.xml.sax.SAXException: No deserializer for
> {urn:DemandResponse}SiteDTO
>
>
>
>             call.setOperationName( "getSites" );
>
>             call.setReturnType( XMLType.SOAP_ARRAY );
>
>             call.registerTypeMapping(ArrayList.class,
XMLType.SOAP_ARRAY,
> new ArraySerializerFactory(), new ArrayDeserializerFactory());
>
>             call.addParameter("tokenId",
org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN);
>
>             call.addParameter("username",
> org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
>
>             sites = (ArrayList) call.invoke( new Object[] { tokenId,
> "mhorv1" } );
>
>
>
> ________________________________
>
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Monday, September 08, 2008 5:51 PM
> To: axis-user@ws.apache.org
> Subject: RE: Array question
>
>
>
> Marc-
>
> you'll need to associate the ArrayList java type to SOAP_ARRAY via
> call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new
> ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>
>
> then the call with a cast to ArrayList should work..<BR>
> ArrayList results = (ArrayList)call.invoke(...);<BR>
>
>
>
> BTW: the version of your axis implementation is REALLY outdated you
might
> want to think about updating to Axis 2..<BR>
>
>
>
>
>
>
>
> HTH<BR>
>
>
>
> Martin<BR>
>
>
>
> NB: be sure to do the registerTypeMapping for all the params as
well..<BR>
>
>
>
> ______________________________________________
>
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
Sender
> does not endorse distribution to any party other than intended
recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
> ________________________________
>
> Subject: Array question
> Date: Mon, 8 Sep 2008 15:22:17 -0500
> From: Marc.Horvath@Emerson.com
> To: axis-user@ws.apache.org
>
> Hi there.
>
>
>
> I was wondering if someone could provide me with an example of (or
point me
> in the direction of) a java client which calls a web service that
returns an
> array of a bean.
>
> I'm using Axis 1.4 dated April 22, 2006 and have already researched
this
> question only to find the majority of the responses were related to
earlier
> releases.
>
>
>
> The relevant portion of my client code is:
>
>
>
> call.setOperationName( "getSites" );
>
> call.setReturnType( XMLType.SOAP_ARRAY );
>
> call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN);
>
> call.addParameter("username", org.apache.axis.Constants.XSD_STRING,
> javax.xml.rpc.ParameterMode.IN);
>
> Object[] obj = (Object[]) call.invoke( new Object[] { tokenId, "test"
} );
>
>
>
> I'm receiving the following exception:
>
> org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO
>
>
>
> I'm sure I'm missing something in the client but I don't
know/understand
> what it is.
>
> I wrote the original interface and implementation and then used
Java2Wsdl
> and Wsdl2Java to generate the wsdl, server side code and wsdd.
>
>
>
> Thanks,
>
> Marc
>
>
>
> ________________________________
>
> Get more out of the Web. Learn 10 hidden secrets of Windows Live.
Learn Now
>
>
>
> ________________________________
>
> Stay up to date on your PC, the Web, and your mobile phone with
Windows
> Live. See Now
>
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Array question

Posted by Ma...@Emerson.com.
Thanks.
Between this and posting at forums.sun.com I got it.

-----Original Message-----
From: Anne Thomas Manes [mailto:atmanes@gmail.com] 
Sent: Friday, September 12, 2008 8:00 AM
To: axis-user@ws.apache.org
Subject: Re: Array question

Marc,

You must register a type mapping for the SiteDTO type. (I suggest
using a BeanMapping.)

Anne

On Thu, Sep 11, 2008 at 5:26 PM,  <Ma...@emerson.com> wrote:
> Thanks for your help!
>
>
>
> Marc
>
>
>
> ________________________________
>
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Thursday, September 11, 2008 5:14 PM
> To: axis-user@ws.apache.org
> Subject: RE: Array question
>
>
>
> sounds like the service faulted
> pls supply the wsdl so we can try
>
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
Sender
> does not endorse distribution to any party other than intended
recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
> ________________________________
>
> Subject: RE: Array question
> Date: Thu, 11 Sep 2008 15:51:48 -0500
> From: Marc.Horvath@Emerson.com
> To: axis-user@ws.apache.org
>
> Hi Martin,
>
>
>
> Thanks for the input but it didn't work.
>
> Here's the code with the additional line you indicated I needed.
>
> I'm still getting: org.xml.sax.SAXException: No deserializer for
> {urn:DemandResponse}SiteDTO
>
>
>
>             call.setOperationName( "getSites" );
>
>             call.setReturnType( XMLType.SOAP_ARRAY );
>
>             call.registerTypeMapping(ArrayList.class,
XMLType.SOAP_ARRAY,
> new ArraySerializerFactory(), new ArrayDeserializerFactory());
>
>             call.addParameter("tokenId",
org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN);
>
>             call.addParameter("username",
> org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
>
>             sites = (ArrayList) call.invoke( new Object[] { tokenId,
> "mhorv1" } );
>
>
>
> ________________________________
>
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Monday, September 08, 2008 5:51 PM
> To: axis-user@ws.apache.org
> Subject: RE: Array question
>
>
>
> Marc-
>
> you'll need to associate the ArrayList java type to SOAP_ARRAY via
> call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new
> ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>
>
> then the call with a cast to ArrayList should work..<BR>
> ArrayList results = (ArrayList)call.invoke(...);<BR>
>
>
>
> BTW: the version of your axis implementation is REALLY outdated you
might
> want to think about updating to Axis 2..<BR>
>
>
>
>
>
>
>
> HTH<BR>
>
>
>
> Martin<BR>
>
>
>
> NB: be sure to do the registerTypeMapping for all the params as
well..<BR>
>
>
>
> ______________________________________________
>
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
Sender
> does not endorse distribution to any party other than intended
recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
> ________________________________
>
> Subject: Array question
> Date: Mon, 8 Sep 2008 15:22:17 -0500
> From: Marc.Horvath@Emerson.com
> To: axis-user@ws.apache.org
>
> Hi there.
>
>
>
> I was wondering if someone could provide me with an example of (or
point me
> in the direction of) a java client which calls a web service that
returns an
> array of a bean.
>
> I'm using Axis 1.4 dated April 22, 2006 and have already researched
this
> question only to find the majority of the responses were related to
earlier
> releases.
>
>
>
> The relevant portion of my client code is:
>
>
>
> call.setOperationName( "getSites" );
>
> call.setReturnType( XMLType.SOAP_ARRAY );
>
> call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN);
>
> call.addParameter("username", org.apache.axis.Constants.XSD_STRING,
> javax.xml.rpc.ParameterMode.IN);
>
> Object[] obj = (Object[]) call.invoke( new Object[] { tokenId, "test"
} );
>
>
>
> I'm receiving the following exception:
>
> org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO
>
>
>
> I'm sure I'm missing something in the client but I don't
know/understand
> what it is.
>
> I wrote the original interface and implementation and then used
Java2Wsdl
> and Wsdl2Java to generate the wsdl, server side code and wsdd.
>
>
>
> Thanks,
>
> Marc
>
>
>
> ________________________________
>
> Get more out of the Web. Learn 10 hidden secrets of Windows Live.
Learn Now
>
>
>
> ________________________________
>
> Stay up to date on your PC, the Web, and your mobile phone with
Windows
> Live. See Now
>
> ---------------------------------------------------------------------
> 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: Array question

Posted by Anne Thomas Manes <at...@gmail.com>.
Marc,

You must register a type mapping for the SiteDTO type. (I suggest
using a BeanMapping.)

Anne

On Thu, Sep 11, 2008 at 5:26 PM,  <Ma...@emerson.com> wrote:
> Thanks for your help!
>
>
>
> Marc
>
>
>
> ________________________________
>
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Thursday, September 11, 2008 5:14 PM
> To: axis-user@ws.apache.org
> Subject: RE: Array question
>
>
>
> sounds like the service faulted
> pls supply the wsdl so we can try
>
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and Sender
> does not endorse distribution to any party other than intended recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
> ________________________________
>
> Subject: RE: Array question
> Date: Thu, 11 Sep 2008 15:51:48 -0500
> From: Marc.Horvath@Emerson.com
> To: axis-user@ws.apache.org
>
> Hi Martin,
>
>
>
> Thanks for the input but it didn't work.
>
> Here's the code with the additional line you indicated I needed.
>
> I'm still getting: org.xml.sax.SAXException: No deserializer for
> {urn:DemandResponse}SiteDTO
>
>
>
>             call.setOperationName( "getSites" );
>
>             call.setReturnType( XMLType.SOAP_ARRAY );
>
>             call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY,
> new ArraySerializerFactory(), new ArrayDeserializerFactory());
>
>             call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN);
>
>             call.addParameter("username",
> org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
>
>             sites = (ArrayList) call.invoke( new Object[] { tokenId,
> "mhorv1" } );
>
>
>
> ________________________________
>
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Monday, September 08, 2008 5:51 PM
> To: axis-user@ws.apache.org
> Subject: RE: Array question
>
>
>
> Marc-
>
> you'll need to associate the ArrayList java type to SOAP_ARRAY via
> call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new
> ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>
>
> then the call with a cast to ArrayList should work..<BR>
> ArrayList results = (ArrayList)call.invoke(...);<BR>
>
>
>
> BTW: the version of your axis implementation is REALLY outdated you might
> want to think about updating to Axis 2..<BR>
>
>
>
>
>
>
>
> HTH<BR>
>
>
>
> Martin<BR>
>
>
>
> NB: be sure to do the registerTypeMapping for all the params as well..<BR>
>
>
>
> ______________________________________________
>
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and Sender
> does not endorse distribution to any party other than intended recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
> ________________________________
>
> Subject: Array question
> Date: Mon, 8 Sep 2008 15:22:17 -0500
> From: Marc.Horvath@Emerson.com
> To: axis-user@ws.apache.org
>
> Hi there.
>
>
>
> I was wondering if someone could provide me with an example of (or point me
> in the direction of) a java client which calls a web service that returns an
> array of a bean.
>
> I'm using Axis 1.4 dated April 22, 2006 and have already researched this
> question only to find the majority of the responses were related to earlier
> releases.
>
>
>
> The relevant portion of my client code is:
>
>
>
> call.setOperationName( "getSites" );
>
> call.setReturnType( XMLType.SOAP_ARRAY );
>
> call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
> javax.xml.rpc.ParameterMode.IN);
>
> call.addParameter("username", org.apache.axis.Constants.XSD_STRING,
> javax.xml.rpc.ParameterMode.IN);
>
> Object[] obj = (Object[]) call.invoke( new Object[] { tokenId, "test" } );
>
>
>
> I'm receiving the following exception:
>
> org.xml.sax.SAXException: No deserializer for {urn:DemandResponse}SiteDTO
>
>
>
> I'm sure I'm missing something in the client but I don't know/understand
> what it is.
>
> I wrote the original interface and implementation and then used Java2Wsdl
> and Wsdl2Java to generate the wsdl, server side code and wsdd.
>
>
>
> Thanks,
>
> Marc
>
>
>
> ________________________________
>
> Get more out of the Web. Learn 10 hidden secrets of Windows Live. Learn Now
>
>
>
> ________________________________
>
> Stay up to date on your PC, the Web, and your mobile phone with Windows
> Live. See Now
>
> ---------------------------------------------------------------------
> 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: Array question

Posted by Ma...@Emerson.com.
Thanks for your help!

 

Marc

 

________________________________

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Thursday, September 11, 2008 5:14 PM
To: axis-user@ws.apache.org
Subject: RE: Array question

 

sounds like the service faulted 
pls supply the wsdl so we can try 

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 



________________________________

Subject: RE: Array question
Date: Thu, 11 Sep 2008 15:51:48 -0500
From: Marc.Horvath@Emerson.com
To: axis-user@ws.apache.org

Hi Martin,

 

Thanks for the input but it didn't work.

Here's the code with the additional line you indicated I needed.

I'm still getting: org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO 

 

            call.setOperationName( "getSites" );

            call.setReturnType( XMLType.SOAP_ARRAY );

            call.registerTypeMapping(ArrayList.class,
XMLType.SOAP_ARRAY, new ArraySerializerFactory(), new
ArrayDeserializerFactory());

            call.addParameter("tokenId",
org.apache.axis.Constants.XSD_INT, javax.xml.rpc.ParameterMode.IN);

            call.addParameter("username",
org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

            sites = (ArrayList) call.invoke( new Object[] { tokenId,
"mhorv1" } );

 

________________________________

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, September 08, 2008 5:51 PM
To: axis-user@ws.apache.org
Subject: RE: Array question

 

Marc-

you'll need to associate the ArrayList java type to SOAP_ARRAY via
call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new
ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>

then the call with a cast to ArrayList should work..<BR>
ArrayList results = (ArrayList)call.invoke(...);<BR>





BTW: the version of your axis implementation is REALLY outdated you
might want to think about updating to Axis 2..<BR>







HTH<BR>



Martin<BR> 



NB: be sure to do the registerTypeMapping for all the params as
well..<BR>



______________________________________________ 

Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 

________________________________

Subject: Array question
Date: Mon, 8 Sep 2008 15:22:17 -0500
From: Marc.Horvath@Emerson.com
To: axis-user@ws.apache.org

Hi there.

 

I was wondering if someone could provide me with an example of (or point
me in the direction of) a java client which calls a web service that
returns an array of a bean.

I'm using Axis 1.4 dated April 22, 2006 and have already researched this
question only to find the majority of the responses were related to
earlier releases.

 

The relevant portion of my client code is:           

 

call.setOperationName( "getSites" );

call.setReturnType( XMLType.SOAP_ARRAY );

call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
javax.xml.rpc.ParameterMode.IN);

call.addParameter("username", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);

Object[] obj = (Object[]) call.invoke( new Object[] { tokenId, "test" }
);

 

I'm receiving the following exception:

org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO

 

I'm sure I'm missing something in the client but I don't know/understand
what it is.

I wrote the original interface and implementation and then used
Java2Wsdl and Wsdl2Java to generate the wsdl, server side code and wsdd.

 

Thanks,

Marc

 

________________________________

Get more out of the Web. Learn 10 hidden secrets of Windows Live. Learn
Now
<http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-c
ns%21550F681DAD532637%215295.entry?ocid=TXT_TAGLM_WL_getmore_092008> 

 

________________________________

Stay up to date on your PC, the Web, and your mobile phone with Windows
Live. See Now
<http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/> 


RE: Array question

Posted by Martin Gainty <mg...@hotmail.com>.
sounds like the service faulted 
pls supply the wsdl so we can try 

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


Subject: RE: Array question
Date: Thu, 11 Sep 2008 15:51:48 -0500
From: Marc.Horvath@Emerson.com
To: axis-user@ws.apache.org



















Hi Martin,

 

Thanks for the input but it didn’t work.

Here’s the code with the additional line you indicated I needed.

I’m still getting: org.xml.sax.SAXException: No deserializer for {urn:DemandResponse}SiteDTO 

 

            call.setOperationName( "getSites" );

            call.setReturnType( XMLType.SOAP_ARRAY );

            call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new ArraySerializerFactory(), new ArrayDeserializerFactory());

            call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT, javax.xml.rpc.ParameterMode.IN);

            call.addParameter("username", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

           
sites = (ArrayList) call.invoke( new Object[] { tokenId, "mhorv1" } );

 









From: Martin Gainty
[mailto:mgainty@hotmail.com] 

Sent: Monday, September 08, 2008
5:51 PM

To: axis-user@ws.apache.org

Subject: RE: Array question



 

Marc-



you'll need to associate the ArrayList java type to SOAP_ARRAY via

call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new
ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>



then the call with a cast to ArrayList should work..<BR>

ArrayList results = (ArrayList)call.invoke(...);<BR>



BTW: the version of your axis implementation is REALLY outdated you might want to think about updating to Axis 2..<BR>



HTH<BR>

Martin<BR> 

NB: be sure to do the registerTypeMapping for all the params as well..<BR>

______________________________________________ 

Disclaimer and confidentiality note


Everything in this e-mail and any attachments relates to the official business
of Sender. This transmission is of a confidential nature and Sender does not
endorse distribution to any party other than intended recipient. Sender does
not necessarily endorse content contained within this transmission. 











Subject: Array question

Date: Mon, 8 Sep 2008 15:22:17 -0500

From: Marc.Horvath@Emerson.com

To: axis-user@ws.apache.org



Hi there.

 

I was wondering if someone could provide me with an example
of (or point me in the direction of) a java client which calls a web service
that returns an array of a bean.

I’m using Axis 1.4 dated April 22, 2006 and have already
researched this question only to find the majority of the responses were
related to earlier releases.

 

The relevant portion of my client code is:          


 

call.setOperationName(
"getSites" );

call.setReturnType(
XMLType.SOAP_ARRAY );

call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT, javax.xml.rpc.ParameterMode.IN);

call.addParameter("username", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

Object[] obj = (Object[])
call.invoke( new Object[] {
tokenId, "test" } );

 

I’m receiving
the following exception:

org.xml.sax.SAXException: No deserializer for {urn:DemandResponse}SiteDTO

 

I’m sure I’m missing something in the client but I don’t
know/understand what it is.

I wrote the original interface and implementation and then
used Java2Wsdl and Wsdl2Java to generate the wsdl, server side code and wsdd.

 

Thanks,

Marc



 







Get more out of the Web. Learn 10 hidden secrets of Windows
Live. Learn Now







_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

RE: Array question

Posted by Ma...@Emerson.com.
Hi Martin,

 

Thanks for the input but it didn't work.

Here's the code with the additional line you indicated I needed.

I'm still getting: org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO 

 

            call.setOperationName( "getSites" );

            call.setReturnType( XMLType.SOAP_ARRAY );

            call.registerTypeMapping(ArrayList.class,
XMLType.SOAP_ARRAY, new ArraySerializerFactory(), new
ArrayDeserializerFactory());

            call.addParameter("tokenId",
org.apache.axis.Constants.XSD_INT, javax.xml.rpc.ParameterMode.IN);

            call.addParameter("username",
org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

            sites = (ArrayList) call.invoke( new Object[] { tokenId,
"mhorv1" } );

 

________________________________

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, September 08, 2008 5:51 PM
To: axis-user@ws.apache.org
Subject: RE: Array question

 

Marc-

you'll need to associate the ArrayList java type to SOAP_ARRAY via
call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new
ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>

then the call with a cast to ArrayList should work..<BR>
ArrayList results = (ArrayList)call.invoke(...);<BR>



BTW: the version of your axis implementation is REALLY outdated you
might want to think about updating to Axis 2..<BR>



HTH<BR>

Martin<BR> 

NB: be sure to do the registerTypeMapping for all the params as
well..<BR>

______________________________________________ 

Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 



________________________________

Subject: Array question
Date: Mon, 8 Sep 2008 15:22:17 -0500
From: Marc.Horvath@Emerson.com
To: axis-user@ws.apache.org

Hi there.

 

I was wondering if someone could provide me with an example of (or point
me in the direction of) a java client which calls a web service that
returns an array of a bean.

I'm using Axis 1.4 dated April 22, 2006 and have already researched this
question only to find the majority of the responses were related to
earlier releases.

 

The relevant portion of my client code is:           

 

call.setOperationName( "getSites" );

call.setReturnType( XMLType.SOAP_ARRAY );

call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT,
javax.xml.rpc.ParameterMode.IN);

call.addParameter("username", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);

Object[] obj = (Object[]) call.invoke( new Object[] { tokenId, "test" }
);

 

I'm receiving the following exception:

org.xml.sax.SAXException: No deserializer for
{urn:DemandResponse}SiteDTO

 

I'm sure I'm missing something in the client but I don't know/understand
what it is.

I wrote the original interface and implementation and then used
Java2Wsdl and Wsdl2Java to generate the wsdl, server side code and wsdd.

 

Thanks,

Marc

 

________________________________

Get more out of the Web. Learn 10 hidden secrets of Windows Live. Learn
Now
<http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-c
ns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_getmore_092008> 


RE: Array question

Posted by Martin Gainty <mg...@hotmail.com>.
Marc-

you'll need to associate the ArrayList java type to SOAP_ARRAY via
call.registerTypeMapping(ArrayList.class, XMLType.SOAP_ARRAY, new ArraySerializerFactory(), new ArrayDeserializerFactory());<BR>

then the call with a cast to ArrayList should work..<BR>
ArrayList results =  (ArrayList)call.invoke(...);<BR>

BTW: the version of your axis implementation is REALLY outdated you might want to think about updating to Axis 2..<BR>

HTH<BR>
Martin<BR> 
NB: be sure to do the registerTypeMapping for all the params as well..<BR>
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


Subject: Array question
Date: Mon, 8 Sep 2008 15:22:17 -0500
From: Marc.Horvath@Emerson.com
To: axis-user@ws.apache.org
















Hi there.

 

I was wondering if someone could provide me with an example
of (or point me in the direction of) a java client which calls a web service that
returns an array of a bean.

I’m using Axis 1.4 dated April 22, 2006 and have already
researched this question only to find the majority of the responses were related
to earlier releases.

 

The relevant portion of my client code is:          


 

call.setOperationName( "getSites" );

call.setReturnType( XMLType.SOAP_ARRAY );

call.addParameter("tokenId", org.apache.axis.Constants.XSD_INT, javax.xml.rpc.ParameterMode.IN);

call.addParameter("username", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

Object[] obj =
(Object[]) call.invoke( new Object[] { tokenId, "test" } );

 

I’m
receiving the following exception:

org.xml.sax.SAXException: No deserializer for {urn:DemandResponse}SiteDTO

 

I’m sure I’m missing something in the client but
I don’t know/understand what it is.

I wrote the original interface and implementation and then
used Java2Wsdl and Wsdl2Java to generate the wsdl, server side code and wsdd.

 

Thanks,

Marc







_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008