• Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis 2 problems  RSS feed

 
kirill kazachenka
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Note: i'm using XMLBeans
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!