in Education by
Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code. Over simplified example: public class Name { public string FirstName {get; set;} public string Surname { get; set; } public override string ToString() { return string.Concat(FirstName, " ", Surname); } } I don't want to have recode pieces of functionality in my class. The other thing is that any code that exists that manipulates this class won't work client side as the client side class that is generated would be a different type. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Okay, I see know that this has been an explicit design decision on the part of SOAP so you're not actually supposed to do this. I found the following page that explains why: Services share schema and contract, not class. Services interact solely on their expression of structures through schemas and behaviors through contracts. The service's contract describes the structure of messages and ordering constraints over messages. The formality of the expression allows machine verification of incoming messages. Machine verification of incoming messages allows you to protect the service's integrity. Contracts and schemas must remain stable over time, so building them flexibly is important. Having said that there are two other possibilities: Generate the the web references in Visual Studio or using wsdl.exe. Then go into the generated Reference.cs (or .vb) file and delete the type explicitly. Then redirect to the type that you want that is located in another assembly. You can share types between web services on the client side by wsdl.exe and the /sharetypes parameter.

Related questions

0 votes
    What are the common types of trade barriers? Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    I have two tuples -- TypeSets modeled as tuples, and thus guaranteed to contain each type at maximum once ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me what are the most common types of Machine Learning tasks? Select the correct answer from above options...
asked Jan 11, 2022 in Education by JackTerrance
0 votes
0 votes
    Which of the following can be used to create the most common graph types? (a) qplot (b) quickplot (c ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Which of the following can be used to create the most common graph types? (a) qplot (b) quickplot (c) plot (d) all of the mentioned...
asked Oct 5, 2021 in Technology by JackTerrance
0 votes
    Name some common assignment types in the SAP Material Management system?...
asked Mar 14, 2021 in Technology by JackTerrance
0 votes
    What are common types of Schema’s used in websites?...
asked Mar 5, 2021 in Technology by Editorial Staff
0 votes
    What are the common built-in data types in Python?...
asked Dec 6, 2020 in Technology by JackTerrance
0 votes
    I'm getting below error while fetching a response from SOAP service from a java client: [javax.xml.bind ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I am trying to make requests to dedicated WSDL server with the help of Apache Camel CXF. I have ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
0 votes
    Why is it not a good idea to use SOAP for communicating with the front end? For example, a web ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Why is it not a good idea to use SOAP for communicating with the front end? For example, a web ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Why is it not a good idea to use SOAP for communicating with the front end? For example, a web ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I was working with SOAP to access web service. my question is how to retrieve the value returned from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
...