Solved

Web Service: Sending Simple Type vs Complex Type

Posted on 2004-04-07
8
742 Views
Last Modified: 2008-03-06
This query is more on the recommended practice in sending/receiving simple type over a complex type from a web service
 
Ex: WebService A has a method 'CalcualteTax' which takes 'Invoice' object as an input parameter and returns an invoice object. Now 'Invoice' is a complex type and if Java client needs to call 'CalcualteTax', it has to pass 'Invoice' as the parameter. I understand to do this, the Java need to construct a class based on the WSDLs description of 'Invoice' complex type. If the data were accepted as an xml doc/string simple type, then there would not be any issue in terms of deciphering a data type.
 
My question: WOuld there be any performance overhead in sending complex types over simple type. I pesonally feel there would be an overhead in serializing and deserializing a complext type.
 
Any input on the above is highly appreciated
0
Comment
Question by:salur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
8 Comments
 
LVL 4

Expert Comment

by:Jarodtweiss
ID: 10781519
Is there a problem to send / receive complex type ?
Absolutely not.
I now have a .NET program, communicating with JAVA web services, using complex types and it is perfectly ok ! And you are right the definition of those objects will be contained in a WSDL file and so Java or .NET will be able to instantiate them.

Is there an overhead ?
All communication is made in SOAP, and so all objects are serialized / deserialized. And so of course, a single integer will be serialized much more quicker than an array of 10 000 complex types, composed of other complex type.
But in the other hand, if you need such a result, there is no other way to do it !
So my advice is to use complex type if you need it. But if you can see some time consuming communication, maybe you can work directly with XML, do not instantiate objects at each side !
0
 

Author Comment

by:salur
ID: 10783571
Thanks a lot for your response.

One aspect I forgot to mention is of interoperability between various heterogenous systems. Would that not be an issue if we use Complex types, wherein the platform might not support those types.

Keeping in mind, that in future we would be communicating with mobile devices as well, from your reeponse, I can infer that going for complex types, wherein performance would be of utmost importance, is not recommended.

Any thoughts on the above ?
0
 
LVL 4

Expert Comment

by:Jarodtweiss
ID: 10783620
for heterogeneous system, complex type are not a problem.
Indeed a complex type is composed of simple types at the end. If all of those simple type can be converted from one language to the other one (as for me, between Java and .NET), your complex type can be understood (it is "only" a composition)
Your language will properly "decrypt" the WSDL to build your custom object.


0
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 

Author Comment

by:salur
ID: 10783706
Let me rephrase my Q.

You mentioned that an integer would be serialized/de-serialized much faster than an complex types. If my web service would be accessed by a mobile app, wherein performance would be of utmost criteria, would you still recommend going for complex types.

I am basically trying to draw a line in concluding when to go for complex type and when not to. Communicating with Java is an example. But when I mean, heterogeneous system, it includes mainframe, legacy microsoft, mobile etc etc. I am trying to bloat the system boundary.
0
 
LVL 4

Accepted Solution

by:
Jarodtweiss earned 250 total points
ID: 10783815
In that case, I can't give you firm answers as I haven't took any precise figures about that.
But I think that there won't a big overhead to use complex type (specially if you NEED a complex type). For me, the biggest problem is the quantity of objects and not the complexity.
Also, do not forget that for a web service, we can communicate in RPC mode (using objects) or in Document mode (using only XML). I'm using always RPC and honnestly I do not know how to do something else in .NET. But it can also be a solution for you : no serialization, no deserialization...

For heterogeous system, I cannot give extra information on it, sorry.
0
 

Author Comment

by:salur
ID: 10785424
That's fine. Thanks a lot for your response and time. Much appreciated.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question