2
我遇到了一個我正在編寫的Web服務(它是asmx)的問題。未從SOAP請求中讀取參數
我有這樣的方法:
[WebMethod()]
[SoapDocumentMethod(
RequestNamespace="http://bsp.XXX.org",
ResponseNamespace="http://bsp.XXX.org",
ResponseElementName="PaymentResults",
RequestElementName="GetPaymentResult",
Action = "http://bsp.XXX.org/GetPaymentResult")]
public PaymentResult[] GetPaymentResult(string MerchantRef)
{
try
{
if (!String.IsNullOrEmpty(MerchantRef))
{
return PaymentResultRepository.GetPaymentResults(MerchantRef).ToArray();
}
else
{
_errorLog.Error("MerchantRef is empty");
}
}
catch (Exception ex)
{
_errorLog.Error("Failed to get payment details", ex);
}
return new PaymentResult[0];
}
}
而且它被稱爲從Oracle Forms應用程序。接收到的SOAP請求是:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<GetPaymentResult xmlns="http://bsp.XXX.org/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<MerchantRef xsi:type="xsd:string">
IP/58991/1
</MerchantRef>
</GetPaymentResult>
</SOAP-ENV:Body>
的問題是,「MerchantRef」總是在我的方法一個空字符串...任何人對此有任何想法? SOAP請求是否錯誤?我錯過了明顯的東西嗎?