Solved

Web Service: Sending Simple Type vs Complex Type

Posted on 2004-04-07
8
740 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSIS On fail action 5 53
Vb.net threads keep increasing 2 50
C# Service FileSystemwatcher isse 9 46
Visual C# Windows Project - Clone Form 4 24
IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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