Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Wednesday, March 28, 2012

Change Object name in generated WSDL

Good day,

I have a Web Method that uses a simple custom object, name Client, as a parameter, and also returns a Client.

However, in the generated WSDL, I want "element name="Client" " to be changed to "element name="THE_CLIENT", but without changing the class name.

Is there a way to specify that an object should have another name in the wsdl, Something like [WebMethod(Description="DESCRIPTION")], but for a class?

Thank you, have a nice day!

Hi,

I think this link provide all information you need:http://msdn2.microsoft.com/en-us/library/2baksw0z.aspx

By default, an XML element name is determined by the class or member name. In a simple class named Book, a field named ISBN will produce an XML element tag <ISBN>, as shown in the following example.

Visual Basic

Copy Code

PublicClass BookPublic ISBNAsStringEndClass' When an instance of the Book class is serialized, it might' produce this XML:' <ISBN>1234567890</ISBN>.

C#

Copy Code

publicclass Book{publicstring ISBN;}// When an instance of the Book class is serialized, it might// produce this XML:// <ISBN>1234567890</ISBN>.

This default behavior can be changed if you want to give the element a new name. The following code shows how an attribute enables this by setting theElementName property of aXmlElementAttribute.

Visual Basic

Copy Code

PublicClass TaxRates < XmlElement(ElementName ="TaxRate")> _Public ReturnTaxRateAsDecimalEndClass

C#

Copy Code

publicclass TaxRates{ [XmlElement(ElementName ="TaxRate")]public decimal ReturnTaxRate;}

For more information about attributes, seeExtending Metadata Using Attributes. For a list of attributes that control XML serialization, seeAttributes That Control XML Serialization.

Best Regards

Saturday, March 24, 2012

CascadingDropDown With more then one parameter?

I am trying to use the CascadingDropDown drop down extender in a DataView.

I have three drop-downs where ddl1 contains the main lookup value. When I select ddl1, the second dropdown ddl2 populates perfectly. The problem that I have however is that the 3rd drop down is dependent on both the selected value in ddl1 and another value/column in the row. Does anyone know whether this is achievable with the CascadinDropDown extender at all? I guess i need a way to make the web service have more parameters and a way to pass the parameters to the webservice.

Any help would be highly appreciated!!

Does anyone know how I can get the Cascading DropDowns to have more then one parent id. I really need to figure out how to make the third drop down populate based on the value selected in the 1st drop down and another value from the grid... this must be acheivable.. I can't be the only one trying to do this...


Sorry, this scenario is not currently supproted by CDD.