BizTalk Web Reference - created by XSD has "lost" information from WSDL

I am using BizTalk 2006 R2 to create a web link from a WSDL file.

Comparing the generated XSD with the WSDL, it is obvious that most of the information has been lost.

Consider the following excerpt from WSDL:

<s:element form="unqualified" minOccurs="0" maxOccurs="4" name="Applicant"> <s:complexType> <s:sequence> <s:element form="unqualified" minOccurs="1" maxOccurs="1" name="ApplicantIdentifier"> <s:simpleType> <s:restriction base="s:string" /> </s:simpleType> </s:element> <s:element form="unqualified" minOccurs="0" maxOccurs="1" name="Name"> <s:complexType> <s:sequence> <s:element form="unqualified" minOccurs="0" maxOccurs="1" name="Title"> <s:simpleType> <s:restriction base="s:string"> <s:maxLength value="10" /> </s:restriction> </s:simpleType> </s:element> <s:element form="unqualified" minOccurs="0" maxOccurs="1" name="Forename"> <s:simpleType> <s:restriction base="s:string"> <s:pattern value="[0-9A-Za-z \-]*" /> <s:maxLength value="15" /> <s:minLength value="1" /> </s:restriction> </s:simpleType> </s:element> <!-- more --> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> 

Equivalent XSD generated by BizTalk:

 <xs:element minOccurs="0" maxOccurs="unbounded" form="unqualified" name="Applicant"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="ApplicantIdentifier" type="xs:string" /> <xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="Name"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="Title" type="xs:string" /> <xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="Forename" type="xs:string" /> <!-- more --> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> 

So, XSD lost the constraint patterns and set its own values โ€‹โ€‹for minOccurs and maxOccurs.

I need to map from another source to XSD, and I want to catch data that does not match WSDL at this point.

Does anyone know why BizTalk did not retain the restrictions in XSD; or how can i generate lossless xsd?

+6
wsdl xsd biztalk biztalk2006r2
source share
2 answers

If you do not perform schema validation in the BizTalk pipeline, the constraints and maxoccurs> 1 will not actually do anything - they are not used by BizTalk at run time. I assume this is the reason the web link is lost.

I personally never liked the add web link feature or even add adapter metadata / WCF. If your wsdl changes, there is often too much to manually copy type definitions to the xsd file:

a) look at creating a simple console application to extract wsdl, extract the type and update the xsd file (release it from the menu of external tools in VS) and

b) find out what is happening with your development process, which often requires changes to service contracts!

+1
source share

Have you tried using the WCF adapter instead of โ€œadd web linkโ€ to do this?

Here is an example ...

http://blogs.digitaldeposit.net/SARAVANA/post/2007/05/31/BizTalk-2006-R2-consume-an-ASMX-webservice-using-WCF-BasicHttp-adapter.aspx

0
source share

All Articles