JAVA写的WEBSERVICE(是别人的),我用.NET程序访问WS出错。错误如下:
HTTP/1.1 501 Method POST is not defined in RFC 2068 and is not supported by the Servlet API
X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)
Content-Type: text/html;charset=utf-8
Content-Length: 1868
Date: Thu, 17 Jun 2010 07:59:18 GMT
Server: Apache-Coyote/1.1
Connection: close
不知道哪位兄弟遇到过没有,非常感谢!
HTTP/1.1 501 Method POST is not defined in RFC 2068 and is not supported by the Servlet API
X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)
Content-Type: text/html;charset=utf-8
Content-Length: 1868
Date: Thu, 17 Jun 2010 07:59:18 GMT
Server: Apache-Coyote/1.1
Connection: close
不知道哪位兄弟遇到过没有,非常感谢!
另外:我是写的一个SOCKET程序去访问的WS,直接发送的一个字符串,如下:string soap4= @"<?xml version=""1.0"" encoding=""utf-8""?>
<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""
xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/""
xmlns:tns=""http://192.168.0.169:8080/testWS/services/HelloServices""
xmlns:types=""http://192.168.0.169:8080/testWS/services/HelloServices/encodedTypes""
xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<soap:Body soap:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"">
<q1:sayHelloToPerson xmlns:q1=""http://webservice.sinosoft.com"">
<name xsi:type=""xsd:string"">test</name>
</q1:sayHelloToPerson>
</soap:Body>
</soap:Envelope>";
string httpHeader4 = @"POST /testWS/services/HelloServices HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3603)
Content-Type: text/xml; charset=utf-8
SOAPAction: """"
Host: 192.168.0.169:8080
Content-Length: " + soap4.Length + @"
Expect: 100-continue
Connection: Keep-Alive";
在本机上测试都是可以访问到WS的,但是实际环境中,需要过一个网闸,那样的话就返回上面的错误了。
后面我用抓包工具看了一下,WS的机子收到的数据中,实际环境中,只要过了网闸,那么就把里面的回车符换成了"..",也就是换成了两个点,不知道是怎么回事,有没有哪位大侠遇到过!
而不过网闸的情况(这种情况可以访问到WS),接收到的数据包并没有显示十六进制,不知道是怎么回事!
或者有没有办法将这个空格在WS处理接收到数据之前删除掉!!