我有一個作爲Web服務公開的BW進程,並希望使用C#.NET表單來使用它。但是,我的應用程序一直顯示異常:沒有處理器的body元素,加上下面的堆棧跟蹤(下面的方式)。我已經在測試模式下運行BW進程來檢查進程狀態,並發現請求永遠不會到達BW。我還使用soapUI測試了相同的進程,它完美地觸發了Web服務請求。有什麼建議麼?從.NET表格中消費TIBCO BusinessWorks Web服務
我的代碼如下:
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));
服務器堆棧跟蹤: 在System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime操作,ProxyRpc & RPC) 在System.ServiceModel.Channels.ServiceChannel。調用(字符串操作,單向布爾值,ProxyOperationRuntime操作,Object [] ins,Object []輸出,TimeSpan超時) at System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins,對象[]出) 在System.ServiceModel.Channels.ServiceChanne lProxy.InvokeService(IMethodCallMessage包括MethodCall,ProxyOperationRuntime操作) 在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(即時聊天消息)[0]時
異常重新拋出: 在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(消息對象reqMsg,即時聊天retMsg) 在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData & MSGDATA,的Int32類型) 在MyWebServiceConsumer.ServiceReference1.PortType.processOperation(processOperationRequest請求) 在MyWebServiceConsumer.ServiceReference1.PortTypeClient.MyWebServiceConsumer。 ServiceReference1.PortType.processOperation(processOperationRequest請求)在c:\ users \ ystan.2009 \ documents \ visual studio 20 10 \ Projects \ MyWebServiceConsumer \ MyWebServiceConsumer \ Service References \ ServiceReference1 \ Reference.cs:line 327 at MyWebServiceConsumer.ServiceReference1.PortTypeClient.processOperation(new_incident_report new_incident_report)in c:\ users \ ystan.2009 \ documents \ visual studio 2010 \ Projects \ MyWebServiceConsumer \ MyWebServiceConsumer \ Service References \ ServiceReference1 \ Reference.cs:line 333 at c:\ users \ ystan.2009 \ documents \ visual studio 2010 \ Projects \ MyWebServiceConsumer \ MyWebServiceConsumer中MyWebServiceConsumer.Form1.button1_Click(Object sender,EventArgs e) \ Form1.cs:44行
您是否嘗試通過代理髮送您的soapui和.net請求,記錄接收到的內容並對它們進行比較?否則,你也可以使用wireshark捕獲請求。 – 2011-03-30 02:36:57