我在使用自定义 AX 2012 R3 CU9 AIF WCF服务时遇到了一个非常奇怪的问题。
我的目标是使用我的AX wcf服务,启用wsHttpBinding + Basic身份验证+ TransactionFlow。
每次我尝试在VS中添加此服务的服务引用时都会出现此错误\在浏览器中打开服务链接:
Object Server 01: An error has occurred in the services framework. Method: AifMessageInspector::AfterReceiveRequest. Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeSession()
at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.InitializeContext()
at Microsoft.Dynamics.Ax.Services.AxServiceOperationContext.Attach(OperationContext owner)
at System.ServiceModel.ExtensionCollection`1.InsertItem(Int32 index, IExtension`1 item)
at System.Collections.Generic.SynchronizedCollection`1.Add(T item)
at Microsoft.Dynamics.Ax.Services.AifMessageInspector.AfterReceiveRequest(Message& request, IClientChannel channel, InstanceContext instanceContext)
IIS:
AX:
AX生成的Web配置(aos.config):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics />
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logKnownPii="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
<endToEndTracing propagateActivity="true" activityTracing="true"
messageFlowTracing="true" />
</diagnostics>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBindingTransportBasic" transactionFlow="true">
<security mode="Transport">
<transport clientCredentialType="Basic" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultServiceGroupBehavior">
<serviceMetadata httpGetEnabled="false" httpGetUrl="http://ax2012r2a/MicrosoftDynamicsAXAif60/WCFService/xppservice.svc"
httpsGetEnabled="true" httpsGetUrl="https://ax2012r2a/MicrosoftDynamicsAXAif60/WCFService/xppservice.svc" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200"
maxConcurrentInstances="200" />
<useRequestHeadersForMetadataAddress />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="DefaultServiceGroupBehavior"
name="Microsoft.Dynamics.Ax.Services.WCFService">
<endpoint address="https://ax2012r2a/MicrosoftDynamicsAXAif60/WCFService/xppservice.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpBindingTransportBasic"
name="DefaultServiceGroupEndPoint" contract="Microsoft.Dynamics.Ax.Services.ServiceGroup" />
</service>
</services>
<client>
<endpoint address="https://ax2012r2a/MicrosoftDynamicsAXAif60/WCFService/xppservice.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpBindingTransportBasic"
contract="*" name="DefaultServiceGroupEndPoint" />
</client>
</system.serviceModel>
</configuration>
可能会发生什么?
任何帮助都将受到高度赞赏。 谢谢。