휴! 좋아 ... 나는 내 Wcf/Linq 오류를 해결했다. (그리고 많은 것을 배웠다. 일련의 블로그 게시물은 다음 약점을 따를 것이다.) 이제 배포해야합니다. 우리는 Mosso/Rackspace 클라우드에서 실행되며, 환경은 부분 신뢰 환경에서 실행됩니다.중간/부분 신뢰 (Mosso)의 Wcf - 홀수 문제/구성 오류
간단하게 만들기 위해 Wcf 서비스에 아무 것도하지 않는 메소드를 추가했습니다.
public string Echo(string what)
{
return what;
}
나는 모두를 구축하고, 그래, 난 분명히 위험한 방법을 노출하기 전에 보안을 추가해야합니다 (관련 부분 만) 다음의 Web.config와 함께 테스트 서버에 출하하지만 지금은 내가 jsut는 익명의 물건을 실행 :
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicAnonymous">
<security mode="None"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="FooBar.Backend.Web.Services.CoreDataWcfServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="FooBar.Backend.Web.Services.CoreDataWcfServiceBehavior"
name="FooBar.Backend.Web.Services.CoreDataWcfService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicAnonymous" contract="FooBar.Backend.Web.Services.ICoreDataWcfService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://backend.FooBar.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>
그래서, 오프 제가 콘솔 응용 프로그램과 함께 할 수있는 가장 간단한 방법으로 전화로 이동합니다. 서비스 참조를 추가하고 잘 추가합니다. 그럼 난 ... (내가 간결 비활성 코드를했다)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreWcfHarness.CoreDataServiceReference;
namespace CoreWcfHarness
{
class Program
{
static void Main(string[] args)
{
var context = new CoreDataWcfServiceClient();
var echoval = context.Echo("Hello World!");
Console.WriteLine(String.Format("{0}\n", echoval));
Console.ReadKey();
}
}
}
그리고 갑자기 총성이 울 렸죠를 호출. 나는 예외로 치다.
System.ServiceModel.FaultException`1 was unhandled
Message="Request failed."
Source="mscorlib"
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at CoreWcfHarness.CoreDataServiceReference.ICoreDataWcfService.Echo(String what)
at CoreWcfHarness.CoreDataServiceReference.CoreDataWcfServiceClient.Echo(String what) in C:\PathToProject\corewcfharness\service references\coredataservicereference\reference.cs:line 1890
at CoreWcfHarness.Program.Main(String[] args) in C:\PathToProject\CoreWcfHarness\Program.cs:line 42
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
이것은 매우 간단합니다. 중형 트러스트 환경에 익숙하고 스택 트레이스에 능숙한 사람은 누구입니까?
감사합니다.
실제로, 올바른 위치에 도달하지 못했습니다. 신뢰 환경이 내 코드베이스를 싫어했습니다. ADO.NET 데이터 서비스를 리팩토링해야했습니다. –