Web Services :: WebDav HTTP Extensions And REST
Nov 26, 2014
Are the WebDAV extensions related to REST principles? What I mean by that is, REST is an abstraction of the WWW architecture and the WebDAV is just an extension to the HTTP. So can we say that when I speak in terms of REST API's, I can restrict myself to HTTP and not HTTP extensions like WebDAV?
View Replies
ADVERTISEMENT
Mar 26, 2015
how to implement the Rest API which is like "URL...". And how to implement in Java where the class extends ServerResource.
View Replies
View Related
Jan 20, 2015
"citizen":{"name":"John", "gender":"M","age":32}
Now, I only want to change age to 35, which method should I use and how should the payload/URL look like to be RESTful?
View Replies
View Related
Mar 19, 2015
URL....my file name can contain special characters but when I passing this file name as a parameter in URL using REST.I am getting exception.
View Replies
View Related
Mar 22, 2015
I hope this is the right forum. My question is about REST interceptors. I've got the code:
package edu.psu.swe.fortress.poc.interceptor;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.util.Nonbinding;
import javax.ws.rs.NameBinding;
[Code]...
The output from the debug show that permissions values inside of the ResourceImpl contains the values I'd expect (foo,bar), but inside the interceptor, they're missing. Is there a way to get the arguments in ResourceImpl to pass through to the interceptor?
Log output looks like:
15:59:55,223 INFO [stdout] (default task-9) @edu.psu.swe.fortress.poc.interceptor.FortressProtected(permissions=[])
15:59:55,229 INFO [stdout] (default task-9) @edu.psu.swe.fortress.poc.interceptor.FortressProtected(permissions=[foo, bar])
View Replies
View Related
Mar 23, 2015
I want to write one REST client program for POST request ,request and response is in JSON Format.
public String getAck() {
HttpURLConnection httpConnection = null;
URL url=null;
try {
url = new URL("http://test:8080/ils/main");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
[Code]....
Line OutputStream os = httpConnection.getOutputStream();
I am getting connection time out problem
View Replies
View Related
Feb 23, 2015
In SOAPUI, how can I add a new property in a HTTP Test Request? I konw that this there isn´t, but should be somethink like that:
testRunner.testCase.getTestStepByName("myHttpTestRequest").addProperty("newProperty","newValue");
View Replies
View Related
Apr 6, 2015
I am trying to generate this request with my Java program, but I just can't seem to figure it out: curl -v -H "Authorization:Basic MY_AUTH_CODE" -H "Accept:application/xml" -H "app_id:MY_APP_ID" -H "app_key:MY_APP_KEY" -X GET "THIRD_PARTY_URL"
I tried to generate a query string, but I keep getting 403 errors. I also tried to input my parameters using URLConnection.getRequestProperty("name", "value"), but that didn't work either.
View Replies
View Related
Dec 17, 2014
I have 2 war in 1 EAR.
War A corresponds to UI
War B corresponds to Rest
1) From War A, I login to the application and then fetch some users that is a rest call. I get the response back from rest in json form that ui consumes and display the data on page.
2) Now I click on the logout link from ui jsp. This logs out the session from Ui. I use <form data-dojo-type="dijit/form/Form" based logout.
3) I then go to the proxy (using burp) and manually request the rest call which I made in step no 1), the rest gives the response back with the same json object returned in step no 1) This shows that the logout action on step 2) is invalidated the session from War A (ui war) but the session or cookie based from WAR B (rest war) is not invalidated.
Expected outcome:After I Logout from War A(ui war), the session must also get invalidated from war B (rest war) and manually request from proxy should not get the same response object as received in step 1)
View Replies
View Related
May 5, 2014
The JSP page is opening but the problem is if l click on the ADD or EDIT button l receive the 405 error Iam using MySQL and glassfish server
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
[Code].....
View Replies
View Related
Oct 4, 2014
I am working with jsoup right now and I am trying to get a range of file extensions such as doc, docx, txt, pdf, and so on. Anyways i have looked through the jsoup api and cant seem to find what I am looking for. The closest thing I have found is
Elements files = doc.select("a[href$=.doc]");
This should work but only grabs one extension. How to grab multiple at one time? My guess would be:
Elements files = doc.select("a[href$=.doc]").select("a[href$=.docx]").select("a[href$=.txt]");
However I'm not sure for certain. Anyways I will provide a link for the api .....
View Replies
View Related
Jul 28, 2014
i have a folder which contains two types of files (for eg: .csv and .tiff) with same names like, abc.csv and abc.tiff.How to compare the list of files with same names while ignoring their extensions.And my second task is to copy the content from csv file and i have to use that name as file name of .tiff file(Ex: if i have a1 as content in csv file, i have to change .tiff file name from abc.tiff to a1.tiff)
View Replies
View Related
Dec 2, 2014
But while searching i came across 2 different implementation.. One is this and other is this , where httpget is used..
So are these same ? When we talk about Restful, is the 2nd implementation valid ?
View Replies
View Related
Aug 7, 2014
How can i count using JsonPath? See this json -
[
{
"total": 4414,
"userName": "Tom",
},
{
"total": 6608,
"userName": "Jerry",
},
{
"total": 5,
"userName": "Tom",
}
]
I want to count userName "Tom" so the answer will be 2 and counting "Jerry" will produce 1
Running the following says i have the value inside but how much of it.
assertThat(jsonPath.getList("userName", String.class), hasItem("Tom"));
Running this says the size of the list but the list may contain other values than "Tom", Like "Jerry"
assertThat(jsonPath.getInt("size()"), equalTo(3));
is this can be answered within JsonPath or i must use FOR, LOOPS, else ?
View Replies
View Related
Feb 12, 2014
I am trying to learn Java and while i was playing a bit with the basic knowledge that i have i encountered a problem. When i run the program, the lines and the picture appear in two separate windows when i compile the program. how can i make them appear in the same? The code is this:
public class Game
{
private int x;
private Picture pic;
[Code].....
View Replies
View Related
Apr 11, 2014
Generally Socket Programming uses HTTP Protocol to send and receive messages in Java. Can we try to exchange HTTP/HTTPS requests instead of TCP?
a Socket constructs a HTTP request to send to another socket from information it has and sends to another one and Server responds with HTTPResponse.
View Replies
View Related
Mar 9, 2014
i am using netbeans6.7.1 version i implemented one program i.e web application ..when am excuting this one i got one error http status 500...
this is the code:
SumServlet.java
package com.sum;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
[code]....
View Replies
View Related
May 10, 2014
i have one html page through which i want to go to servlet page but after submit it give the http 404 error.
i am using tomcat apache server.
View Replies
View Related
Oct 13, 2014
my project is all about downloading files(text files, music files, etc) from a LINUX server using UI build in java, my mentor told me to use HTTP Client (Java apache), but how to start this.
Here's a sample scenario:
ScreenHunter_1.jpg
Consider the directory structure above.
First, how to connect with this LINUX server using JAVA.
ScreenHunter_2.jpg
and how to dowload the above file.
View Replies
View Related
Mar 9, 2014
correct this error
WishSrv.java
package com.wish;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Calendar;
import javax.servlet.ServletException;
[code]...
View Replies
View Related
Jul 6, 2014
I am trying to write to an http server, but nothing happens. I can read from the file, I just cannot write to it and no errors are thrown. I do not know how to proceed.
Specifically, I have a text file on my server, and I can read from it (the text file already has content), but I cannot write to it. And, no exceptions are thrown.
url = new URL("http://kajl-ig.com/txt.txt");
urlConn = url.openConnection();
urlConn.setDoInput(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(urlConn.getOutputStream()));
String s = "TEST Successfull!";
[code].....
The second code, I got from some random website, and I was desperate so I tried it. I am not sure what the
urlConn.setRequestProperty (String, String);
method does, so I removed it and it reads fine it just cannot write.
View Replies
View Related
Oct 27, 2011
in my web.xml I declared a resource under the block
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
This resource is about a login page.But when I logout or when I visit some pages like Contacts or Home Page, I wouldn't use HTTPS protocol.At the moment, HTTPS remain in the url even if I declared this protocol only for that resource..This is my (little) web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
[code]....
View Replies
View Related
Feb 20, 2014
I am trying to use hidden variable in project.When I launch my project i am able to get the welcome page.But when submit login values i am getting HTTP 404 error- Resource not found error.
`My home Page/Login Page
<body>
<form action="<%=request.getContextPath() %>/LoginServlet" method="get">
USERNAME<input type="text" name="uname"><br>
PASSWORD<input type="password" name="pass"><br>
<input type="submit" name="submit" value="submit">
My LoginServlet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("sandeep");
PrintWriter out=response.getWriter();
String userName=request.getParameter("uname");
[code].....
View Replies
View Related
Mar 8, 2015
below is my code and this exception was thrown in another page so I created a new page and only imported just a single package still its throwing an exception? Any reasons why?
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@page import="java.sql.*;" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
View Replies
View Related
Aug 28, 2014
So I have a screen I click on. The "webPage" comes back as the requested resource unavailable.
What I don't get is that when I run the server locally on my machine it works just fine. But when this is deployed out to server I get the error. The screen comes up but the data doesn't show up. Where should I look to troubleshoot this?
@RequestMapping(value = "/webPage_data", method = RequestMethod.GET)
public @ResponseBody
DataTableDto pastControllerDataFeed(Model model) {
View Replies
View Related
Mar 3, 2015
Now, I would like to properly stop the server. For that, I can do server.stop(); . However, this does not work since the object server is not public, it is contained within the public pc_proxy class.How do I do that?
Java Code: import java.net.*;
import java.io.*;
import com.sun.net.httpserver.*;
import java.util.concurrent.Executors;
import java.lang.reflect.Array;
[code]....
View Replies
View Related