我決定在這裏發表我自己的答案,因爲我已經失去了同在這幾小時內,我認爲,儘管接受的答案非常好,並指出我的方向是正確的(是的,它得到了一個投票),但它不夠詳細,不足以解釋我的應用程序出了什麼問題,至少在我的情況。
我跑在OpenESB的2.2 BPEL模塊和我複合應用程序的測試案例,下面的錯誤是失敗:
Caused by: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: .
做一些研究之後,我已經注意到,外部WSDL具有所有線索我們需要解決這個問題,比如,我用下面的Web服務,通過Web服務的業務流程來驗證信用卡號碼: http://www.webservicex.net/CreditCard.asmx?WSDL
如果檢查<wsdl:operation
元素,你會清楚地看到它說明該o的soapAction
peration:
<wsdl:binding name="CCCheckerSoap" type="tns:CCCheckerSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ValidateCardNumber">
<soap:operation soapAction="http://www.webservicex.net/ValidateCardNumber" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
...
但是,一旦你創建複合應用程序,並建立與調用這個外部WSDL服務,出於某些原因,BPEL項目(?BUG),複合應用程序服務組裝的XML(CASA)結合與空soapAction
參數生成:
<binding name="casaBinding1" type="ns:CCCheckerSoap">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="ValidateCardNumber">
<soap:operation soapAction="" style="document"/>
<input>
<soap:body use="literal"/>
</input>
一旦你複製適當的soapAction(http://www.webservicex.net/ValidateCardNumber)到這個參數,應用程序的測試案例將正確並返回預期的肥皂響應。
<soap:operation soapAction="http://www.webservicex.net/ValidateCardNumber" style="document"/>
所以,這是一個更具體的解決方案,我決定基於本博客文章中的信息記錄:http://bluebones.net/2003/07/server-did-not-recognize-http-header-soapaction/。
It means (at least in my case) that you are accessing a web service with SOAP and passing a SOAPAction parameter in the HTTP request that does not match what the service is expecting.
其他可以用來做同樣事情的工具是Fiddler和/或SoapUI。 – 2010-10-12 22:44:19
我用這個方法(Fiddler),發現我打了一個我的web服務的舊版本,它沒有包含我的新方法。我的Web.Config仍指向一箇舊的服務器。布萊什。 – Suamere 2014-06-16 19:17:24