• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis 2 problems

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
i'm using axis2 and have some problems:

1) when i create an wsdl file, using java2wsdl i have an wsdl file an message into console: Unable to generate EPR for the transport : http what it may be?
2) i generate service and client; in the skeleton i write some code:


and when i test WS in SoapUI i have an responce message:



the stacktrace into tomcat is:



it became when i try send an ArrayList, HashMap and other...what is the problem it maybe? i think it maybe serializer/deserializer don't work propertly or what?

P.S. Sorry for my English..it not my first language
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See my response in this topic.

The short answer is that the (de)serialization mechanism only handles Arrays (for XML maxOccurs > 0) but no collections.
 
kirill kazachenka
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
i have read this but i'm need use axis2..and haw can i send custom types like

Book
- index
- name
- author

?
this is my WSCommandResult:


this is ResultValue:


question: wsdl2java generates skeleton and other implementations, and generated ResultValue have field value not Object type, there is XmlObject, and how can i sent my Book in this ResultValue?
 
kirill kazachenka
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note: i'm using XMLBeans
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kirill kazachenka wrote:generated ResultValue have field value not Object type, there is XmlObject, and how can i sent my Book in this ResultValue?



You are still thinking in terms of Java, not SOAP/XML. SOAP web services are XML centric. So what is happening here it the that Java's universal type Object is converted to XML's universal type {http://www.w3.org/2001/XMLSchema}anyType (basically a XML fragment). The downside of this conversion is that it is not reversible as {http://www.w3.org/2001/XMLSchema}anyType is converted to a Java XML document fragment (which is captured in this case in a XmlObject). To get any relevant information your are going to have to navigate the information inside that XML fragment.

So basically don't use "Object" unless you actually intend to transfer raw XML.

As long as you stick to Value Objects that are only comprised of Java types with defined to-XML mappings (and complementary XML-to-Java mappings) and arrays you should be fine.

From your description it is not clear whether Book contains index, name, and author or whether they all are just different, unrelated classes.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic