13

I am using a WSDL file (wsdl.zip) provided by Amadeus. When trying to call the service method using the below code, it threw a System.PlatformNotSupportedException saying "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;
        }

Is this really something that is not supported by the tool yet?

Stack Trace:

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

3 Answers 3

24

As you have already posted the issue to Github repository, I am here just for sharing the snapshot of the solution for others.
There is something wrong with the generated type by Microsoft WCF Web Service Reference Provider tool.
As shmao said,

The property is a 2-dimensional array, but the XmlArrayItemAttribute specified the item type as typeof(ListViewRecordColumn). To work around the issue, we can change the item type to typeof(ListViewRecordColumn[]).

i.e. Change **:

/// <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;
    }
}

To:

[System.Xml.Serialization.XmlArrayItemAttribute("columns", typeof(ListViewRecordColumn[]), IsNullable=false)]

For details,
https://github.com/dotnet/wcf/issues/2219

Sign up to request clarification or add additional context in comments.

1 Comment

I came here because I am getting the same error, but there are no two-dimensional arrays in my classes. Do you have any suggestions on how to track which line could be causing this error? The generated class is 46k lines long. 😐
1

Same error for me - not in SOAP specifically, just general deserialization of XML. But this is one of the top results on google for the error so maybe this will help someone. In general it seems to be about a mismatch between the type specified in [XmlElement(name, type)], [XmlArrayItem(name, type)], etc and the type of the underlying property. In my case, I had

[XmlElement("B", typeof(B)]
[XmlElement("C", typeof(C)]
public List<A> AList { get; set; }

where B and C were inheriting from A. But I forgot to do the inheritance on C... so I got this error. Once I added C : A to my C class, it was all ok.

What a strangely worded error - and with no additional context to go with it.

Comments

0

I had the same error, but not because of the double array. I changed it:

 [System.Xml.Serialization.XmlElementAttribute("AttachmentContentList", typeof(AttachmentContentList), Namespace="urn://")]
    public AttachmentContentType[] AttachmentContentList

On it:

[System.Xml.Serialization.XmlElementAttribute(Namespace="urn://")]
        public AttachmentContentList AttachmentContentList

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.