Jump to content

Recommended Posts

Posted

Hi all,

 

I have a problem* (dont we all have)... so here's the story. I'm currently evaluating the feasibility of using Web Services rather than manually XSD and SOAP parsing solution that a system have. I have a problem that I have multiple definitions for the same class or enumerations but in different namespaces. So I would have something like:

 

namespace A {

***public enum Status {

*********Happy,

*********Sad,

*********Stressed,

*********BadlyDamagedBeyondRepair

***}

}

 

and

 

namespace B {

***public enum Status {

******Rich,

******Poor,

******Standard

***}

}

and maybe a class like

 

namespace C {

***public class EmployeeCondition {

*********private Status mood =*Status.Sad;

*********public Status Mood { get.. set..}

 

*********private*B.Status*monetary = B.Status.Poor;

*********public B.Status Monetary { get...set.. }

***}

}

 

then I have a web service that expose a web method:

 

public EmployeeCondition getEmployeeCondition ( String name ) {

*....

}

 

Now, my question is. Is this doable? Because when we are doing this via XSD, we used namespaces to avoid the naming problems. But it seems that .Net instead of creating new namespaces, it modifies the name of the class or enumerations (to Status1 for instance). If it is doable, can anyone tell me how?

 

My coleague tried to test this on Java and I havent really tried it in .net (coz he has the server, and I dont). But the result is that Java completely ignores the second Status class so that the second enum Status doesnt appear in the web service wsdl or in the class definitions. It just disappears... :s

 

Thanks in advance

 

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...