Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java soap proble with returning an array of DTO

 
Tirthankar Dutta Chaudhuri
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1007
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I'll bite, what is a "DTO"?
 
Tirthankar Dutta Chaudhuri
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!