2016-04-30 59 views
0

我試圖綁定x509證書並通過客戶端的web服務發送數據。 我創建了一個窗口形式的應用程序和使用Microsoft.web.Service3,但是當我在我的本地運行此程序奪冠它給了我這樣的錯誤:身份驗證失敗:必須簽署SOAP身份以進行基於簽名的身份驗證。沒有提供憑證。聯繫IT SOASvsSupport

驗證失敗:SOAP體必須基於簽名簽署 認證。沒有提供憑證。聯繫IT SOASvsSupport。

任何人都可以幫忙嗎?

private void btnSubmit_Click(object sender,EventArgs e) string certificateFile = @「C:\ XYZ \ MyTest.cer」;

 System.Security.Cryptography.X509Certificates.X509Certificate x509Certificate = new System.Security.Cryptography.X509Certificates.X509Certificate(certificateFile); 
     //X509Certificate x509Certificate = X509Certificate.CreateFromCertFile(certificateFile); 
     MyTest.DataService rdf = new MyTest.DataService(); 
     RvsDataFeed[] rvs = rdf.GetRvsDataFeed(); 
     txtXml.Text = ""; 

     if (rvs != null) 
     { 
      foreach (RvsDataFeed rvsdata in rvs) 
      { 

       try 
       { 

        TrackingRequest wbttreq = new TrackingRequest(); 
        ClientType cit = new ClientType(); 


        cit.requestorAppName = "MMM"; 
        cit.requestorUserName = rvsdata.ID; 
        wbttreq.ClientInfo = cit; 


        ClientWSDL.DataUtility xyzWSDL = new ClinetWSDL.DataUtility(); 
        xyzWSDL.Url = "http://xyz.xy"; 

        xyzWSDL.ClientCertificates.Add(x509Certificate); 

        txtXml.Text = txtXml.Text + Environment.NewLine + SerializeToString(td); 

        TrackingResponse res = new TrackingResponse(); 
        xyzWSDL.WriteBack(wbttreq); 

        rdf.LogRvsDataFeedSent(rvsdata.DataFeedID); 

       } 
       catch (Exception ex) 
       { 
        txtXml.Text = txtXml.Text + Environment.NewLine + ex.Message; 
       } 


      } 
     } 

    } 
+0

您需要爲其他人提供足夠的信息來複制問題。閱讀[this](http://stackoverflow.com/help/how-to-ask)。 – MikeJRamsey56

回答

0

私人無效btnSubmit_Click(對象發件人,EventArgs的) { 串certificateFile = @ 「C:\ XYZ \ MyTest.cer」;

 System.Security.Cryptography.X509Certificates.X509Certificate x509Certificate = new System.Security.Cryptography.X509Certificates.X509Certificate(certificateFile); 
     //X509Certificate x509Certificate = X509Certificate.CreateFromCertFile(certificateFile); 
     MyTest.DataService rdf = new MyTest.DataService(); 
     RvsDataFeed[] rvs = rdf.GetRvsDataFeed(); 
     txtXml.Text = ""; 

     if (rvs != null) 
     { 
      foreach (RvsDataFeed rvsdata in rvs) 
      { 

       try 
       { 

        TrackingRequest wbttreq = new TrackingRequest(); 
        ClientType cit = new ClientType(); 


        cit.requestorAppName = "MMM"; 
        cit.requestorUserName = rvsdata.ID; 
        wbttreq.ClientInfo = cit; 


        ClientWSDL.DataUtility xyzWSDL = new ClinetWSDL.DataUtility(); 
        xyzWSDL.Url = "http://xyz.xy"; 

        xyzWSDL.ClientCertificates.Add(x509Certificate); 

        txtXml.Text = txtXml.Text + Environment.NewLine + SerializeToString(td); 

        TrackingResponse res = new TrackingResponse(); 
        xyzWSDL.WriteBack(wbttreq); 

        rdf.LogRvsDataFeedSent(rvsdata.DataFeedID); 

       } 
       catch (Exception ex) 
       { 
        txtXml.Text = txtXml.Text + Environment.NewLine + ex.Message; 
       } 


      } 
     } 

    } 
+0

這是測試代碼 – mpatel