Lorsque j'essaie d'accéder à un service Web hébergé dans Tomcat à partir du code C#, un message d'erreur s'affiche comme suit.Appel d'un service Web Java à partir d'un client dot net
There was an error in serializing body of message searchRepositoriesRequest: '
Unable to generate a temporary class (result=1).
error CS0266: Cannot implicitly convert type 'object' to 'object[]'. An explicit
conversion exists (are you missing a cast?)
error CS0266: Cannot implicitly convert type 'object' to 'object[]'. An explicit
conversion exists (are you missing a cast?)
error CS0266: Cannot implicitly convert type 'object' to 'object[]'. An explicit
conversion exists (are you missing a cast?)
'. Please see InnerException for more details.
Quelqu'un peut-il m'aider? Veuillez vous référer à la trace de pile donnée ci-dessous.
Server stack trace:
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.SerializeBo
dy(XmlDictionaryWriter writer, MessageVersion version, String action, MessageDes
cription messageDescription, Object returnValue, Object[] parameters, Boolean is
Request)
at System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(Xm
lDictionaryWriter writer, MessageVersion version, Object[] parameters, Object re
turnValue, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessag
e.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWri
ter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDict
ionaryWriter writer)
at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter wr
iter)
at System.ServiceModel.Channels.Message.WriteMessage(XmlDictionaryWriter writ
er)
at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message me
ssage, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota)
at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.
WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager,
Int32 messageOffset)
at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message m
essage)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpCha
nnelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeS
pan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message messag
e, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan tim
eout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean on
eway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at WSTesting2.SBS.SBSQueryService.searchRepositories(searchRepositoriesReques
t request)
at WSTesting2.SBS.SBSQueryServiceClient.WSTesting2.SBS.SBSQueryService.search
Repositories(searchRepositoriesRequest request) in E:\Tetsngs\WSTesting2\Service
References\SBS\Reference.cs:line 2253
at WSTesting2.SBS.SBSQueryServiceClient.searchRepositories(searchRequest arg0
) in E:\Tetsngs\WSTesting2\Service References\SBS\Reference.cs:line 2259
at WSTesting2.Program.Main(String[] args) in E:\Tetsngs\WSTesting2\Program.cs
:line 66Press any key to continue . . .
Est-ce une trace de pile Java ou une trace de pile C#? Si ce dernier, vous devriez peut-être ajouter la balise C#. –
pls fournissent le fichier WSDL. Cela nous aidera à vous aider. ;) – KB22
@Thomas, une balise C# a été ajoutée pour que les personnes connaissant C# et .Net puissent jeter un coup d'œil sur la pile pour faciliter la résolution. Qu'il s'agisse d'une application de console, l'application WinForms ou une page ASP.Net est plus ou moins pertinente. –