4

I have a wsdl generated from XSD using WCSF Blue. I am using the service from a console application client. I am getting the following exception (SOAP?). What’s wrong in the wsdl? How can we correct it?

Header namespace mismatch in member UserCredentials of type RestaurantService.AddRestaurant.

The header namespace found in the description is urn:thinktecture-com:demos:restaurantservice:headerdata:v1.

The element namespace deduced by the formatter is urn:thinktecture-com:demos:restaurantservice:wsdl:v1.

This mismatch can happen if the Namespace specified in XmlElementAttribute or XmlArrayAttribute does not match the namespace specified in the MessageHeaderAttribute or MessageHeaderArrayAttribute or the contract namespace.

WSDL

enter image description here

Header Data

enter image description here

Community
  • 1
  • 1
LCJ
  • 22,196
  • 67
  • 260
  • 418
  • Please refer the following for complete WSDL http://programmers.stackexchange.com/questions/164471/writing-custom-message-formatter-for-soap-basichttpbinding Also.. Insights on WCF - IClientMessageFormatter– How to customize Messages on the client side https://wcfpro.wordpress.com/2011/02/15/iclientmessageformatter/ – LCJ Sep 11 '12 at 13:25
  • IOperationBehavior http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/12/wcf-extensibility-ioperationbehavior.aspx How to: Inspect or Modify Parameters http://msdn.microsoft.com/en-us/library/ms733747.aspx IOperationBehavior programmatically http://stackoverflow.com/questions/906398/where-is-the-right-place-to-add-ioperationbehavior-programmatically – LCJ Sep 11 '12 at 13:36

1 Answers1

0

I am planning to use the following approach:

  1. Verify all things mentioned in 400 Bad Request Exception: Simple SOAP WCF service with small data

The service code is generated from wsdl using a tool (WCSF blue). Using the service, when wsdl is generated it is slightly different. So,

  1. Try to create a client using the wsdl obtained by browsing the svc file. Refer the end point address in the config file in this new client. Verify that our client's adress is same as this client's address.
Community
  • 1
  • 1
LCJ
  • 22,196
  • 67
  • 260
  • 418