Consumindo o TIBCO BusinessWorks Web Service do formulário .NET
-
12-11-2019 - |
Pergunta
Tenho um processo BW exposto como um serviço web e desejo consumi-lo usando um formulário C# .NET.No entanto, meu aplicativo continua mostrando a exceção:Nenhum manipulador para o elemento body, além do seguinte rastreamento de pilha (mais abaixo).Executei o processo BW em modo de teste para verificar o status do processo e descobri que a solicitação nunca chegou ao BW.Também testei o mesmo processo usando o soapUI, que acionou perfeitamente a solicitação do serviço web.Alguma sugestão?
Meu código é o seguinte:
ServiceReference1.PortTypeClient client = new ServiceReference1.PortTypeClient();
ServiceReference1.new_incident_report report = new ServiceReference1.new_incident_report();
report.contact_details = new ServiceReference1.contact_details();
report.contact_details.name = "John Doe";
report.contact_details.contactno = "1234567890";
report.incident_details = new ServiceReference1.incident_details();
report.incident_details.date = new DateTime();
report.incident_details.time = new DateTime();
report.incident_details.location = "80 Dutch Road";
report.operator_comments = new ServiceReference1.operator_comments();
report.operator_comments.operator_name = "Bob";
report.operator_comments.operator_summary = "Something";
MessageBox.Show(client.processOperation(report));
Rastreamento de pilha do servidor:at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) em System.Servicemodel.Channels.Servicechannel.Call (ação da String, Boolean Oneway, ProxyoperationRuntime Operação, Objeto [] Inst, Object [] Out) em System.Servicemodel.Channels.ServicechannelProxy.InVoKeService (IMETHOLMESSAGEM. Servicemodel.Channels.ServicechannelProxy.invoke (mensagem de iMessage)
Exceção lançada novamente em [0]:em system.runtime.remoting.proxies.realProxy.HandleReturnMessage (iMessage reqmsg, iMessage retmsg) em system.runtime.remoting.proxies.realProxy.privateInVoke (Messagedata & msgdata, tipo INTELO) AT MYSEBERBSECURICECURICECROTECSETROC (Messagedata & msgdata, tipo INTEL) at MySeBsicReBSECRICEBUSCUMECRICESTICECRATECSECROTECSETROC. Solicitação de solicitação) em mywebServiceConsumer.ServiceReference1.porttypeClient.mywebserviceConsumer.ServiceReference1.porttype.processoperation (referência de referência de referência) em c: users ystan.2009 Documents Visual Studio 2010 Projects Projects Projecimentos ServiceReference1 Reference.CS: Linha 327 at MyWebServiceConsumer.ServiceReference1.PortTypeClient.processOperation(new_incident_report new_incident_report) in c:usersystan.2009documentsvisual studio 2010ProjectsMyWebServiceConsumerMyWebServiceConsumerService ReferencesServiceReference1Reference.cs:line 333 at MyWebServiceConsumer.Form1 .Button1_Click (Remetente de Objeto, EventArgs E) em C: Usuários Ystan.2009 Documents Visual Studio 2010 Projects MyWebServiceConsumer MywebServiceConsumer Form1.CS: Linha 44
Solução
Para quem ainda está olhando para isso, a solução parece envolver a elaboração manual do pacote SOAP, que é despachado corretamente para o BW.O utilitário .NET Web Reference e o BW parecem ser incompatíveis por algum motivo.