Log in or register to post comments

Web Service down?

June 17, 2013 - 5:10am #1


I am trying to add some target through the Vuforia Web Service since Sunday but no matter I always get result code "Fail", even on getting all targets.

Adding target via the web page works fine.

Example result for /targets 

{u'transaction_id': u'24532801c1334021a80388341f0ff3c7', u'result_code': u'Fail'}


Thanks in advance, Oli

Web Service down?

September 30, 2016 - 6:37am #23

I am still facing this issue. 


Web Service down?

August 31, 2016 - 1:42pm #22

@brainbreaker - Consolidating to this thread: https://developer.vuforia.com/forum/cloud-recognition/fail-java-sample-codes-postnewtarget

Web Service down?

August 30, 2016 - 8:57pm #21

@medabit Sorry, Here's the new link to the code: http://pastebin.com/wDSgrYbq

And yes, I am using the PostNewTarget.java from official samples only.

Web Service down?

August 30, 2016 - 11:01am #20


Your link does not work - the post was removed.

That's OK because we have sample Java code available for download for the VWS APIs:



Web Service down?

August 30, 2016 - 10:30am #19

Facing the same issue every time I try to post a new target using Java. Here is the code: http://pastebin.com/HbXmqH4Tr

Tried posting via Target Manager, it works but not with this code.

Can anyone help who has faced the same issue? 

Thanks in Advance!

Web Service down?

January 16, 2014 - 8:52pm #18

I have checked 2-3 images by Target Manager, That allows to post target nicely.

But it always fail to post image by VWS web service.

Please debug it and reply quickly.

Web Service down?

January 16, 2014 - 3:43pm #17

Check that the image you are using is valid by submitting it to your Cloud Database using the Target Manager - otherwise your code looks fine. 

Web Service down?

January 16, 2014 - 2:58am #16

I am using PostNewTarget.java

I have set valid accesskey, secretKey, target name and imageLocation in PostNewTarget.java file.

I have tested other APIs like get list of all targets, get info of target, Those are running well.

I am attaching java file.

Please advise.

Package icon PostNewTarget.zip1.91 KB

Web Service down?

January 11, 2014 - 8:03am #15

Have you been able to execute other queries? - is it only your POST request that is failing?

If you can, please post a code snipped showing how you are formatting and executing the POST request.

Web Service down?

January 10, 2014 - 8:11pm #14

I am getting same error when running VWS(Vuforia Web Service).

It always gives an error.

Output of PostNewTarget is as follow :

Sat, 11 Jan 2014 04:07:19 GMT

Created target with id:


Is there any solution for this?

Web Service down?

June 26, 2013 - 4:39am #13

I fixed that problem by myself.

For some reasons, if i add the custom headers, i dont needed to set the Content-Type manually to an empty string. 



Web Service down?

June 21, 2013 - 5:19am #12

I would suggest to make sure that the request that you produce in C# is exactly the same as the one generated with the Java sample code;

in the end, every request is just a string and you can easily compare it with the same request produced by the Java code.

If you see any difference, you can then focus your attention on the difference and see what needs to be changed.

That's one of the reasons why we provide the samples, as this is a reference implementation and you can use them to validate your custom implementation...


Web Service down?

June 21, 2013 - 4:41am #11

After 2 hours installing tousand of libraries for java, android and eclipse, i got the java example to work, and everything workes fine. I got a correct answer from the server.

So the question is: "Why does my code dont work anymore?"


These are the informations send in java:


Fri, 21 Jun 2013 09:41:07 GMT

and this are the same informations in C# and unity:



Authorization: VWS ab5201de5230e0de38e7857306ed8531561ec188:eFBkcMBFxEdzU7BzsoIvw217/os=

Date: Fri, 21 Jun 2013 09:51:17 GMT


To repeat that: I dont changed anything relevant to the authorization algorithm. The SignatureBuilder and the GetTarget-Routine is still the same as before,but I got some weird behaviour if i remove some parts of my code:

If i remove the Authorization header and the date header nothing happens, still get "Fail" return code. If i remove the ContentType header, the authorization header AND the date header i got a "AuthenticationFailure" return code instead of a "Fail" return code.

Does any of this informations help to solve this problem? It starts to driving me nuts...






P.S.: I changed the actual values like targetId and signature-string to random values for security resons,  but you can be sure, that everthing looks like this, but  i changed some numbers!

Web Service down?

June 20, 2013 - 4:37am #10

Well, one possibility is that the code used to work previously because the system was perhaps more "tolerant" on certain request format details .

For example, ff you look at the case reported by oilhey in this thread, the Date/Time format he was using was not fully compliant with the official specs; for some reasons the system was previously accepting the requests despite that little issue; then, as the system got updated, the Date format (with the "GMT" ending) had to be corrected.

So, similarly, there might (potentially) be something in the code that you are using which was tolerated before, but which does not conform to the specifications (and the updated system now spots the issue and generates an error...)


So, that's why I am suggesting to verify with the Java VWS samples, because this would allow at least to narrow down the issue, and allow us to focus our investigation (i.e. is it in the code? or is there a problem on the account / server ?)



Web Service down?

June 20, 2013 - 2:47am #9

I use unity and C#.

I worked on a VWS port for unity since 2 weeks, and my code worked well since yesterday. I dont change anything, so i dont think to check the java, or php example code will help.

I also tried to remove my server access key, and i get the same response. It dont have anything to do with my code. I dont changed anything, and everthing worked well until yesterday.




EDIT: I tried to create a new cloud database to check if the problem is my old cloud data base, but i get the same issue.

Web Service down?

June 20, 2013 - 2:42am #8

Hi bjoernMXM

could you check using our Java or PHP VWS samples ?

this should allows you to assess if your account is still working...


Web Service down?

June 20, 2013 - 2:37am #7

Got the same problem, but i dont have the "-0000"-issue.


Any other idea why the web service dont work anymore for no reason?


Last week my vws code worked well but since yesterday i cant even get a target from the server.


I allways get a "Fail" response.Even if i remove the Authorization header. I dont get a "AuthenticationFailure", but a "Fail" response. There must be some issues with the server or with my colud reco database.


Is it possible to "corrupt" a database for some reason?


I hope you can help me!




Web Service down?

June 17, 2013 - 8:28am #6

Glad to hear is solved.

Web Service down?

June 17, 2013 - 7:42am #5

And I found the problem. The service seems to be fine but more restrict now.

I have been using the date format Mon, 17 Jun 2013 14:31:18 -0000 for the Date HTTP header field which seems to be not valid anymore and causes the Web Server to respond a "Bad request". If I change it the last 5 characters from "-0000" to "GMT" it works.

Thanks for making me look harder :)

Web Service down?

June 17, 2013 - 6:11am #4

Ok, I understand it was working before;

but this is a good reason to check wiht our samples; if the samples also show the same fail result, then we would be sure that the problem is to be searched in your code (or otherwise that would confirm the problem is wsomewhere else...)

otherwise we cannot be sure.



Web Service down?

June 17, 2013 - 5:57am #3

We use our own Python scripts. Here is a snippet that can reproduce the error. Also according to the documentation result code "Fail" means Internal Server Error. And this scripts used to work some time ago :(

import sys,os,urllib2,hashlib,hmac,binascii,email.Utils,json,httplib,base64,logging,subprocess,PIL.Image

kAccessKey = '.........'
kSecretKey = '.........'

vws_host = 'vws.vuforia.com'
vws_url = 'https://' + vws_host

def get_signatur(http_verb,content_md5,content_type,request_path,date_string):
  StringToSign = http_verb + "\n" + content_md5 + "\n" + content_type + "\n" + date_string + "\n" + request_path
#  print(StringToSign)
  hashed = hmac.new(kSecretKey, StringToSign, hashlib.sha1)
  # The signature
  return binascii.b2a_base64(hashed.digest())[:-1]

def get_all_targets():
  request_path = "/targets"
  body = ""
  m = hashlib.md5()
  date_string = email.Utils.formatdate()
  conn = httplib.HTTPSConnection(vws_host)
  conn.request('GET', request_path,body , headers = {'Date': date_string, 'Authorization': 'VWS %s:%s' % (kAccessKey,get_signatur('GET',m.hexdigest(),"",request_path,date_string))})
  resp = conn.getresponse()
  return resp.read()

if __name__ == "__main__":


Web Service down?

June 17, 2013 - 5:42am #2

Hi, are you using our Java or PHP sample implementation of the VWS API ? or a custom one ?

if you are using your own, maybe it owuld be a good idea to mkae a quick test with our samples (just to exclude that there is a problem with your custom implementation).

You can find them here:


(see VWS Samples at the bottom of the page)

or directy downloaded at this URL:



Log in or register to post comments