Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleSentaks
linenumberstrue
<JsonInvoke Url="" InvokeType="Post" RequestNode="/*/Request" ResponseNode="/*/Response" ClearInto="False">
      <Headers />
</JsonInvoke>

Özellikler


Adı
Açıklama

UrlRequest yapılacak remote web servis adresidir.

ResponseNodeResponse olarak dönen objenin yazılacağı node adresidir. XPath alır.

InvokeType

Request yapılırkan hangi http method kullanılacağını belirler. "Get" veya "Post" olabilir.

Veri alınması durumunda "Get", Veri gönderilmesi durumunda "Post" kullanılmalıdır.


ClearInto

Var olan verinin silinip silinmeyeceği konusunda


HeadersSOAP Header bilgisini geçmek için kullanılabilir, opsiyoneldir.

RequestNode

Request yapılacak objenin tanımlı olduğu node adresi veya string içeriğidir. XPath alır.


Değer
Açıklama

ValueCDATA  content veya Node adresi olabilir.




IsMultipart

Eğer multipart formdata kullanılacaksa bu attribute değerinin True olması gerekir.


Formdatas

Formdata eklemek için bu alan kullanılır

Örnek (Get Metodu)

JsonInvoke taskına verilen Url üst satırda SetVariable ile $(JsonUrl) değişkenine atanıyor. Geri dönecek olan yanıt Json/Response node 'u içerisine aktarılmaktadır.

...

Info
titleSisteme dahil olmayan ITASK için Dll üzerinden çağırma

<Using Name="JsonInvoke" Type="EBI.ExtraFunctions.JsonInvoke,EBI.ExtraFunctions" />


Multipart-formdata kullanımı

Code Block
languagexml
linenumberstrue
  <SetVariable Name="$(JsonUrl)">
    <Value Culture="" Target="None">eval::/*/Baslatan/JsonUrl</Value>
  </SetVariable>
  <JsonInvoke Url="$(JsonUrl)" InvokeType="Get" RequestNode="Json/Request" ResponseNode="Json/Response" ClearInto="True" IsMultipart="True" IsHeadersEncoded="False" IsSerialize="False" Timeout="120" ContentType="application/json" Accept="application/json" IsResultJson="True">
    <Headers />
    <FormDatas>
        <FormData Name="File" Type="File">$(GetFileContent)</FormData>
        <FormData Name="Name" Type="Text">Test</FormData>
    </FormDatas>
  </JsonInvoke>


Ek Örnekler

Code Block
languagexml
titleForm Üzerinden login servisini çağırarak kullanıcının ad ve şifre bilgisinin doğru olup olmadığı kontrolü için kullanılır. Result node'u içerisinde token bilgisi var ise bilgiler ile login olunabiliyor demektir. Form üzerindeki bilgiyi görmesi için tekrar kullanıcı adı ve şifre girilmesi için kullanılabilir.
linenumberstrue
  <If>
    <Then>
      <Condition>
        <And>
          <Not>
            <IsEmpty>
              <Evaluate Target="None" Culture=""><![CDATA[Login/UserName]]></Evaluate>
            </IsEmpty>
          </Not>
          <Not>
            <IsEmpty>
              <Evaluate Target="None" Culture=""><![CDATA[Login/Password]]></Evaluate>
            </IsEmpty>
          </Not>
        </And>
      </Condition>
      <Perform>
        <Try>
          <Tasks>
            <SetVariable Name="$(UserName)">
              <Evaluate Target="None" Culture=""><![CDATA[Login/UserName]]></Evaluate>
            </SetVariable>
            <SetVariable Name="$(Password)">
              <Evaluate Target="None" Culture=""><![CDATA[Login/Password]]></Evaluate>
            </SetVariable>
            <JsonInvoke Url="http://ebiflow3/json.aspx?otype=token" InvokeType="Post" RequestNode="API/Request" ResponseNode="API/Result" ClearInto="False" IsHeadersEncoded="False" IsSerialize="True" Timeout="100" ContentType="application/json" Accept="application/json" IsResultJson="True">
              <Headers>
                <Header Key="EBIFLOWUSERNAME">$(UserName)</Header>
                <Header Key="EBIFLOWUSERPASSWORD">$(UserName)</Header>
              </Headers>
            </JsonInvoke>
          </Tasks>
          <Catch />
          <Finally />
        </Try>
      </Perform>
    </Then>
  </If>

...