views:

282

answers:

1

Is there a way to make a C#/.NET web service which normally produces XML like this

<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/"&gt;
<soap:Header>
 <DHeader xmlns="http://www.abc.com" />
</soap:Header>
  <soap:Body>
    <Response xmlns="http://www.abc.com"&gt;
      <Result>
        <ErrorObject ObjectID="string" ErrorCode=""  />          
      </Result>
     </Response>
   </soap:Body>
</soap:Envelope>

to produce XML like this.

<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/"&gt;
  <soapv:Header>
    <DHeader xmlns="http://www.abc.com" />
  </soapenv:Header>
  <soapenv:Body>
    <Response xmlns="http://www.abc.com"&gt;
      <Result>
        <ErrorObject ObjectID="string" ErrorCode=""  />          
      </Result>
    </Response>
  </soapenv:Body>
</soapenv:Envelope>

This trying solve a problem with an AXIS client consuming a .NET web service. AXIS is choking on the soap namespace and needs a soapenv namespace. Changing the AXIS side is not possible.

any thoughts or comments would be great.

Here is the exact error as requested.

line -1: Element Envelope@http://www.w3.org/2003/05/soap-envelope is not a valid Envelope@http://schemas.xmlsoap.org/soap/envelope/ document or a valid substitution. 
A: 

soapenv is not a namespace - it's a namespace prefix.

As long as the prefixes refer to the same namespace, soap and soapenv refer to the same thing, and have the identical meaning.

It seems extremely unlikely that any version of AXIS is so badly broken as to treat the prefixes specially. You should assume you have a different problem. Please post the exact error you're receiving.

John Saunders
This what they are getting. line -1: Element Envelope@http://www.w3.org/2003/05/soap-envelope is not a valid Envelope@http://schemas.xmlsoap.org/soap/envelope/ document or a valid substitution. Also thanks for the correction on the prefix namespace thing.
cbg
The XML you posted does not use the "w3.org/2003/05/soap-envelope" namespace. The XML you posted would not give you this error. Try sending the XML you posted here.
John Saunders