Solved

web service return type

Posted on 2008-10-08
6
2,493 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
C# MVC Insert Multiple Row into DB 2 62
Please explain purpose of GZIP 4 58
Adding items to a C# list incrementally 5 60
Aspx calendar pop up control 3 27
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 …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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