3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $url = "https://ri.test.msb.se/RapportServiceWS.svc?wsdl"; $client = new SoapClient($url, array('soap_version' => SOAP_1_1, 'location' => 'https://ri.test.msb.se/RapportServiceWS.svc/basicHttpBinding', 'exceptions' => 1, 'trace' => 1 )); $headers = array(); function guid() { mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up. $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45); $uuid = 'uuid'.$hyphen .substr($charid, 0, 8).$hyphen .substr($charid, 8, 4).$hyphen .substr($charid,12, 4).$hyphen .substr($charid,16, 4).$hyphen .substr($charid,20,12).$hyphen.'1'; return $uuid; } function generate_header() { $WSSE_NS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; $WSSE_PFX = 'wsse'; $WSU_NS = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; $WSU_PFX = 'wsu'; $PASSWORD_TYPE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'; $username = 'TestProgram'; $password = 'jtKLGpaKZ9XqmA40QGo'; $currentTime = time(); $timestamp=gmdate('Y-m-d\TH:i:s', $currentTime).'Z'; $expiretimestamp=gmdate('Y-m-d\TH:i:s', $currentTime + 300).'Z'; $nonce=mt_rand(); $passdigest=base64_encode(pack('H*',sha1(pack('a*',$password)))); $header=' <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="'.$WSSE_NS.'" xmlns:wsu="'.$WSU_NS.'"> <wsu:Timestamp wsu:Id="_0"> <wsu:Created>'.$timestamp.'</wsu:Created> <wsu:Expires>'.$expiretimestamp.'</wsu:Expires> </wsu:Timestamp> <wsse:UsernameToken wsu:Id="'.guid().'"> <wsse:Username>'.$username.'</wsse:Username> <wsse:Password Type="'.$PASSWORD_TYPE.'">'.$password.'</wsse:Password>'. '</wsse:UsernameToken>'. '</wsse:Security>'; $headerSoapVar=new SoapVar($header,XSD_ANYXML); $soapheader=new SoapHeader($WSSE_NS, "Security" , $headerSoapVar , true); return $soapheader; } $headers[] = generate_header(); $client->__setSoapHeaders($headers); $params = array(); $pingresult = $client->Ping($params); echo $pingresult->PingResult; var_dump($pingresult); } catch (SoapFault $e) { echo($e->getMessage()); echo '<br><br>'; echo($e); } catch (Exception $err) { echo ($e->getMessage()); echo '<br><br>'; echo($err); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 32
Branch analysis from position: 32
2 jumps found. (Code = 107) Position 1 = 33, Position 2 = 39
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 39
2 jumps found. (Code = 107) Position 1 = 40, Position 2 = -2
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 39
Branch analysis from position: 39
filename:       /in/ggrkl
function name:  (null)
number of ops:  46
compiled vars:  !0 = $url, !1 = $client, !2 = $headers, !3 = $params, !4 = $pingresult, !5 = $e, !6 = $err
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fri.test.msb.se%2FRapportServiceWS.svc%3Fwsdl'
    6     1        NEW                                              $8      'SoapClient'
          2        SEND_VAR_EX                                              !0
    7     3        FETCH_CONSTANT                                   ~9      'SOAP_1_1'
          4        INIT_ARRAY                                       ~10     ~9, 'soap_version'
    8     5        ADD_ARRAY_ELEMENT                                ~10     'https%3A%2F%2Fri.test.msb.se%2FRapportServiceWS.svc%2FbasicHttpBinding', 'location'
    9     6        ADD_ARRAY_ELEMENT                                ~10     1, 'exceptions'
   10     7        ADD_ARRAY_ELEMENT                                ~10     1, 'trace'
          8        SEND_VAL_EX                                              ~10
    6     9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $8
   14    11        ASSIGN                                                   !2, <array>
   16    12        DECLARE_FUNCTION                                         'guid'
   30    13        DECLARE_FUNCTION                                         'generate_header'
   67    14        INIT_FCALL_BY_NAME                                       'generate_header'
         15        DO_FCALL                                      0  $15     
         16        ASSIGN_DIM                                               !2
         17        OP_DATA                                                  $15
   69    18        INIT_METHOD_CALL                                         !1, '__setSoapHeaders'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
   71    21        ASSIGN                                                   !3, <array>
   72    22        INIT_METHOD_CALL                                         !1, 'Ping'
         23        SEND_VAR_EX                                              !3
         24        DO_FCALL                                      0  $18     
         25        ASSIGN                                                   !4, $18
   74    26        FETCH_OBJ_R                                      ~20     !4, 'PingResult'
         27        ECHO                                                     ~20
   75    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                                 
         31      > JMP                                                      ->45
   77    32  E > > CATCH                                                    'SoapFault', ->39
   78    33    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         34        DO_FCALL                                      0  $22     
         35        ECHO                                                     $22
   79    36        ECHO                                                     '%3Cbr%3E%3Cbr%3E'
   80    37        ECHO                                                     !5
         38      > JMP                                                      ->45
   81    39  E > > CATCH                                       last         'Exception'
   82    40    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         41        DO_FCALL                                      0  $23     
         42        ECHO                                                     $23
   83    43        ECHO                                                     '%3Cbr%3E%3Cbr%3E'
   84    44        ECHO                                                     !6
   87    45    > > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ggrkl
function name:  guid
number of ops:  61
compiled vars:  !0 = $charid, !1 = $hyphen, !2 = $uuid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'mt_srand'
          1        INIT_FCALL                                               'microtime'
          2        DO_ICALL                                         $3      
          3        CAST                                          5  ~4      $3
          4        MUL                                              ~5      ~4, 10000
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
   18     7        INIT_FCALL                                               'strtoupper'
          8        INIT_FCALL                                               'md5'
          9        INIT_FCALL                                               'uniqid'
         10        INIT_FCALL                                               'rand'
         11        DO_ICALL                                         $7      
         12        SEND_VAR                                                 $7
         13        SEND_VAL                                                 <true>
         14        DO_ICALL                                         $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !0, $10
   19    20        ASSIGN                                                   !1, '-'
   20    21        CONCAT                                           ~13     'uuid', !1
   21    22        INIT_FCALL                                               'substr'
         23        SEND_VAR                                                 !0
         24        SEND_VAL                                                 0
         25        SEND_VAL                                                 8
         26        DO_ICALL                                         $14     
         27        CONCAT                                           ~15     ~13, $14
         28        CONCAT                                           ~16     ~15, !1
   22    29        INIT_FCALL                                               'substr'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 8
         32        SEND_VAL                                                 4
         33        DO_ICALL                                         $17     
         34        CONCAT                                           ~18     ~16, $17
         35        CONCAT                                           ~19     ~18, !1
   23    36        INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !0
         38        SEND_VAL                                                 12
         39        SEND_VAL                                                 4
         40        DO_ICALL                                         $20     
         41        CONCAT                                           ~21     ~19, $20
         42        CONCAT                                           ~22     ~21, !1
   24    43        INIT_FCALL                                               'substr'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 16
         46        SEND_VAL                                                 4
         47        DO_ICALL                                         $23     
         48        CONCAT                                           ~24     ~22, $23
         49        CONCAT                                           ~25     ~24, !1
   25    50        INIT_FCALL                                               'substr'
         51        SEND_VAR                                                 !0
         52        SEND_VAL                                                 20
         53        SEND_VAL                                                 12
         54        DO_ICALL                                         $26     
         55        CONCAT                                           ~27     ~25, $26
         56        CONCAT                                           ~28     ~27, !1
         57        CONCAT                                           ~29     ~28, '1'
   20    58        ASSIGN                                                   !2, ~29
   27    59      > RETURN                                                   !2
   28    60*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ggrkl
function name:  generate_header
number of ops:  77
compiled vars:  !0 = $WSSE_NS, !1 = $WSSE_PFX, !2 = $WSU_NS, !3 = $WSU_PFX, !4 = $PASSWORD_TYPE, !5 = $username, !6 = $password, !7 = $currentTime, !8 = $timestamp, !9 = $expiretimestamp, !10 = $nonce, !11 = $passdigest, !12 = $header, !13 = $headerSoapVar, !14 = $soapheader
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fdocs.oasis-open.org%2Fwss%2F2004%2F01%2Foasis-200401-wss-wssecurity-secext-1.0.xsd'
   32     1        ASSIGN                                                   !1, 'wsse'
   33     2        ASSIGN                                                   !2, 'http%3A%2F%2Fdocs.oasis-open.org%2Fwss%2F2004%2F01%2Foasis-200401-wss-wssecurity-utility-1.0.xsd'
   34     3        ASSIGN                                                   !3, 'wsu'
   35     4        ASSIGN                                                   !4, 'http%3A%2F%2Fdocs.oasis-open.org%2Fwss%2F2004%2F01%2Foasis-200401-wss-username-token-profile-1.0%23PasswordText'
   37     5        ASSIGN                                                   !5, 'TestProgram'
   38     6        ASSIGN                                                   !6, 'jtKLGpaKZ9XqmA40QGo'
   40     7        INIT_FCALL                                               'time'
          8        DO_ICALL                                         $22     
          9        ASSIGN                                                   !7, $22
   42    10        INIT_FCALL                                               'gmdate'
         11        SEND_VAL                                                 'Y-m-d%5CTH%3Ai%3As'
         12        SEND_VAR                                                 !7
         13        DO_ICALL                                         $24     
         14        CONCAT                                           ~25     $24, 'Z'
         15        ASSIGN                                                   !8, ~25
   44    16        INIT_FCALL                                               'gmdate'
         17        SEND_VAL                                                 'Y-m-d%5CTH%3Ai%3As'
         18        ADD                                              ~27     !7, 300
         19        SEND_VAL                                                 ~27
         20        DO_ICALL                                         $28     
         21        CONCAT                                           ~29     $28, 'Z'
         22        ASSIGN                                                   !9, ~29
   46    23        INIT_FCALL                                               'mt_rand'
         24        DO_ICALL                                         $31     
         25        ASSIGN                                                   !10, $31
   48    26        INIT_FCALL                                               'base64_encode'
         27        INIT_FCALL                                               'pack'
         28        SEND_VAL                                                 'H%2A'
         29        INIT_FCALL                                               'sha1'
         30        INIT_FCALL                                               'pack'
         31        SEND_VAL                                                 'a%2A'
         32        SEND_VAR                                                 !6
         33        DO_ICALL                                         $33     
         34        SEND_VAR                                                 $33
         35        DO_ICALL                                         $34     
         36        SEND_VAR                                                 $34
         37        DO_ICALL                                         $35     
         38        SEND_VAR                                                 $35
         39        DO_ICALL                                         $36     
         40        ASSIGN                                                   !11, $36
   51    41        CONCAT                                           ~38     '%0A%09%09%09%3Cwsse%3ASecurity+SOAP-ENV%3AmustUnderstand%3D%221%22+xmlns%3Awsse%3D%22', !0
         42        CONCAT                                           ~39     ~38, '%22+xmlns%3Awsu%3D%22'
         43        CONCAT                                           ~40     ~39, !2
         44        CONCAT                                           ~41     ~40, '%22%3E%0A%09%09%09%09%09%3Cwsu%3ATimestamp+wsu%3AId%3D%22_0%22%3E%0A%09%09%09%09%09%09%09%3Cwsu%3ACreated%3E'
   53    45        CONCAT                                           ~42     ~41, !8
         46        CONCAT                                           ~43     ~42, '%3C%2Fwsu%3ACreated%3E%0A%09%09%09%09%09%09%09%3Cwsu%3AExpires%3E'
   54    47        CONCAT                                           ~44     ~43, !9
         48        CONCAT                                           ~45     ~44, '%3C%2Fwsu%3AExpires%3E%0A%09%09%09%09%09%3C%2Fwsu%3ATimestamp%3E%0A%09%09%09%09%09%3Cwsse%3AUsernameToken+wsu%3AId%3D%22'
   56    49        INIT_FCALL_BY_NAME                                       'guid'
         50        DO_FCALL                                      0  $46     
         51        CONCAT                                           ~47     ~45, $46
         52        CONCAT                                           ~48     ~47, '%22%3E%0A%09%09%09%09%09%09%09%3Cwsse%3AUsername%3E'
   57    53        CONCAT                                           ~49     ~48, !5
         54        CONCAT                                           ~50     ~49, '%3C%2Fwsse%3AUsername%3E%0A%09%09%09%09%09%09%09%3Cwsse%3APassword+Type%3D%22'
   58    55        CONCAT                                           ~51     ~50, !4
         56        CONCAT                                           ~52     ~51, '%22%3E'
         57        CONCAT                                           ~53     ~52, !6
         58        CONCAT                                           ~54     ~53, '%3C%2Fwsse%3APassword%3E'
   59    59        CONCAT                                           ~55     ~54, '%3C%2Fwsse%3AUsernameToken%3E'
   60    60        CONCAT                                           ~56     ~55, '%3C%2Fwsse%3ASecurity%3E'
   50    61        ASSIGN                                                   !12, ~56
   62    62        NEW                                              $58     'SoapVar'
         63        SEND_VAR_EX                                              !12
         64        FETCH_CONSTANT                                   ~59     'XSD_ANYXML'
         65        SEND_VAL_EX                                              ~59
         66        DO_FCALL                                      0          
         67        ASSIGN                                                   !13, $58
   63    68        NEW                                              $62     'SoapHeader'
         69        SEND_VAR_EX                                              !0
         70        SEND_VAL_EX                                              'Security'
         71        SEND_VAR_EX                                              !13
         72        SEND_VAL_EX                                              <true>
         73        DO_FCALL                                      0          
         74        ASSIGN                                                   !14, $62
   64    75      > RETURN                                                   !14
   65    76*     > RETURN                                                   null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.44 ms | 1476 KiB | 27 Q