簡體   English   中英

SOAP Web服務上傳文件

[英]SOAP webservice upload a file

我已經生成了一個存根文件,並嘗試為該請求准備客戶端... Web服務實際上將文件作為附件。 將文件附加到請求。

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;
    }

}

不建議使用Web服務上載文件。 Web服務的基本目的是將小型數據傳遞給遠程計算機進行處理。 因此,在大數據的情況下,您的Web服務可能會慘敗並導致客戶端異常。

感謝您,

Bhavin Shah

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM