AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: За рубежом > DAX in English
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 23.07.2013, 13:37   #8  
Maximin is offline
Maximin
NavAx
NavAx Club
 
409 / 341 (12) ++++++
Регистрация: 09.10.2002
Адрес: Москва
There's an example to a simple AX service client, using two access methods of trivial AX service:
- getOrder with one string argument - orderId, returning some set of orderIds;
- setCost with multiple argumens - some of the values of order, that must be set.

All of this is operating under some kind of WS_Security, so there's shown also a way to set appropriate header values. Althrough this is obviously not a complete example, as complying with real WS_Security and SSL needs much more actions. I just left there this setting of headers as some piece of useful code.

You can find a way more sophisticated example at http://www.sis.utoronto.ca/web_servi...lient.php.html.

Be sure, that you have uncommented in your php.ini php_soap.dll extension prior to start playing with PHP as SOAP service client.

X++:
<?php 

$login = "login";
$password = "password";
class argumentObject
{
	public $number = "";
	public $number_string = "";
	public $cost = 0.0;
	public $discount = 0.0;
	public $discount2 = 0.0;
	public $status = "";
}
try {
	$cl = new SoapClient('YOUR_URL_TO_WSDL');
	$cl->__setSoapHeaders(array(new SoapHeader('namespace_name', 'security_token', array($login, $password), 1)));
	$result = $cl->getOrder("Some_order_id");
	print($result->orders[0]->number);
	$placementArray = array();
	$argumentObject = new argumentObject();
	$argumentObject->number=$result->orders[0]->number;
	$argumentObject->number_string=$result->orders[0]->number_string;
	$argumentObject->cost=0;
	$argumentObject->status="Status_name";
	$argumentArray[0]=$placement;	
	$cl->setCost($argumentArray);

} catch (SoapFault $fault) {
    print("Fault string: " . $fault->faultstring . "\n");
    print("Fault code: " . $fault->detail->WebServiceException->code . "\n");
}

?>
__________________
Жизнь прекрасна! Если, конечно, правильно подобрать антидепрессанты...

Последний раз редактировалось Maximin; 23.07.2013 в 13:40.
Теги
ax2009, service, wsdl

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
semanticax: Dynamics AX 2009 Installation - Application Blog bot DAX Blogs 0 22.12.2010 08:11
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 06:29.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.