Solved

Web Service: Sending Simple Type vs Complex Type

Posted on 2004-04-07
8
737 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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