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
Solved

web service return type

Posted on 2008-10-08
6
2,490 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
  • 3
  • 2
6 Comments
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 250 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 250 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

791 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