aspose file tools
The moose likes Web Services and the fly likes java soap  proble with returning an array of DTO Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "java soap  proble with returning an array of DTO " Watch "java soap  proble with returning an array of DTO " New topic
Author

java soap proble with returning an array of DTO

Tirthankar Dutta Chaudhuri
Ranch Hand

Joined: Feb 26, 2005
Posts: 48
hi,
i am using java soap tp build a web service . I need to return an array of DTO . How can that be done .
I tried instances of DTO in a java array list and return it , but it did not work . i was gettin a error :
[SOAPException: faultCode=SOAP-ENV:Server; [SOAPException: faultCode=SOAP-ENV:Server; msg=java.lang.Illegalargumentexception .

CAn any one tell me how do i return a array of DTO or a list or Arraylist containing the instances of my DTO.
Thanks,
Tirthankar
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 984

Ok I'll bite, what is a "DTO"?


Please ignore post, I have no idea what I am talking about.
Tirthankar Dutta Chaudhuri
Ranch Hand

Joined: Feb 26, 2005
Posts: 48
HI ,
a dto is a user defined class inmy case its a simple bean with getter and setter methods . So how can a array of such a class be returned .
I am getting the follwing error :


Listing current CD catalog.
[SOAPException: faultCode=SOAP-ENV:Client; msg=No mapping found for 'urn:St
udentService:Student' using encoding style 'http://schemas.xmlsoap.org
/soap/encoding/'.; targetException=java.lang.IllegalArgumentException: No m
apping found for 'urn:StudentService:Student' using encoding style 'http://schem
as.xmlsoap.org/soap/encoding/'.]
at org.apache.soap.rpc.Call.invoke(Call.java:294)
at javaxml2.StudentLister.list(StudentLister.java:27)
at javaxml2.StudentLister.main(StudentLister.java:56)
Press any key to continue . . .
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
Originally posted by William Barnes:
Ok I'll bite, what is a "DTO"?


I had to Google it too, but then of course it hits you...it's one of the good ol' Core J2EE Patterns. I always think of them as 'transfer objects' or 'value objects'.

In any case, to send a DTO, you need to generate some classes to do the Java <-> XML mapping. Looks like you're using Axis, so wsdl2java would be the natural choice.



-Tim
Tirthankar Dutta Chaudhuri
Ranch Hand

Joined: Feb 26, 2005
Posts: 48
hi,
Tim thanks for the reply . I am using RPC router servlet . Any i got it going . There was some problem with the deployment descriptor .
Thanks,
Tirthankar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java soap proble with returning an array of DTO
 
Similar Threads
Error sending DataHandler
Soap Fault Implementation
Error deserializing DataHandler
SOAP literal xml serialization
Late Editions