1
Answer

Wcf messagecontract and messagebodymember

Hi, I'm looking for a way to specify that some MessageBodyMember is required,
so that the generated schema would have minOccurs=1 instead of minOccurs=0.
 
I know that the DataMember has such an option(IsRequired=true), however I prefer using the MessageContract for controlling other aspects of the message.
  1. [MessageContract(IsWrapped = true, WrapperName = "CityRequestObject")]  
  2. public class CityInfoRequest  
  3. {  
  4. [MessageHeader]  
  5. public string UserKey { getset; }  
  6. [MessageHeader]  
  7. public string TransactionID { getset; }  
  8. [MessageHeader]  
  9. public string EntityCode { getset; }  
  10. [MessageBodyMember]  
  11. [System.Xml.Serialization.XmlElementAttribute(IsNullable = true, Form = System.Xml.Schema.XmlSchemaForm.Qualified, Order = 0)]  
  12. public string Lang { getset; } }  

Answers (1)

0
Photo of Vulpes
NA 98.3k 1.5m 13y
None of those functions are anything to do with ASP.NET as such though they can be called from it (using the Platform Invoke mechanism in the case of the first two).

Briefly:

* LoadLibrary is an unmanaged function which loads a dll into a process's address space.

* CoCreateInstance is an unmanaged funmction which creates a COM object using its Class Id (CLSID).

* CreateObject is a VB library function which creates a COM object using its Program Id (ProgID).

* Assembly.Load is a .NET method which loads an assembly at runtime.