我創建了一個簡單的頭類:正確的XML爲緩存Web服務的SOAP頭髮送
Class Sample.Headers Extends %SOAP.Header
{
Parameter NAMESPACE = "http://tempuri.org";
Property UserName As %String;
}
在我提出一定要設置正確的命名空間中SOAPHEADERS
參數的Web服務:
Parameter SOAPHEADERS = "UserName:Sample.Headers";
我送使用了SoapUI以下XML:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org">
<soapenv:Header>
<tem:UserName>This is the header</tem:UserName>
</soapenv:Header>
<soapenv:Body>
<tem:Test>
<!--Optional:-->
<tem:argAge>10</tem:argAge>
</tem:Test>
</soapenv:Body>
</soapenv:Envelope>
我得到以下錯誤:
ERROR #6254: Tag expected, XML input, This is the header, is not in proper format as child of UserName (ending at line 3 character 18).
什麼是正確的XML格式,以便UserName設置正確?
我想他們的榜樣與命名空間,我仍然得到同樣的結果。 –