gpt4 book ai didi

c# - .NET Core 3.1 SOAP 平台不受支持错误 "Compiling JScript/CSharp scripts is not supported"

转载 作者:行者123 更新时间:2023-12-03 18:05:26 33 4
gpt4 key购买 nike

我正在使用 Amadeus 提供的 WSDL 文件 (wsdl.zip)。当尝试使用下面的代码调用服务方法时,它抛出了一个 System.PlatformNotSupportedException 说“Compiling JScript/CSharp scripts is not supported

public async Task<Fare_MasterPricerTravelBoardSearchResponse> SearchFlight(Session session,
Fare_MasterPricerTravelBoardSearch searchData)
{
var _client = new AmadeusWebServicesPTClient();
var result = await _client.Fare_MasterPricerTravelBoardSearchAsync(session, searchData);
return result;
}

这真的是工具还不支持的东西吗?

堆栈跟踪:
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.ServiceModel.Description.XmlSerializerHelper.FromMappingsViaReflection(XmlMapping[] mappings, Type type)
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.SerializerGenerationContext.GenerateSerializers()
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.SerializerGenerationContext.GetSerializer(Int32 handle)
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.SerializerStub.GetSerializer()
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.MessageInfo.get_HeaderSerializer()
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.AddHeadersToMessage(Message message, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.SerializeRequest(MessageVersion messageVersion, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.BeforeRequest(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
at System.ServiceModel.Channels.ServiceChannel.BeginCall(ServiceChannel channel, ProxyOperationRuntime operation, Object[] ins, AsyncCallback callback, Object asyncState)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, Object[] inputParameters)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at SkywayTravel.Amadeus.Air.MasterPricerTravelBoardSearchClient.<SearchFlight>d__1.MoveNext() in E:\MobileAppTelligence\Projects\SkywayTravel\SkywayTravel.Amadeus.Air\MasterPricerTravelBoardSearchClient.cs:line 29

最佳答案

由于您已经将问题发布到 Github 存储库,因此我在这里只是为其他人分享解决方案的快照。
Microsoft WCF Web 服务引用生成的类型有问题
提供者工具。
shmao说过,

The property is a 2-dimensional array, but the XmlArrayItemAttributespecified the item type as typeof(ListViewRecordColumn). To workaround the issue, we can change the item type totypeof(ListViewRecordColumn[]).


即更改**:
/// <remarks/>
[System.Xml.Serialization.XmlArrayAttribute(Order=5)]
** [System.Xml.Serialization.XmlArrayItemAttribute("columns", typeof(ListViewRecordColumn), IsNullable=false)]
public ListViewRecordColumn[][] records
{
get
{
return this.recordsField;
}
set
{
this.recordsField = value;
}
}
到:
[System.Xml.Serialization.XmlArrayItemAttribute("columns", typeof(ListViewRecordColumn[]), IsNullable=false)]
欲知详情,
https://github.com/dotnet/wcf/issues/2219

关于c# - .NET Core 3.1 SOAP 平台不受支持错误 "Compiling JScript/CSharp scripts is not supported",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60976792/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com