|
16.07.2013, 13:06 | #1 |
Участник
|
AX 2009 consuming services
Hello guys,
I am going to use InventService to interact with AX. In the Virtual directory I can see InventService.svc and the coresponding schema. How can I generate wsdl file that can be used as an endpoint? 10x |
|
16.07.2013, 20:33 | #2 |
Banned
|
A sustainable way to consume services in AX is to implement a [C# assembly] wrapper and call it from AX:
http://msdn.microsoft.com/EN-US/library/hh500185.aspx But I'm afraid you are talking of something else: providing AX logic as a service. Since when is AX2009 able to expose services? Последний раз редактировалось EVGL; 16.07.2013 в 20:37. |
|
16.07.2013, 23:09 | #4 |
Модератор
|
Since the beginning, I think
Dynamics AX 2009 - Consume Web Services ist, are you sure you require a WSDL file ? What for ? Why don't you add a service URL as a Service reference to your solution (in case you are using Visual Studio, can't tell for other IDEs) ? P.S. To get the service's WSDL, just 'Browse' the .svc file from IIS Manager console
__________________
-ТСЯ или -ТЬСЯ ? |
|
17.07.2013, 02:35 | #5 |
Участник
|
Цитата:
=P.S. To get the service's WSDL, just 'Browse' the .svc file from IIS Manager console
Our customer is going to consume AX service, so I have deployed standard AX AIF Services following the AX manual for that purpose. The customer wants an endpoints for service invocation, something like that: http://myserver/someservice/endpoint1 - for service invocation http://myserver/someservice/endpoint1?wsdl - for WSDL p.s. I found some examples how AX services to be consumed using Visual Studio.Unfortunately the customer doesn't want to use Visual Studio! Regards, Regards, |
|
22.07.2013, 10:36 | #6 |
NavAx
|
It is possible to consume AX service from any environment, capable of interfacing with SOAP services (i.e. MS WCF service is kind of that).
For example, PHP with it's standard library. I can provide you an example in PHP, if you'd interested, but at MSK evening.
__________________
Жизнь прекрасна! Если, конечно, правильно подобрать антидепрессанты... |
|
23.07.2013, 01:00 | #7 |
Участник
|
Thanks, please provide me with a php example.
Our customer use Java, but obviously we can't provide Java solution! 10x |
|
23.07.2013, 13:37 | #8 |
NavAx
|
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 |
|
|