Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <code>/sharetypes</code> option when calling <code>wsdl.exe</code>:</p> <blockquote> <p>/sharetypes Turns on type sharing feature. This feature creates one code file with a single type definition for identical types shared between different services (namespace, name and wire signature must be identical). Reference the services with http:// URLs as command-line parameters or create a discomap document for local files.</p> </blockquote> <p>If the classes match exactly, they should only be generated once if you generate code for both services in a single command. Both services will be using the same class, so no conversion will be necessary.</p> <h2>Edit:</h2> <p>If the XML namespaces do not match (which is a common occurrence), .NET will consider them to be different types, and rightly so. You will either have to fix the web services so the types are exactly the same (recommended), or do conversion between the two generated types. This will result in a lot of boring property assignment code, so you might want to consider using something like <a href="http://automapper.codeplex.com/wikipage?title=Custom%20Type%20Converters&amp;referringTitle=Home" rel="nofollow">AutoMapper</a> to handle the conversion for you.</p> <p>wsdl.exe should generate <a href="http://msdn.microsoft.com/en-us/library/wa80x488%28VS.80%29.aspx" rel="nofollow">partial classes</a>, so if you want, you can define implicit <a href="http://msdn.microsoft.com/en-us/library/85w54y0a.aspx" rel="nofollow">conversions</a> between the different types:</p> <pre><code>public static implicit operator addressTO1(addressTO source) { addressTO1 result = new addressTO1(); // Assign properties, etc. return result; } </code></pre> <p>I'm not usually a big fan of implicit conversions myself, but in this case it might be warranted.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload