示例#1
0
        public static MetadataApiClientResponse getMetadataClient(string userId, string sessionId, string ServerUrl)
        {
            BasicHttpBinding binding = new BasicHttpBinding {
                Name = "metadata"
            };

            binding.Security.Mode          = BasicHttpSecurityMode.Transport;
            binding.MaxReceivedMessageSize = 500000000;

            EndpointAddress endpoint      = new EndpointAddress(ServerUrl);
            SessionHeader   sessionHeader = new SessionHeader {
                sessionId = sessionId
            };
            CallOptions callOptions = new CallOptions {
                client = userId
            };

            MetadataApiClient mdclient = new MetadataApiClient();

            mdclient.Client        = new MetadataPortTypeClient(binding, endpoint);
            mdclient.SessionHeader = sessionHeader;
            mdclient.CallOptions   = callOptions;

            return(new MetadataApiClientResponse {
                Metadataclient = mdclient
            });
        }
示例#2
0
        static async Task <checkRetrieveStatusResponse> run(MetadataApiClient metadataClient, String asyncResultId)
        {
            var client        = metadataClient.Client;
            var sessionHeader = metadataClient.SessionHeader;
            var callOptions   = metadataClient.CallOptions;
            checkRetrieveStatusResponse result = await client.checkRetrieveStatusAsync(sessionHeader, callOptions, asyncResultId, true);

            response = result;
            return(result);
        }
        static async Task <String> run(MetadataApiClient metadataClient, Package package)
        {
            var             client        = metadataClient.Client;
            var             sessionHeader = metadataClient.SessionHeader;
            var             callOptions   = metadataClient.CallOptions;
            RetrieveRequest request       = new RetrieveRequest();

            request.unpackaged = package;
            retrieveResponse resultResponse = await client.retrieveAsync(sessionHeader, callOptions, request);

            asyncId = resultResponse.result.id;
            return(resultResponse.result.id);
        }
        static async Task <SFDC.Metadata.listMetadataResponse> run(MetadataApiClient metadataClient, String strType)
        {
            var client        = metadataClient.Client;
            var sessionHeader = metadataClient.SessionHeader;
            var callOptions   = metadataClient.CallOptions;
            listMetadataResponse lstMetaResponse = new listMetadataResponse();
            ListMetadataQuery    q = new ListMetadataQuery();

            q.type = strType;

            response = await client.listMetadataAsync(sessionHeader, callOptions, new [] { q }, 47);

            return(lstMetaResponse);
        }
        static async Task <String> run(MetadataApiClient metadataClient, MetadataApiDeployRequest request)
        {
            var client        = metadataClient.Client;
            var sessionHeader = metadataClient.SessionHeader;
            var callOptions   = metadataClient.CallOptions;

            var debuggingHeader = request.DebuggingHeader;
            var zipFile         = request.ZipFile;
            var DeployOptions   = request.DeployOptions;

            deployResponse resultResponse = await client.deployAsync(sessionHeader, debuggingHeader, callOptions, zipFile, DeployOptions);

            asyncId = resultResponse.result.id;
            return(resultResponse.result.id);
        }
 public static String deploy(MetadataApiClient metadataClient, MetadataApiDeployRequest request)
 {
     run(metadataClient, request).Wait();
     return(asyncId);
 }
示例#7
0
 public static checkRetrieveStatusResponse checkRetrieveStatus(MetadataApiClient metadataClient, String asyncResultId)
 {
     run(metadataClient, asyncResultId).Wait();
     return(response);
 }
 public static String retrieve(MetadataApiClient metadataClient, Package package)
 {
     run(metadataClient, package).Wait();
     return(asyncId);
 }
 public static listMetadataResponse listMetadata(MetadataApiClient metadataClient, String strType)
 {
     run(metadataClient, strType).Wait();
     return(response);
 }