4
有沒有一種方法,使通常會產生這樣的如何讓C#web服務產生soapenv命名空間而不是soap?
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<DHeader xmlns="http://www.abc.com" />
</soap:Header>
<soap:Body>
<Response xmlns="http://www.abc.com">
<Result>
<ErrorObject ObjectID="string" ErrorCode="" />
</Result>
</Response>
</soap:Body>
</soap:Envelope>
XML生成XML這樣的C#/。NET Web服務。
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapv:Header>
<DHeader xmlns="http://www.abc.com" />
</soapenv:Header>
<soapenv:Body>
<Response xmlns="http://www.abc.com">
<Result>
<ErrorObject ObjectID="string" ErrorCode="" />
</Result>
</Response>
</soapenv:Body>
</soapenv:Envelope>
此嘗試解決了使用.NET Web服務的AXIS客戶端的問題。 AXIS在soap命名空間上窒息,需要一個soapenv命名空間。改變AXIS方面是不可能的。
任何想法或意見將是偉大的。
這是根據要求的確切錯誤。
line -1: Element [email protected]://www.w3.org/2003/05/soap-envelope is not a valid [email protected]://schemas.xmlsoap.org/soap/envelope/ document or a valid substitution.
這就是他們得到的。 line -1:Element Envelope @ http://www.w3.org/2003/05/soap-envelope不是有效的Envelope @ http://schemas.xmlsoap.org/soap/envelope/文檔或有效的代換。 也感謝對前綴命名空間事物的更正。 – cbg 2010-02-24 23:59:57
您發佈的XML不使用「w3.org/2003/05/soap-envelope」命名空間。你發佈的XML不會給你這個錯誤。嘗試發送您在此發佈的XML。 – 2010-02-25 00:46:33
這意味着它是不可能的? – 2015-01-16 03:55:58