[Tutor] webservice question

Alan Gauld alan.gauld at btinternet.com
Thu Jan 29 09:34:23 CET 2015


On 29/01/15 05:37, Phil H wrote:

> public java.lang.String getSettings (java.lang.String username,
                                       java.lang.String pass,
                                       java.lang.String key,
                                       java.lang.string tag)

> i'm told it should return something like this
> <?xml version="1.0" encoding="UTF-8" ?> <gettag> <response><tag> [tag''s value] </tag> </response> </gettag>


> then I have a test to authenticate user and pass
>
> url = 'http://localhost:8080/gettag/testauth?username=testuser&pass=123456'
> and this works
>
> This is where I get confused, how do I pass the variable key's value
> and return the variable tag's value.


> Thanks in advance for any help, I've tried a bunch of stuff and its just not working.

It would probably help if you'd shown us at least one of your attempts 
so we can see where your thinking has been going... also the response back.

But at a guess I'd have thought you used a URL of:

url = 
'http://localhost:8080/gettag/getSettings?username=testuser&pass=123456&key=<keyvalue>&tag=<tagname>'

Since that seems to be the API signature?

But I'm no expert on Restful web services so I could well be wrong.
Is that close to what you tried?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list