Guest User

Untitled

a guest
Feb 28th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1. $file = file_get_contents($path, true);
  2.  
  3. Yii::import('ext.EHttpClient.*');
  4.  
  5. $client = new EHttpClient('https://secure.efaxdeveloper.com/EFax_WebFax.serv', array(
  6. 'maxredirects' => 3,
  7. 'timeout' => 30,
  8. 'Content-Type' => 'application/x-www-form-urlencoded',
  9. 'adapter' => 'EHttpClientAdapterCurl'));
  10.  
  11. $client->setParameterPost(array('id'=>urlencode("2313125942"), 'xml'=>urlencode($file)));
  12.  
  13.  
  14. SiteHelper::printShow($client);
  15.  
  16. $response = $client->request("POST");
  17.  
  18. var_dump($response->isSuccessful());
  19. SiteHelper::printShow($response);
  20.  
  21. <?xml version="1.0"?>
  22. <OutboundRequest>
  23. <AccessControl>
  24. <UserName>b23s2323</UserName>
  25. <Password>b23s2323</Password>
  26. </AccessControl>
  27. <Transmission>
  28.  
  29. <TransmissionControl>
  30. <Resolution>STANDARD</Resolution>
  31. </TransmissionControl>
  32.  
  33. <DispositionControl>
  34. <DispositionLevel>BOTH</DispositionLevel>
  35. <DispositionEmails>
  36. <DispositionEmail>
  37. <DispositionAddress>johnmorris201615@gmail.com</DispositionAddress>
  38. </DispositionEmail>
  39. </DispositionEmails>
  40. </DispositionControl>
  41.  
  42. <Recipients>
  43. <Recipient>
  44. <RecipientFax>8189790412</RecipientFax>
  45. </Recipient>
  46. </Recipients>
  47.  
  48. <Files>
  49. <File>
  50. <FileContents>Base64 pdf here</FileContents>
  51. <FileType>pdf</FileType>
  52. </File>
  53. </Files>
  54.  
  55. </Transmission>
  56. </OutboundRequest>
  57.  
  58. EHttpClient Object
  59. (
  60. [config:protected] => Array
  61. (
  62. [maxredirects] => 3
  63. [strictredirects] =>
  64. [useragent] => EHttpClient
  65. [timeout] => 30
  66. [adapter] => EHttpClientAdapterCurl
  67. [httpversion] => 1.1
  68. [keepalive] =>
  69. [storeresponse] => 1
  70. [strict] => 1
  71. [output_stream] =>
  72. [encodecookies] => 1
  73. [rfc3986_strict] =>
  74. [content-type] => application/x-www-form-urlencoded
  75. )
  76.  
  77. [adapter:protected] =>
  78. [uri:protected] => EUriHttp Object
  79. (
  80. [_username:protected] =>
  81. [_password:protected] =>
  82. [_host:protected] => secure.efaxdeveloper.com
  83. [_port:protected] => 443
  84. [_path:protected] => /EFax_WebFax.serv
  85. [_query:protected] =>
  86. [_fragment:protected] =>
  87. [_regex:protected] => Array
  88. (
  89. [alphanum] => [^W_]
  90. [escaped] => (?:%[da-fA-F]{2})
  91. [mark] => [-_.!~*'()[]]
  92. [reserved] => [;/?:@&=+$,]
  93. [unreserved] => (?:[^W_]|[-_.!~*'()[]])
  94. [segment] => (?:(?:(?:[^W_]|[-_.!~*'()[]])|(?:%[da-fA-F]{2})|[:@&=+$,;])*)
  95. [path] => (?:/(?:(?:(?:[^W_]|[-_.!~*'()[]])|(?:%[da-fA-F]{2})|[:@&=+$,;])*)?)+
  96. [uric] => (?:[;/?:@&=+$,]|(?:[^W_]|[-_.!~*'()[]])|(?:%[da-fA-F]{2}))
  97. )
  98.  
  99. [_scheme:protected] => https
  100. )
  101.  
  102. [headers:protected] => Array
  103. (
  104. )
  105.  
  106. [method:protected] => GET
  107. [paramsGet:protected] => Array
  108. (
  109. )
  110.  
  111. [paramsPost:protected] => Array
  112. (
  113. [id] => 2313125942
  114. [xml] => The%encoded%url%xml%data
  115. )
  116.  
  117. [cookiejar:protected] =>
  118. [last_request:protected] =>
  119. [last_response:protected] =>
  120. [redirectCounter:protected] => 0
  121. [_unmaskStatus:protected] =>
  122. [_queryBracketsEscaped:protected] => 1
  123. )
  124.  
  125. Post Unsuccessful!
  126. Your request has failed due to invalid data.
  127. Please refer to our documentation prior to resubmitting.
  128.  
  129. Error Level: User
  130. Error Message: XML data argument was not passed.
  131.  
  132. Please contact us at 888-278-8666 if you continue to encounter errors.
Add Comment
Please, Sign In to add comment