Is there any way to get a mandatory fields in SAP web services (wsdl).is it can be easily seen in wsdl page whether a particular field is mandatory in request parameters.and also in code after adding web reference how the mandatory fields can be identified
?...very urgent pls help....
I don't think so...cause as far as i remember the proxy class objects does not expose any properties like this...well still if it is there.. i would also like to know...
Please mark this post as Answer if it is of help to you!
I would love to change the world, but they wont give me the source code.
IsNullable corresponds to the nillable attribute rather than directly minOccurs (although it may affect minOccurs for different reasons). The proxy will then pass a node (if you send a null) with the attribute xsi:nil in it to indicate that the value
is null. When you have a parameter that's nillable, your method signature may change when calling the web service method. Example:
I have a similar issue. However by setting the IsNullable = true it appends nillable="true" in the wsdl for that element, is there a way to have a string field appear as mandatory in the wsdl
ie minOccurs=1 and nillable="false" ? because the field is supposed to be mandatory but it appears as optional in the wsdl and who ever sees the wsdl will have no way to know that it is a required field.
sjpk_2003
Member
21 Points
35 Posts
how to check mandatory fields in wsdl
Dec 02, 2009 04:46 PM|LINK
Is there any way to get a mandatory fields in SAP web services (wsdl).is it can be easily seen in wsdl page whether a particular field is mandatory in request parameters.and also in code after adding web reference how the mandatory fields can be identified ?...very urgent pls help....
kavita_khand...
Star
9767 Points
1930 Posts
Re: how to check mandatory fields in wsdl
Dec 03, 2009 05:03 AM|LINK
which ever element has minOccurs="1" is mandatory to pass.
I would love to change the world, but they wont give me the source code.
sjpk_2003
Member
21 Points
35 Posts
Re: how to check mandatory fields in wsdl
Dec 03, 2009 08:02 AM|LINK
ok thanks for r reply,i can see this min occurs in wsdl but ,is there any way to get this from code...
kavita_khand...
Star
9767 Points
1930 Posts
Re: how to check mandatory fields in wsdl
Dec 03, 2009 08:09 AM|LINK
I don't think so...cause as far as i remember the proxy class objects does not expose any properties like this...well still if it is there.. i would also like to know...
I would love to change the world, but they wont give me the source code.
naimish_hit
Member
282 Points
138 Posts
Re: how to check mandatory fields in wsdl
Dec 06, 2009 10:16 AM|LINK
Hi sjpk,
Declare your property / object like this:
[XmlElement(ElementName="person", IsNullable = true)]
public string PersonName;
You can control minOccurs by setting IsNullable property of XmlElement attribute, true means minOccurs=1.
Let me know if you need any further details on this.
ND
kavita_khand...
Star
9767 Points
1930 Posts
Re: how to check mandatory fields in wsdl
Dec 07, 2009 03:44 AM|LINK
@Namish
SHouldnt it be other way around...
and yes how to check for IsNullable= true in the code? I am curious to know as it is the attribute of the method.
I would love to change the world, but they wont give me the source code.
naimish_hit
Member
282 Points
138 Posts
Re: how to check mandatory fields in wsdl
Dec 07, 2009 04:58 AM|LINK
Hi Kavita,
As far as I know, IsNullable = true means minOccurs = 1. Again, this is true only for simple objects, for array declaration syntax defers.
I think one way to access IsNullable is by using Reflection, let me see if I can give you some example on it.
ND
mendhak
All-Star
17868 Points
2787 Posts
Re: how to check mandatory fields in wsdl
Dec 07, 2009 01:59 PM|LINK
IsNullable corresponds to the nillable attribute rather than directly minOccurs (although it may affect minOccurs for different reasons). The proxy will then pass a node (if you send a null) with the attribute xsi:nil in it to indicate that the value is null. When you have a parameter that's nillable, your method signature may change when calling the web service method. Example:
client.GetPatientRecords(fromDate, fromDateSpecified, toDate, toDateSpecified);
So you're actually passing in the parameters along with whether or not the parameters are specified.
Beta
Member
12 Points
8 Posts
Re: how to check mandatory fields in wsdl
Jun 28, 2012 04:12 PM|LINK
Hi,
I have a similar issue. However by setting the IsNullable = true it appends nillable="true" in the wsdl for that element, is there a way to have a string field appear as mandatory in the wsdl ie minOccurs=1 and nillable="false" ? because the field is supposed to be mandatory but it appears as optional in the wsdl and who ever sees the wsdl will have no way to know that it is a required field.
any help on this is highly apprecaited.