Solved

Web Service: Sending Simple Type vs Complex Type

Posted on 2004-04-07
8
735 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
  • 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Using MS Code on my Mac 6 47
AutoHotkey ActiveX Component Error 8 56
Change data in datatable 8 18
Close word object 13 21
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now