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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.11.2016, 12:22   #1  
AnGor is offline
AnGor
Участник
Аватар для AnGor
 
97 / 46 (2) +++
Регистрация: 30.08.2007
Адрес: Ulm
Записей в блоге: 6
? AIF Web Service from C# (AX 2009)
Всем привет!
Пытаюсь разобраться с AIF, Web Service + C#.
Методичку https://msdn.microsoft.com/en-US/lib...(v=AX.50).aspx почитал.
Установил AIF Web services, AX добавил Web site, настроил сервис.
Отредактировал web.config
PHP код:
    <bindings>
      <
basicHttpBinding>
        <
binding name="basicHttpBindingWindowsAuth">
          <
security mode="TransportCredentialOnly">
            <
transport clientCredentialType="Basic" />
          </
security>
        </
binding>
      </
basicHttpBinding>
        <
wsHttpBinding>
            <
binding name="wsHttpWindowsAuthAif"
                     
closeTimeout="00:10:00"
                     
openTimeout="00:10:00"
                     
receiveTimeout="01:00:00"
                     
sendTimeout="01:00:00"
                     
maxReceivedMessageSize="2147483647" >
                <
readerQuotas maxArrayLength="10000000" />
                <
security mode="None"></security>
            </
binding>
        </
wsHttpBinding>
    </
bindings>
    
    <
services>
      <
service behaviorConfiguration="serviceBehaviorConfiguration" name="Microsoft.Dynamics.IntegrationFramework.Service.InventoryOnHandService">
        <
endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpWindowsAuthAif" bindingNamespace="http://schemas.microsoft.com/dynamics/2008/01/services" contract="Microsoft.Dynamics.IntegrationFramework.Service.InventoryOnHandService" />
      </
service>
    </
services
и в проекте app.config
PHP код:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpWindowsAuthAif"
             closeTimeout="00:10:00"
             openTimeout="00:10:00"
             receiveTimeout="01:00:00"
             sendTimeout="01:00:00"
             maxReceivedMessageSize="2147483647" >
          <readerQuotas maxArrayLength="10000000" />
          <security mode="None"></security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://zeus2.ealtd.com/MicrosoftDynamicsAXAif50/inventoryonhandservice.svc"
          binding="wsHttpBinding" bindingConfiguration="wsHttpWindowsAuthAif"
          contract="AIFInventOnHandRef.InventoryOnHandService" name="InventoryOnHandService"/>
    </client>
  </system.serviceModel>
</configuration>
написал коротенькую C#
PHP код:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AIFInventOnHand.AIFInventOnHandRef;
namespace 
AIFInventOnHand
{
    class 
Program
    
{
        static 
void Main(string[] args)
        {
            
InventoryOnHandServiceClient client = new InventoryOnHandServiceClient();

            
QueryCriteria qc = new QueryCriteria();
            
CriteriaElement[] qe = { new CriteriaElement()};

            
EntityKey[] entityKey = { new EntityKey() };

            
qe[0].DataSourceName "InventSum";
            
qe[0].FieldName "ItemId";
            
qe[0].Operator Operator.Equal;
            
qe[0].Value1 "1AUSLAUFRÄDER";

            
qc.CriteriaElement qe;

            
Console.WriteLine("start");

            
entityKey client.findKeys(qc);
            if (
null == entityKey)
            {
                
Console.WriteLine("Item was not found.");
            }
            else 
            {
                
Console.WriteLine(entityKey.First().KeyData[1].Field);
                
Console.WriteLine(entityKey.First().KeyData[1].Value);
            }
            
Console.ReadKey();
            
client.Close();
        }
    }

на строчке с entityKey = client.findKeys(qc); вылетает с сообщением:

The Application Integration Framework Web service cannot determine the Windows login of the user calling the Web service. Check the Web server Event Viewer for more information, or contact your Administrator.

Соответствующий Event:
The description for Event ID 0 from source Dynamics Application Integration Server cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

An error occurred while Web service request http://zeus2.ealtd.com/MicrosoftDyna...andservice.svc and action http://schemas.microsoft.com/dynamic...rvice/findKeys were being processed. Error details: The Application Integration Framework Web service cannot determine the Windows login of the user calling the Web service. Check the Web server Event Viewer for more information, or contact your Administrator.


The WCF service cannot determine the Windows identity of the caller. If using basicHttpBinding, please update the Web.config file as follows using the MS Service Configuration Editor (in binding configuration):
1- Set the Mode property to TransportCredentialOnly.
2- Set the TransportClientCredentialType property to anything other than None.
3- In IIS, set the directory security for the virtual directory to match the TransportClientCredentialType. For example, if the TransportClientCredentialType property is set to Windows then set the IIS authentication method to Integrated Windows authentication..

The specified resource type cannot be found in the image file

Чувствую, что я что-то должен поменять в web.config и/или app.config, а что не пойму.
Помогите пожалуйста
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
DynamicsAxSCM: Service products in Microsoft Dynamics AX 2012 Blog bot DAX Blogs 2 02.06.2011 13:36
dynamics-ax: Dynamics AX 2009: Hotfix 981339 for Consuming external WCF Web service Blog bot DAX Blogs 0 24.03.2011 01:14
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35
semanticax: Dynamics AX 2009 Installation - Application Blog bot DAX Blogs 0 22.12.2010 08:11
gatesasbait: Dynamics AX 2009 SSRS and SSAS Integration Tips Blog bot DAX Blogs 3 09.07.2009 13:07

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 05:23.