问题如下:运行到int code = conn.getResponseCode()时;//得到的code是400 出现的错误是filenotfound 请问是什么原因啊
代码:
InputStream in = NumberService.class.getResourceAsStream("projectstatic.xml");  
        byte[] data = StreamUtil.load(in);  
        String content = new String(data);  
          
        // 创建连接对象, 设置请求头, 按照Webservice服务端提供的要求来设置   
        URL url = new URL("http://172.16.230.50/project/projectStatic.asmx");  
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();  
        conn.setConnectTimeout(1000000);  
        conn.setRequestProperty("Host", "172.16.230.50"); 
        //conn.setRequestProperty("Content-type", "application/x-java-serialized-object");
        conn.setRequestProperty("Content-Type", "application/soap+xml; charset=utf-8");  
        conn.setRequestProperty("Content-Length", content.getBytes().length + "");  
        conn.setRequestMethod("POST");  
        conn.setUseCaches(false);
        // 输出数据   
        conn.setDoOutput(true); 
        conn.setDoInput(true);
        //conn.connect();
        
        conn.getOutputStream().write(content.getBytes());  
        conn.getOutputStream().flush();
        conn.getOutputStream().close();          
//      // 获取服务端传回的数据, 解析XML, 得到结果   
        int code = conn.getResponseCode();//得到的code是400 出现的错误是filenotfound 
        if (conn.getResponseCode() == 200) 
        { 
         // 解析返回信息 
         InputStream tmpIn = conn.getInputStream();
            byte[] bs = new byte[tmpIn.available()];
            tmpIn.read(bs);
            tmpIn.close();
            String bsStr = new String(bs, "UTF-8");        }