Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4625190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:14:11+00:00 2026-05-22T03:14:11+00:00

I wrote a few SOAP Webservices in Java, running on a JBoss 5.1. Two

  • 0

I wrote a few SOAP Webservices in Java, running on a JBoss 5.1.
Two of them share a class, AddressTO. The Webservices are deploying correctly on my ApplycationServer and all went well until I try to use the class addressTO in my C#-client. There are two types in the client application, addressTO and addressTO1. This is a problem because this causes errors like:

    Fehler  1   Eine implizite Konvertierung vom Typ 
    "acsysteme.i4workspace.client.webservices.addressTO1[]" in 
    "acsysteme.i4workspace.client.webservices.addressTO[]" ist nicht möglich.   
    [...]

This means that it is impossible to cast the to types implicitly.
AddressTo is something like a core class which can be used by other webservices.

The webreferences for the C#-client are created by the command

    wsdl.exe /parameters:CreateWebService.xml

The xml-file contains the urls to the differend .wsdl-files of my webservices.

Does someone know how to handle this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:14:12+00:00Added an answer on May 22, 2026 at 3:14 am

    Use the /sharetypes option when calling wsdl.exe:

    /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.

    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.

    Edit:

    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 AutoMapper to handle the conversion for you.

    wsdl.exe should generate partial classes, so if you want, you can define implicit conversions between the different types:

    public static implicit operator addressTO1(addressTO source)
    {
        addressTO1 result = new addressTO1();
        // Assign properties, etc.
        return result;
    }
    

    I’m not usually a big fan of implicit conversions myself, but in this case it might be warranted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote few custom view helpers but I have a little trouble using them.
I wrote few lines of code which doesn't work correctly. Why? Could sb explain
Back in VB6, I wrote a few functions that would let me code without
I've got quite a few GreaseMonkey scripts that I wrote at my work which
I wrote a few custom workflow activities and from the browser i used several
I wrote a few assumptions regarding Entity Framework, then a few questions (so please
I wrote a few unittests with shelve at http://code.google.com/p/filecache/ and python 2 saves exactly
i'm reading through jQuery's Plugins/Authoring though i already wrote a few jQuery-Plugins. Now I
I've got to write few words about C#, generally piece of cake? No! I've
By code snippet execution, I mean the ability to write a few lines of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.