Всем привет!
Пытаюсь разобраться с 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, а что не пойму.
Помогите пожалуйста