Last post Jul 26, 2013 04:38 AM by Steven Cheng - MSFT
Jul 23, 2013 07:38 AM|j.keulen|LINK
I've succesfully created a standard interface to a well known Document Management System using SOAP-XML. The standard WSDL issued by the manufacturer contains a basic set of classes including methods and properties.
So far so good. However, the DMS is based on a standard model which means that customers are free to add non-standard features. For example, the method "GetDocument" returns a document object with several properties with corresponding values. During reception
of the message, VB.Net raises an execption stating that there is an invalid property value in the message. This is correct, the value is not in the standard WSDL (used in our development service reference) but is available in the .asmx file on the customers
webserver. I am looking for an elegant and flexible way to deal with non-standard messages at my customers' sites without recompiling the application.
Jul 23, 2013 07:42 AM|ramu.net|LINK
Can you reproduce your code so that I will help you better.
Jul 24, 2013 07:17 AM|j.keulen|LINK
Here is the part of the WSDL that causes errors:
<s:enumeration value="Telefonisch" />
<s:enumeration value="Mondeling" />
<s:enumeration value="Schriftelijk" />
<s:enumeration value="Eigen_waarneming" />
<s:enumeration value="_Nog__niet_bekend" />
<s:enumeration value="Doorgestuurde_melding" />
<s:enumeration value="E_mail" />
<s:enumeration value="Webformulier" />
This is the standard WSDL, used as Service Ref in our application (VB.Net 2012). In one of my clients configurations, the webservice sends the value "Brief" back which is not in the list.
If you need more code, please specify.
Jul 26, 2013 04:38 AM|Steven Cheng - MSFT|LINK
I think such kind of compatible issue does occurs whenever either service or client-side has involved some non-standard changes.
Personally, I would suggest you consider the following options:
1) Since the error is due to the generated client proxy type (the certain classes to mapping the WSDL schema types) doesn't match the data be received at runtime, we can consider manually adjust the generated code (via Add WebReference or Add ServiceReference).
Or we can use Wsdl.exe or Svcutil.exe tool to generate the client service proxy at commandline and modify the generated code accordingly.
2) Both ASP.NET ASMX webservice or WCF service provides means to intercept the underlying raw SOAP message and modify it (before the runtime deserialize it into .NET code objects). For example, ASMX webservice provide SoapExtension to do such work. While
WCF provide message inspector or message encoder to do so. But creating such an extension component is complicated and will cost more effort.
3) In some cases, if the webservice is not too complicated and large, we can consider using raw HttpWebRequest or HttpClient (.NET 4.5) classes to consume it. We can send the raw HTTP POST with SOAP XML content and receive the raw SOAP XML response. Thus,
we can use .NET XML processing components (such as LINQ to XML) to process the response XML data.