在C#中发布了一个发布的WCF服务。之前它正在工作,但是当我在前几天检查它时,它给了我错误。
这是剪切后的代码,然后是错误..任何人都可以告诉我什么是错的?感谢。
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Vending : IVNService, IUSAService
{
//first method sent by VendNovation. Checks if the given student is allow to make vending purchases
//will be rejected if: student not found in system or student is marked inactive
public AuthenticateCustomerResult AuthenticateCustomer(AuthenticateCustomerRequest request)
.... .... .... ....
这是
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.NotSupportedException: A single WSDL document could not be generated for this service. Multiple service contract namespaces were found (http://vendnovation.com/, http://pos.usatech.com/). Ensure that all your service contracts have the same namespace.
at System.ServiceModel.Description.WsdlHelper.VerifyContractNamespace(List`1 wsdls)
at System.ServiceModel.Description.WsdlHelper.GetSingleWsdl(MetadataSet metadataSet)
at System.ServiceModel.Description.ServiceMetadataExtension.EnsureSingleWsdlInitialized()
at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleMetadataRequest(Message httpGetRequest, String[] queries, Message& replyMessage)
at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)
at SyncInvokeGet(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
被告知保持名称空间相同(vendnovation.com和pos.ustech.com),我的问题是为什么我们需要保持这两个名称相同?
这是我的代码IVNService.cs
[ServiceContract(Namespace = "http://vendnovation.com/")]
//[ServiceContract(Namespace = "http://vendnovation.com/"), XmlSerializerFormat]
public interface IVNService
{
..... ...... .....
,这是来自另一个代码IUSAService.cs
//[ServiceContract(Namespace = "http://pos.usatech.com/"), XmlSerializerFormat]
[ServiceContract(Namespace = "http://pos.usatech.com/")]
interface IUSAService
{
为什么我需要让它们保持相同的命名空间?