Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

web service client with a complex datatype  RSS feed

 
Mark heningen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I want to call a web service method with a complex datatype as input.
There is an approach for String type input:
http://www.java2s.com/Open-Source/Java-Document/J2EE/enhydra/samples/client/DynamicInvoker.java.htm
Is there anything which i can use as a starting point for complex datatype?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are we talking about a SOAP web service somebody else built or what?

Is this a complex structure that can be represented in XML?

Bill
 
Rizwan Patel
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

You can create the data structure in XSD and take this approach as a starting point. NetBeans have a practical demonstration of this kind of approach in example section.

 
Mark heningen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Are we talking about a SOAP web service somebody else built or what?

Is this a complex structure that can be represented in XML?

Bill

WSDL representation seems quite ok. There are other methods in wsdl those expect String type values as input and they work fine with the client i mentioned earlier.
By complex i mean a collection of objects(BusinessObjects).
I am a bit unsure about object representation in xml
 
Raja Pal
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark, A business object can be expressed as a <complexType> which is in turn a <sequence> of some <simpleType(s)> and they can be inturn defined by primitve(pre-defined) types. For a collection of objects please use "minoccurs" and "maxoccurs" for bounding. If not just treat them as arrays. This should be possible to represent pretty much any object except ofcourse non-serializable ones.
 
Mark heningen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raja Pal wrote:Mark, A business object can be expressed as a <complexType> which is in turn a <sequence> of some <simpleType(s)> and they can be inturn defined by primitve(pre-defined) types. For a collection of objects please use "minoccurs" and "maxoccurs" for bounding. If not just treat them as arrays. This should be possible to represent pretty much any object except ofcourse non-serializable ones.

This is exactly what i have done in wsdl file( "minoccurs" and "maxoccurs" for bounding.). The problem is from Client side. Passing string won't be problem. I already pass Array of String in "normal" cases. and it works fine. Can you elaborate a bit about passing Array of Objects from client?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!