1. PHP / Говнокод #18683

    −11

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    $soap_envelope = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    					<s:Body>
    					  <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    						<entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
    						  <a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    							<a:KeyValuePairOfstringanyType>
    							  <b:key>subject</b:key>
    							  <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">Заказ обратного звонка от '.$fio.' ::: '.$subject.'</b:value>
    							</a:KeyValuePairOfstringanyType>
    							<a:KeyValuePairOfstringanyType>
    							  <b:key>description</b:key>
    							  <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">'.$text.'</b:value>
    							</a:KeyValuePairOfstringanyType>
    							<a:KeyValuePairOfstringanyType>
    							  <b:key>phonenumber</b:key>
    							  <b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">'.$phone.'</b:value>
    							</a:KeyValuePairOfstringanyType>
    							<a:KeyValuePairOfstringanyType>
    							  <b:key>scheduledend</b:key>
    							  <b:value i:type="c:dateTime" xmlns:c="http://www.w3.org/2001/XMLSchema">'.$dateStr.'</b:value>
    = вырезано =
    						  <a:EntityState i:nil="true" />
    						  <a:FormattedValues xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    						  <a:Id>00000000-0000-0000-0000-000000000000</a:Id>
    						  <a:LogicalName>phonecall</a:LogicalName>
    						  <a:RelatedEntities xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    						</entity>
    					  </Create>
    					</s:Body>
    				  </s:Envelope>';
    				$soap_action = 'http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Create';
    				$req_location = 'http://XXXXX/YYYYY/XRMServices/2011/Organization.svc/web';
    
    				$headers = array(
    					'Method: POST',
    					'Connection: Keep-Alive',
    					'User-Agent: PHP-SOAP-CURL',
    					'Content-Type: text/xml; charset=utf-8',
    					'SOAPAction: "'.$soap_action.'"'
    					);
    			  			  
    				$ch = curl_init();
    				curl_setopt($ch, CURLOPT_URL, $req_location);
    				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    				curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    				curl_setopt($ch, CURLOPT_POST, true );
    				curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
    				curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$password);
    				curl_setopt($ch, CURLOPT_POSTFIELDS, $soap_envelope);
    				$response = curl_exec($ch);
    				if($response !== false)

    От создателей "SOAP клиент своими руками"

    Запостил: nik757, 07 Сентября 2015

    Комментарии (0) RSS

    Добавить комментарий

    Ошибка компиляции комментария:
    1. Гости могут высказаться только во вторник, пятницу или субботу
    ava Семь раз отмерь — один отрежь, guest!
    А не использовать ли нам bbcode?
    • [b]жирный[/b] — жирный
    • [i]курсив[/i] — курсив
    • [u]подчеркнутый[/u] — подчеркнутый
    • [s]перечеркнутый[/s] — перечеркнутый
    • [blink]мигающий[/blink] — мигающий
    • [color=red]цвет[/color] — цвет (подробнее)
    • [size=20]размер[/size] — размер (подробнее)
    • [code=<language>]some code[/code] (подробнее)
    Проверочный код