Search code examples
eclipsehttpworkday-api

Workday Studio - request with HTTP out to vendor API receiving error with: No bean named 'http-token-auth' is defined


I have a Workday studio integration to send a GET request to a vendor's API using an HTTP component, but I'm receiving the error below. The vendor doesn't have a username/password to connect. I have to connect using a token. Does anyone know how to make this work from Studio to GET data?

Reason: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'http-token-auth' is defined

I have sent the request in many different ways: hard coding the URL with the token, setting headers with the token. Below are my different attempts. enter image description here

I’m not sure what Http authorization this is supposed to use. There is no username/password, just a token and a URL to post using CURL. Below is what studio looks like with the HTTP properties. enter image description here

Below is what is set on the Header. enter image description here

Also, I'm able to GET data using SoapUI. Below is a snip of the request in SoapUI. enter image description here

Below is the JSON raw request in SoapUI that is successful in getting data from the API. enter image description here

Any help is much appreciated!!

Thank you, -Remo


Solution

  • To preface; I'm not familiar with Workday Studio, and there don't seem to be any public docs, so there may be some nuance here that this answer misses.

    Summary

    Workday, your code, or possibly some library being used is referencing a bean (see Spring docs: Core Technologies) that does not exist or can not be found.

    If you're not writing any Java code whatsoever here, it's almost certainly either a configuration issue or bug in Workday Studio. Below are some observations based on the information you've provided. But first, a wild guess.

    Wild Guess

    It seems likely that Workday is handling this a little differently than cURL or SoapUI. cURL and SoapUI are doing something like the following:

    • Send GET request to URL with params, and include API key in header
    • Server sends desired response

    However, it sounds like Workday is doing something more like:

    • Send GET request assuming a pre-auth scenario, using challenge-type: 'token'
    • Server responds with the correct auth-type that its framework (presumably Rails) uses for tokens; 'http-token-auth'
    • Workday (wrongly) assumes that the server is using the Spring framework, and tries to load the correct auth-type bean based on that response
    • Spring framework barfs because there's no such bean

    I imagine there's some way to get Workday to play nicely with a standard REST API, and just supply the API key to the vendor's server as it expects, rather than trying to do a challenge/response.

    If this isn't it, there are some more weedy possibilities below.

    Odd Bean Name

    The bean name specified in the error is http-token-auth, which is in kebab-case. The convention for naming beans is (lower-) camelCase, so wherever that's specified may have just used the wrong casing.

    This could be in the Workday Studio configuration, the XML config file, or some custom code you've written, if any.

    Configuration

    If the bean name is correct, then there's likely some other configuration issue. Spring can implicitly detect candidate components by scanning the classpath (see Spring docs: Classpath scanning and managed components) or loading it from the project XML. The issue could be:

    • The build path is wrong (see this answer by esaj if you're unfamiliar)
    • The classpath is wrong, so Spring just doesn't see it. This seems like a Workday-specific config in this case.
    • The bean is in the project XML, but nested. In that case, it'd only be accessible to the enclosing bean. One solution to this is to activate the corresponding profile.
    • A packaging issue; if the bean isn't being included in the resulting deployed jar, then there will be issues. This solution by dawrutowicz should apply in a number of cases.
    • Project configuration; all the settings in your screenshots look exactly correct and should work fine, so there might be something hidden in your project settings

    Bug in Workday Studio

    This seems somewhat less likely, but is always a possibility. If you haven't written any Java code whatsoever, then there's something either in the Workday code that's serving up this unexpected 'http-token-auth' or inappropriately accepting it from somewhere else and trying to load up a bean using it.

    Final Thoughts

    Since you're trying to work with a vendor's API, I'd strongly recommend you try to collaborate with one of the engineers there. Guaranteed, they have at least one engineer who has dealt with complicated integration issues before. They'll have more details about their API, and might be able to give you more direct input on any configuration/code you'd be able to share.