When I turn on: :debug true :debug-body true
I get all that follows. Which mostly looks right, I guess. But why don't I see the headers in Charles? I'll go back to assuming this is a problem with Omniture, but I would be grateful if anyone could glance over this output and tell me if anything looks amiss. I took out the username and password but otherwise left in all the details. {:scheme :https, :http-url "https://api2.omniture.com/admin/1.3/rest/? method=Report.QueueOvertime", :conn-timeout 4000, :debug-body true, :request-method :post, :query-string "method=Report.QueueOvertime", :content-type :json, :uri "/admin/1.3/rest/", :server-name "api2.omniture.com", :headers {"accept-encoding" "gzip, deflate", "accept" "application/json", "content-type" "application/json", "x-api-version" "2", "x-wsse" "UsernameToken Username=\"xxx\", PasswordDigest=\"xxx\", Nonce= \"Y2FiOGM3YjAxY2QyY2YwMTdmZTY2YTIzNzNjNzU2OWI=\", Created= \"2013-02-23T16:40:14Z"}, :socket-timeout 4000, :debug true, :body-type org.apache.http.entity.StringEntity, :server-port nil, :character-encoding "UTF-8", :client-params {"http.useragent" "clj-http", "http.protocol.allow-circular-redirects" false}, :body "{\"reportDescription\" : { \"reportSuiteID\" : \"timeoutny\", \"dateFrom\" : \"2013-02-01\", \"dateTo\" : \"2013-02-12\", \"dateGranularity\" : \"hourly\", \"metrics\" : [ { \"id\" : \"pageViews\" }, { \"id\" : \"visits\" } ], \"validate\":\"true\" } }", :user-info nil} HttpRequest: {:requestLine #<BasicRequestLine POST https://api2.omniture.com/admin/1.3/rest/?method=Report.QueueOvertime HTTP/1.1>, :protocolVersion #<HttpVersion HTTP/1.1>, :params #<BasicHttpParams org.apache.http.params.BasicHttpParams@47b0081>, :method "POST", :entity #<StringEntity org.apache.http.entity.StringEntity@117eb1bd>, :class org.apache.http.client.methods.HttpPost, :allHeaders [#<BasicHeader Connection: close>, #<BasicHeader accept-encoding: gzip, deflate>, #<BasicHeader accept: application/json>, #<BasicHeader content-type: application/json>, #<BasicHeader x-api-version: 2>, #<BasicHeader x-wsse: UsernameToken Username="xxx", PasswordDigest="xxx", Nonce="Y2FiOGM3YjAxY2QyY2YwMTdmZTY2YTIzNzNjNzU2OWI=", Created="2013-02-23T16:40:14Z>], :aborted false, :URI #<URI https://api2.omniture.com/admin/1.3/rest/?method=Report.QueueOvertime>} Sadly, Omniture doesn't offer any support service, so I am not able to contact them directly and get any help from them. (They have support contracts that cost many thousands of dollars, but my company would not be interested in that kind of expense.) {:trace-redirects ["https://api2.omniture.com/admin/1.3/rest/? method=Report.QueueOvertime"], :request-time 1064, :status 401, :headers {"date" "Sat, 23 Feb 2013 21:40:15 GMT", "server" "Omniture AWS/2.0.0", "www-authenticate" "WSSE realm=\"Omniture REST Api\", profile=\"UsernameToken\"", "xserver" "www336", "content-length" "46", "content-type" "application/json", "connection" "close"}, :body "{\"error\":\"Unable to validate authentication.\"}"} nil Request: org.apache.http.entity.StringEntity On Feb 23, 4:18 pm, larry google groups <lawrencecloj...@gmail.com> wrote: > This might be a dumb "How does the Internet work" kind of question. > > I have been asked to pull data from Omniture, using the Omniture API. > I thought this would take me an hour, but I've been working on this > for 3 days now. I keep getting authentication errors. > > I became curious about exactly what code was sending to Omniture, so I > downloaded Charles, the network debugging tool: > > http://www.charlesproxy.com/ > > I am using clj-http to make the POST. The post is suppose to be > https. > > This is the thing that surprises me: If I use http then I can see all > the headers in Charles, and they all look correct. But if I use https > (which is what I need to use) then there are no headers that I can see > in Charles. > > Is that because Charles does not want to show me a bunch of encrypted > garbage? Or is clj-http not adding in the headers with https? Maybe I > need a special setting to get clj-http to correctly send to https? (I > have not been able to find any such setting.) > > This is the code where I use clj-http (here I call http-client): > > (defn omniture-call-api [url-with-queue-method api-payload headers] > (timbre/spy :debug " return value of omniture-call-api " > (try+ > (http-client/post url-with-queue-method > {:body api-payload > :headers {"X-Api-Version" "2" > "X-WSSE" headers} > :content-type :json > :socket-timeout 4000 > :conn-timeout 4000 > :accept :json > :client-params > {"http.protocol.allow-circular-redirects" false > "http.useragent" > "clj-http"}}) > (catch Object o (println (pp/pprint o)))))) > > The url is: > > https://api2.omniture.com/admin/1.3/rest/?method=Report.QueueRanked > > At first I assumed this was a problem with Omniture's code. I have > asked several question on the Developer forum at Omniture, but no one > there could help me (Adobe has apparently cut most of the developer > support since Adobe bought Omniture in 2009). However, I am now > wondering if maybe I am doing this POST incorrectly. > > I am puzzled by something else as well: I call this function once, yet > Charles shows 4 calls being made to Omniture, and my own code, when it > prints data to the terminal, seems to show many requests being made. > Why would that be? > > Again, if I change the URL so it uses "http" then in Charles I can see > all the headers that suppose to be in this line of code: > > "X-WSSE" headers > > and the headers look correct (I posted them to the developer forums at > Omniture and the one guy from Omniture who gave it a look felt there > was nothing terribly amiss -- but he couldn't rule anything out.) > > But If I change the URL to use https, then I see no headers in > Charles. Why is that? > > ---- lawrence -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.