chumendajiangyou opened a new issue, #4628:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4628

   ServiceComb版本:3.2.1
   gateWay:edge
   服务提供者:
   启动模式为WebApplicationType.NONE。
   现在发现的问题是:当我直接调用提供者服务时没有问题, 
如果先调用消费者服务,消费者服务再调用提供者的时候会出现不支持参数org.apache.servicecomb.swagger.invocation.converter.PartToMultipartFile.
   
   
   示例
   服务接口为:
   ```
   @RequestMapping(value = "/saveFile",method = RequestMethod.POST,consumes = 
MediaType.MULTIPART_FORM_DATA_VALUE)
       String saveFile(@RequestPart("fileType") int fileType,
                           @RequestPart("file") MultipartFile file)throws 
IOException;
   ```
   
   消费者配置类为:
   ```
   @Configuration
   public class FileEndpointClient {
       @Bean
       public IFileEndpoint fileEndpoint() {
           return Invoker.createProxy("files", "files", IFileEndpoint.class);
       }
   }
   
   ```
   消费者实现为:
   ```
   @Autowired
       private IFileEndpoint fileEndpoint;
   
   方法中直接调用和使用RestOperations调用均无法抛异常。
   直接调用:
   fileEndpoint.saveFile(fileType, file);
   RestOperations调用:
     RestOperations restOperation = RestTemplateBuilder.create();
     HttpHeaders headers = new HttpHeaders();
     headers.setContentType(MediaType.MULTIPART_FORM_DATA);
     HttpEntity<Map<String, Object>> entity = new HttpEntity<>(upLoadMap, 
headers);
     String reseult = restOperation.postForObject(url,entity, String.class);
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to