Optional & not required Fields in webservice

Hi All,

I have published my webservice as orchestration,

Everything is good till now,

But user wants a couple of fields as optional & not required (the process should not break if the fields are not present in request xml),

so,i made that element name to nillable to true & minoccurs to 0, as shown

But in wsdl it creates minoccurs=1, not sure why it sets minoccurs=1, when the published schema has minoccurs=0 !!

the following is the wsdl screenshot.


Please let me know what can i do for making the fields optional & not required.

thanks,

Sarva.

March 20th, 2015 5:30am

check by setting minoccurs = 0 an maxoccurs = 0
Free Windows Admin Tool Kit Click here and download it now
March 20th, 2015 5:47am

Hi Amit,

I tried your scenario for Field "New", and For Field "NewField", I made Nillable=false, MinOccurs =0 ,maxOccurs=0,when i check the wsdl, after building,gacking and republishing, i am shocked!!

MaxOccurs by default will take MaxOccurs=1 i guess,

By the way the requirement is The user request may contain these two fields,

if the user passes the new fields, biztalk should process them,

if they doesn't pass new fields also biztalk should work.

Thanks,

Sarva.

March 20th, 2015 6:20am

Hi Sarva,

I think it's a known issue with webservice. Refer the article: BizTalk SOAP Web Publishing Wizard does not properly sets the min and max occurs properties. I recommend to move to WCF! If not possible refer to the workaround mentioned in the link.

Rachit

Free Windows Admin Tool Kit Click here and download it now
March 20th, 2015 6:32am

Let's take a step back.

Are any clients actually going to use the WSDL?

Which Wizard are you using?

Can you do just an http POST?  Meaning not SOAP.

March 20th, 2015 8:10am

Hi John,

Yes, Clients use wsdl, to update their webserver.

i used "Biztalk webservices publishing wizard", through publish orchestration as webservice,

currently all other projects use SOAP,

I will have to check with client about this.(Using non SOAP), i will keep you posted.

Thanks,

Sarva.

Free Windows Admin Tool Kit Click here and download it now
March 20th, 2015 8:26am

Make sure you're using the BizTalk WCF Service Publishing Wizard.

Any previous Wizard is deprecated.


March 20th, 2015 8:53am

Hi,

If you have made changes in Schema you shouldn't worry.

Because validation of incoming message will only happen within the BizTalk where schemas are correct.

Also, instead of WebService Publishing wizard you should use WCF Publishing wizard.

This won't affect you in any manner, because even WCF service can accept SOAP message(basichttp).

So, I don't see any reason to not use WCF Publishing Wizard.

Free Windows Admin Tool Kit Click here and download it now
March 20th, 2015 12:19pm

Make sure you're using the BizTalk WCF Service Publishing Wizard.

Any previous Wizard is deprecated.


March 20th, 2015 12:52pm

Make sure you're using the BizTalk WCF Service Publishing Wizard.

Any previous Wizard is deprecated.


Free Windows Admin Tool Kit Click here and download it now
March 20th, 2015 12:52pm

First we will have to understand the issue.

Yes, this is an issue with BizTalk Web publishing wizard. But if you actual see it in practical terms, its not much of an issue. May be in some cases this could really cause an issue when client just use WSDL.

The MSND URL which Rachit has shared may out of date. Because as mentioned in the MSDN blog If you publish a schema that contains minOccurs or maxOccurs attributes with specific values, these values may be different in schema exposed by the published Web service No. Its not the exposed schema which will have different values for minOccurs or maxOccurs attributes, its only for the WSDL file which will have different values. If you actually see the schema from the virtual directory, this will correct minOccurs or maxOccurs attributes. This is why when anyone who access/consume the web service by WSDL, will also need to use schema while consuming. WSDL shall be used to access the operation name and data type (Schema) references whereas the actual definition for the data elements are accessed from schema.

March 20th, 2015 4:09pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics