title: How can I change namespace prefix in this WSDL?
body: <p>I am trying to create a WSDL for a pre-existing web service. I have an existing client and and existing server, and I've captured the format both use using Wireshark. I am trying to write a new client that uses the same format. Therefore I am trying to match the format as closely as possible, be it correct or not. I'm cooking up a WSDL file using XmlSPY, which I hope then to take to C# and generate interface code.</p>
  
  <p>Here is my WSDL so far:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl" name="HelloService"&gt;
   &lt;message name="api:create"/&gt;
   &lt;message name="oanda:create"&gt;
    &lt;part name="parameter"/&gt;
    &lt;part name="parameter"/&gt;
   &lt;/message&gt;
   &lt;portType name="Oanda_PortType"&gt;
    &lt;operation name="create"&gt;
     &lt;input message="tns:oanda:create"/&gt;
     &lt;output message="tns:api:create"/&gt;
    &lt;/operation&gt;
   &lt;/portType&gt;
   &lt;binding name="Oanda_binding" type="tns:Oanda_PortType"&gt;
    &lt;soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
    &lt;operation name="create"&gt;
     &lt;soap:operation soapAction="sayHello"/&gt;
     &lt;input&gt;
      &lt;soap:body use="encoded"  namespace="oanda.fxtrade.api"/&gt;
     &lt;/input&gt;
     &lt;output&gt;
      &lt;soap:body use="encoded" namespace="oanda.fxtrade.api"/&gt;
     &lt;/output&gt;
    &lt;/operation&gt;
   &lt;/binding&gt;
   &lt;service name="Oanda_service"&gt;
    &lt;documentation&gt;WSDL File for Oanda FX Trade API (local SOAP server)&lt;/documentation&gt;
    &lt;port name="Oanda_port" binding="tns:Oanda_binding"&gt;
     &lt;soap:address location="http://10.0.0.3:18081"/&gt;
    &lt;/port&gt;
   &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>Here is a sample message I'm trying to copy. This is what the original client emits:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;SOAP-ENV:Header/&gt;
    &lt;SOAP-ENV:Body&gt;
      &lt;oanda:create xmlns:oanda="oanda.fxtrade.api"&gt;
        &lt;parameter&gt;FXGAME&lt;/parameter&gt;
        &lt;parameter&gt;&lt;/parameter&gt;
      &lt;/oanda:create&gt;
    &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Here is what XmlSPY says my WSDL will emit for the same message:</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
       &lt;SOAP-ENV:Body&gt;
        &lt;m:create xmlns:m="oanda.fxtrade.api"&gt;
         &lt;parameter/&gt;
         &lt;parameter/&gt;
        &lt;/m:create&gt;
       &lt;/SOAP-ENV:Body&gt;
      &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>My question for now is - how do I match the "oanda:" prefix generated by the original client? Is this what is called a namespace prefix? Where is the "m:" in my generated code coming from? I can find mentions of this in other examples on this site, but none using WSDL, at least as far as I can tell.</p>
  
  <p>Thank you for any help you can give.</p>
  
  <hr>
  
  <p>When I try to run the above WSDL through svcutil.exe, I get two problems.</p>
  
  <p>1) the XML is not well-formed since you can't have more than one parameter with the same name. XMLSpy was also complaining about this, so I punted on it for now by renaming them to Parameter1 and Parameter2.</p>
  
  <p>The specific error is: "More than one message part named 'parameter' was specified. Each message part must have a unique name."</p>
  
  <p>2) Once past this, I get this error:</p>
  
  <p>"Namespace prefix 'tns:oanda' is not defined."</p>
  
  <p>So, again: How do I change/add a namespace definition in a WSDL file?</p>