Zum Hauptinhalt gehen

Pass an operation to a WSDL in xml

Kommentare

2 Kommentare

  • Permanently deleted user

    Hi Dan,

    I did something similiar using a C# script based on an example I found in the forum. Here's a link:

    (https://support.geocortex.com/essentialsGSCForum?sub-nav=forum&main-nav=essentials&feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=90660000000092QAAQ) "How to set Content-Type in a webrequest"  

    You basically have to build your request payload as a string and use the C# WebClient to post.

    I pass values from the selected feature in as arguments using "RunWorkflowWithArguments" (in this case a "gisid"). The activity paramaters I have set are:

    • url (this is a string that contains the service endpoint)
    • gisId (this is a string to hold the argument value of the identified feature)
    • response (this is a byte-array to store the response from the web service call)     

    Here is the C# script activity from my workflow:

        using(WebClient client = new WebClient())

     

        {

     

        byte[] soapMsg = System.Text.Encoding.Default.GetBytes("<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><GetRecords><gisid>" + gisId + "</gisid></GetRecords></s:Body></s:Envelope>");

     

        client.Headers[HttpRequestHeader.ContentType] = "text/xml; charset=utf-8";

     

        client.Headers.Add("SOAPAction", "urn:Service/GetRecords");

     

        response = client.UploadData(url, "POST", soapMsg);

     

        }

    Hope this helps!

     

    0
  • Permanently deleted user

    Thanks David!

    I'll give this a try and post my results.

    Dan

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.