2014-09-09 4 views
0

스텁 파일을 생성했으며이 요청에 대한 클라이언트를 준비하려고합니다 ... webservice는 실제로 파일을 첨부 파일로 가져옵니다. 어떻게 클라이언트를 구현할 수 있습니까? 파일을 요청에 첨부합니다.SOAP webservice 파일 업로드

package services.attachment.v1; 

import java.net.MalformedURLException; 
import java.net.URL; 
import javax.xml.namespace.QName; 
import javax.xml.ws.Service; 
import javax.xml.ws.WebEndpoint; 
import javax.xml.ws.WebServiceClient; 
import javax.xml.ws.WebServiceException; 
import javax.xml.ws.WebServiceFeature; 


/** 
* This class was generated by the JAX-WS RI. 
* JAX-WS RI 2.2.9-b130926.1035 
* Generated source version: 2.2 
* 
*/ 
@WebServiceClient(name = "FileAttachmentService_vs0_ext", targetNamespace = "http://t.com/services/Attachment/v1.0", wsdlLocation = "https://sso-test.t.com/soatest/FileAttachmentService?wsdl") 
public class FileAttachmentServiceVs0Ext 
    extends Service 
{ 

    private final static URL FILEATTACHMENTSERVICEVS0EXT_WSDL_LOCATION; 
    private final static WebServiceException FILEATTACHMENTSERVICEVS0EXT_EXCEPTION; 
    private final static QName FILEATTACHMENTSERVICEVS0EXT_QNAME = new QName("http://t.com/services/Attachment/v1.0", "FileAttachmentService_vs0_ext"); 

    static { 
     URL url = null; 
     WebServiceException e = null; 
     try { 
      url = new URL("https://sso-test.t.com/soatest/FileAttachmentService?wsdl"); 
     } catch (MalformedURLException ex) { 
      e = new WebServiceException(ex); 
     } 
     FILEATTACHMENTSERVICEVS0EXT_WSDL_LOCATION = url; 
     FILEATTACHMENTSERVICEVS0EXT_EXCEPTION = e; 
    } 

    public FileAttachmentServiceVs0Ext() { 
     super(__getWsdlLocation(), FILEATTACHMENTSERVICEVS0EXT_QNAME); 
    } 

    public FileAttachmentServiceVs0Ext(WebServiceFeature... features) { 
     super(__getWsdlLocation(), FILEATTACHMENTSERVICEVS0EXT_QNAME, features); 
    } 

    public FileAttachmentServiceVs0Ext(URL wsdlLocation) { 
     super(wsdlLocation, FILEATTACHMENTSERVICEVS0EXT_QNAME); 
    } 

    public FileAttachmentServiceVs0Ext(URL wsdlLocation, WebServiceFeature... features) { 
     super(wsdlLocation, FILEATTACHMENTSERVICEVS0EXT_QNAME, features); 
    } 

    public FileAttachmentServiceVs0Ext(URL wsdlLocation, QName serviceName) { 
     super(wsdlLocation, serviceName); 
    } 

    public FileAttachmentServiceVs0Ext(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { 
     super(wsdlLocation, serviceName, features); 
    } 

    /** 
    * 
    * @return 
    *  returns AttachmentWS 
    */ 
    @WebEndpoint(name = "FileAttachmentService_vs0_ext_port") 
    public AttachmentWS getFileAttachmentServiceVs0ExtPort() { 
     return super.getPort(new QName("http://t.com/services/Attachment/v1.0", "FileAttachmentService_vs0_ext_port"), AttachmentWS.class); 
    } 

    /** 
    * 
    * @param features 
    *  A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. 
    * @return 
    *  returns AttachmentWS 
    */ 
    @WebEndpoint(name = "FileAttachmentService_vs0_ext_port") 
    public AttachmentWS getFileAttachmentServiceVs0ExtPort(WebServiceFeature... features) { 
     return super.getPort(new QName("http://t.com/services/Attachment/v1.0", "FileAttachmentService_vs0_ext_port"), AttachmentWS.class, features); 
    } 

    private static URL __getWsdlLocation() { 
     if (FILEATTACHMENTSERVICEVS0EXT_EXCEPTION!= null) { 
      throw FILEATTACHMENTSERVICEVS0EXT_EXCEPTION; 
     } 
     return FILEATTACHMENTSERVICEVS0EXT_WSDL_LOCATION; 
    } 

} 

답변

0

웹 서비스를 사용하여 파일을 업로드하는 것은 바람직하지 않습니다. 웹 서비스는 기본적으로 원격 시스템에서 처리 할 작은 크기의 데이터를 전달하도록 설계되었습니다. 따라서 대용량 데이터의 경우 웹 서비스가 비참하게 실패하여 &이 클라이언트 측 예외로 이어질 수 있습니다. 잘 부탁드립니다

,

Bhavin 샤