1 Reply Latest reply on Oct 28, 2015 8:48 PM by nickorr

    Help with BaseElements plugin and POST request

    ibrahim_bittar

      Hi All

       

      I have this POST request:

       

      POST https://pruebascfdi.smartweb.com.mx/Account/wsAccount.svc HTTP/1.1

      Accept-Encoding: gzip,deflate

      Content-Type: text/xml;charset=UTF-8

      SOAPAction: "http://tempuri.org/IwsAccount/GetUserById"

      token:  "T2lYQ0t4L0RHVkR4d.......HZ5Nkk1VHNEakZ3" (shortened on purpose)

      Content-Length: 216

      Host: pruebascfdi.smartweb.com.mx

      Connection: Keep-Alive

      User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

       

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">

        <soapenv:Header/>

        <soapenv:Body>

            <tem:GetUserById/>

        </soapenv:Body>

      </soapenv:Envelope>

       

      And I made this script using the BaseElements plugin:

       

      Set Variable [ $Header; Value:BE_HTTP_Set_Custom_Header ( "Accept-Encoding" ; "gzip,deflate" ) ]
      Set Variable [ $Header; Value:BE_HTTP_Set_Custom_Header ( "Content-Type" ; "text/xml;charset=UTF-8" ) ]
      Set Variable [ $Header; Value:BE_HTTP_Set_Custom_Header ( "SOAPAction" ; "http://tempuri.org/IwsAccount/GetUserById" ) ]
      Set Variable [ $Header; Value:BE_HTTP_Set_Custom_Header ( "token" ; "T2lYQ0t4L0RHVkR4d.......HZ5Nkk1VHNEakZ3"
      Set Field [ Test::TheText; BE_HTTP_POST ( "https://pruebascfdi.smartweb.com.mx/Account/wsAccount.svc" ; "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tem=\"http://tempuri.org/\"><soapenv:Header/><soapenv: Body><tem:GetUserById/></soapenv:Body></soapenv:Envelope>" ) ]

      But I'm not getting any result.

      Can somebody tell me what I'm doing wrong?

      Regards

      Ibrahim