歐凱所以搜索3小時,並嘗試不同的選項之後,我不再有任何線索如何解決這個...外部Web服務「內部錯誤」
情況:
我們全國包拯救( Die Post)提供了用於檢查地址是否存在的web服務。 我聯繫了他們,收到了應用程序的用戶名和密碼以及.wsdl文件。
我對下載的文件做了服務引用,可以毫無問題地使用這些類。
現在的問題:
我們有以前的程序設計師設置了身份驗證和一切2個其他web服務,我只是複製從服務的一個粘貼代碼,一切都設置爲當前的,但是當我嘗試爲了得到答覆,我總是得到一個錯誤(內部錯誤),沒有更多的信息。
我找到一種方式來獲得最後的請求,並從請求到一個在了SoapUI(這工作完全正常),唯一的區別是,而不是「<soapenv:Header/>
」這是
<s:Header> <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://post.ch/AdressCheckerExtern/V4-01-00</Action> </s:Header>
當前的代碼是:
// Create Request
PostAdressChecker.AdressCheckerRequestType adrRequest = new PostAdressChecker.AdressCheckerRequestType()
{
Street = strStrasse,
HouseNbr = strHausnummer,
Zip = strPlz,
Town = strOrt,
Params = new PostAdressChecker.AdressCheckerRequestTypeParams()
{
CallUser = "TU_99660_0001",
SearchLanguage = "1",
MaxRows = "10",
SearchType = "10"
}
};
BasicHttpBinding basicBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport)
{
ReaderQuotas = { MaxStringContentLength = int.MaxValue },
MaxReceivedMessageSize = int.MaxValue,
SendTimeout = new TimeSpan(0, 2, 0)
};
PostAdressChecker.ACHePortTypeClient client;
client = new PostAdressChecker.ACHePortTypeClient(basicBinding, new EndpointAddress(strUrl));
client.Endpoint.Behaviors.Add(new PostSigningEndpointBehavior(strUsername, strPassword));
SoapTracer RequestInterceptor = new SoapTracer();
client.Endpoint.Behaviors.Add(RequestInterceptor);
try
{
PostAdressChecker.AdressCheckerResponseType adrResponse = client.AdrCheckerExterne(adrRequest);
}
catch (Exception ex)
{
strError = ex.ToString();
}
有沒有人有一個想法如何調試/解決這個問題? 非常感謝,並致以最誠摯的問候