Friday, July 6, 2007

You receive 'Type messagename cannot be found in namespace servicename' error using the WSE adapter

Problem

In some scenarios, the BizTalk Adapter for WSE Schema Generation Wizard may not generate an XML Schema definition language (XSD) schema or an orchestration as expected.

Cause

The wizard has a problem in the way it generates schemas and orchestrations.

Resolution

Obtain the Microsoft BizTalk Adapter for Web Services Enhancements (WSE) 2.0 Service Pack 2006 update. In addition to the problem stated above, it addresses the following issues:

· The BizTalk Adapter for WSE 2.0 now supports long schema names. Before you install this service pack, the BizTalk Adapter for WSE 2.0 uses the target namespace for the schema as the file name. Therefore, some Web services may not be usable because of long file names. After you install this service pack, the BizTalk Adapter for WSE 2.0 creates shorter file names that are unique.

· The BizTalk Adapter for WSE 2.0 now imports schemas correctly. This includes schemas that include the schemaLocation attribute.

· The BizTalk Adapter for WSE 2.0 now propagates information correctly if the response pipeline fails in solicit-response operations.

· The BizTalk Adapter for WSE 2.0 now returns an exception error message correctly when a pipeline failure occurs or when an unhandled pipeline exception occurs.

· The BizTalk Adapter for WSE 2.0 now follows the policy when a message is signed.

Source: Microsoft

I am receiving errors when consuming a Web service; how can I avoid them?

There are many details to consider when consuming a Web service, including the following:

· Avoid using two underscore characters in a parameter name.

· Use of the any element or the anyAttribute attribute is not supported in Web methods.

· Avoid using XLANG/s keywords as a Web service name or Web method name.

· Avoid using Web method parameter types that are not supported by XLANG/s.

· Do not use element names that are C# keywords or will be invalid as a C# identifier in your schemas.

· Avoid Web Services Description Language (WSDL) files with multiple service or port type definitions.

· Web method parameters must be Xml Serializable.

· Avoid references to consumed Web services that contain multi-rooted schemas.

· Avoid referencing Web services with Web methods expecting generic-based parameters such as nullable parameters.

· The WSDL import element is not supported.

Source: Microsoft

Using the ThrowDetailedError switch

If an error occurs, the Web client receives a generic SoapException.

To debug your published Web service, you can add a switch to the web.config file to control the level of the exception details returned from the published Web service. The switch is ThrowDetailedError, and when it is set to True the server proxy returns inner exception information to the Web client, enabling you to debug the published Web service.

The following XML code shows the ThrowDetailedError switch that appears in the web.config file under the appSettings node:


<appsettings>
<add key="ThrowDetailedError" value="False">
<appsettings>

Warning

The inner exception may contain sensitive information. After debugging, you should set the ThrowDetailedError switch to False.

Source: Microsoft