C# - 与Siscan(Web服务)集成

时间:2015-11-16 01:10:29

标签: c# .net web-services integration

好的,人们?

我需要使用以下网络服务的一些方法:
http://aplicacao-homologacao.saude.gov.br/ws-siscan/SiscanWS?wsdl我正在做如下(不知道这是否正确):

    protected static void LiberarLaudo()
    {
        try
        {                
            var oServicoSISCAN = new SiscanWSClient();
            var oliberarLaudo = new liberarLaudo();

            oliberarLaudo.identificacao = new identificacao();
            oliberarLaudo.laudo = new liberarLaudoXSD();

            oliberarLaudo.identificacao.email = "anything";
            oliberarLaudo.identificacao.senha = "anything";
            oliberarLaudo.identificacao.cnesPrestador = "anything";
            oliberarLaudo.identificacao.cnesUnidadeSaude = "anything";

            oliberarLaudo.laudo.cartaoSUSPaciente = "anything";
            oliberarLaudo.laudo.cpfResponsavelLaudo = "anything";
            oliberarLaudo.laudo.dataColeta = "anything";
            oliberarLaudo.laudo.tipoExame = "anything";
            oliberarLaudo.laudo.numeroProtocoloDaRequisicao = "anything";
            oliberarLaudo.laudo.tipoLateralidade = "anything";

            oliberarLaudo.identificacao.perfilUsuario = "anything";

            //Here happens the exception...
            var retorno = oServicoSISCAN.liberarLaudo(oliberarLaudo);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

在此处查看抛出的异常(使用“附加信息”的翻译)。点击缩放

enter image description here


下面是错误服务器堆栈跟踪:

  

服务器堆栈跟踪:em System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer,MessageVersion version,String action,MessageDescription messageDescription,Object returnValue,Object [] parameters,Boolean isRequest)      em System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(XmlDictionaryWriter writer,MessageVersion version,Object [] parameters,Object returnValue,Boolean isRequest)      em System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)      em System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)      em System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)      em System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(消息消息,BufferManager bufferManager,Int32 initialOffset,Int32 maxSizeQuota)      em System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(消息消息,Int32 maxMessageSize,BufferManager bufferManager,Int32 messageOffset)      em System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(消息消息,布尔值shouldRecycleBuffer)      em System.ServiceModel.Channels.HttpOutput.Send(TimeSpan超时)      em System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(消息消息,TimeSpan超时)      em System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeSpan超时)      em System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息消息,TimeSpan超时)      em System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins,Object [] outs,TimeSpan timeout)      em System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime operation)      em System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

     

在[0]处重新抛出异常:      em Siscan.Program.LiberarLaudo()na d:\ Projetos \ Ciprodam \ Antonio-Testes \ Siscan \ Siscan \ Program.cs:linha 216      em Siscan.Program.Main(String [] args)na d:\ Projetos \ Ciprodam \ Antonio-Testes \ Siscan \ Siscan \ Program.cs:linha 20      em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,String [] args)      em System.AppDomain.ExecuteAssembly(String assemblyFile,Evidence assemblySecurity,String [] args)      em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()      em System.Threading.ThreadHelper.ThreadStart_Context(Object state)      em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx)      em System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx)      em System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态)      em System.Threading.ThreadHelper.ThreadStart()

请任何人帮助我使这项网络服务工作吗? 非常感谢您的关注!

0 个答案:

没有答案