Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

web service return type

Posted on 2008-10-08
6
Medium Priority
?
2,506 Views
Last Modified: 2010-04-21
Hi all,

I am fairly new to web services and have consumed one or two in the past. I have been asked to consume a web service which contains personal details of users such as Title, First name, Surname, Address etc.

Now I have managed to do this and all seems to be working ok. However the data the service is returning is just a string of characters made up of the data. An example of this would be when I call the GetUser method and it returns a string not dissimilar to this:

123435Surname Firstname Title04/03/2008
Addressline1AddressLine2Postcode

Now I understand what the data is but it just seems to be in a complete mess. I have not seen anything like this before as the web services I have consumed in the past have returned a string of xml  that I could loop through.

My question is what is the most common return type for a web service and am I missing something with what is being returned with this one? Also is it common place to have a service return a string of xml like so:

<user><title>Mr</title><forename>fred</forename><surname>blogs</surname></user>

Many thanks as at a complete loss with this one.

Cragly
0
Comment
Question by:Cragly
[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
  • 2
6 Comments
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 750 total points
ID: 22669393
When you say you consumed the web service do you mean that you created a proxy for the web service and called this method. A web service can return any serializable data type like string, int, structure, class object, etc.

In this case it seems your web service is returning a string which you have captured. You will have to modify the web service to return the address in your intended format or else you have to find out the algorithm used to form the string and use the same algorithm to retrieve data from the string.
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 750 total points
ID: 22670159
is the web service controlled by your team or is it a third party one
if its controlled by your team then you might get the interface modified so that it returns the user object serialized into XML as the example given by you
<user><title>Mr</title><forename>fred</forename><surname>blogs</surname></user>
or else you might want to get some kind of delimiter added to your strings so that you can retrieve your data from the strings
0
 

Author Comment

by:Cragly
ID: 22670402
Thanks guys for the comments.

I forgot to mention that this web service I have to use is a third party service that cannot be modified. I have created the proxy automatically within VS 2008 and can successfully call the methods and return the data. I was just confused at what I was getting back as it is not consistent or delimitated in any way making it hard to do anything with at my end.

I Just wanted to make sure that this what I am thinking (that the web service is a bit crap for returning such data) was not to far of the mark! As I mentioned I have worked with third part services before that have either returned a .net type or custom object or a string of XML that I could do something with.

This just seems very poor and its from quite a large organisation as well not some backstreet company.

If you can confirm this then I will split the points as the feedback is much appreciated.

Cragly
 
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22670491
i assume that you might be scratching your head to find out how to get the information out of the strings that the web service is returning
is there a format in which the organisation says that its going to return you the data
if yes then your data segregation and putting it into your object might become a little easy
there might be some documentation regarding the same which might be helpful to you
0
 

Author Comment

by:Cragly
ID: 22677603
Unfortunatly it just returns this long undelimited string and the documentation is not very helpful. But yes a lot of head scratching as never seen a sevice return so much data in a string in this way. What about yourself? Have you worked with any services that do this? What types do you normaly work with when using web services?
0
 

Author Closing Comment

by:Cragly
ID: 31504226
Cheers for the help. I have split the points as you are both correct in what you are saying.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

730 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