Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web services 配置Glassfish 3.1.2服务器以允许放置、删除_Web Services_Configuration_Glassfish 3_Restful Authentication - Fatal编程技术网

Web services 配置Glassfish 3.1.2服务器以允许放置、删除

Web services 配置Glassfish 3.1.2服务器以允许放置、删除,web-services,configuration,glassfish-3,restful-authentication,Web Services,Configuration,Glassfish 3,Restful Authentication,我在配置Glassfish 3.1.2服务器以允许对使用Netbeans“从数据库创建新的RESTful Web服务”向导创建的RESTful Web服务的PUT、DELETE请求时遇到问题。奇怪的是,我设法让一个Web服务正常工作,而其他Web服务则无法正常工作。有人能解释一下我在哪里/如何配置它吗 HTTP/1.1 405 Method Not Allowed X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Ed

我在配置Glassfish 3.1.2服务器以允许对使用Netbeans“从数据库创建新的RESTful Web服务”向导创建的RESTful Web服务的PUT、DELETE请求时遇到问题。奇怪的是,我设法让一个Web服务正常工作,而其他Web服务则无法正常工作。有人能解释一下我在哪里/如何配置它吗

HTTP/1.1 405 Method Not Allowed
X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.2.2 Java/Oracle Corporation/1.7)
Server: GlassFish Server Open Source Edition 3.1.2.2
Allow: GET,DELETE,OPTIONS,HEAD
Content-Type: text/html
Content-Length: 1153
Date: Tue, 05 Feb 2013 18:35:05 GMT
工作的请求标头如下所示:

Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Connection:keep-alive
Content-Length:133
Content-Type:application/json
Cookie:JSESSIONID=b8ec1fb7ae9de4b5536363f4041d; JSESSIONID=b80bb2fbf45363cfe1b61b625890; treeForm_tree-hi=treeForm:tree:configurations:server-config:networkConfig:networkListeners:http-listener-2
Host:localhost:8080
Origin:http://localhost:8080
Referer:http://localhost:8080/mtpStories/faces/index.jsp
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko)    Chrome/24.0.1312.57 Safari/537.17
X-Requested-With:XMLHttpRequest
这是失败的请求(另一个Web服务):


查看您的web.xml。有任何定义吗?e、 g

   <security-constraint>
        ...
        <web-resource-collection>
            <web-resource-name>test</web-resource-name>
            <description/>
            <url-pattern>/mtpStories/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>DELETE</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>HEAD</http-method>
        </web-resource-collection>
        ....
   </security-constraint>

...
测试
/地铁站/*
得到
删除
选择权
头
....

我删除了所有安全约束,即使我将其作为http方法添加,PUT也不起作用。您是否定义了任何可能修改http头的筛选器?
   <security-constraint>
        ...
        <web-resource-collection>
            <web-resource-name>test</web-resource-name>
            <description/>
            <url-pattern>/mtpStories/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>DELETE</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>HEAD</http-method>
        </web-resource-collection>
        ....
   </security-constraint>