Wcf BizTalk REST调用仅在Fiddler运行时有效

Wcf BizTalk REST调用仅在Fiddler运行时有效,wcf,oauth,http-headers,biztalk,fiddler,Wcf,Oauth,Http Headers,Biztalk,Fiddler,我有一个BizTalk 2013r2应用程序,它有一个使用WCF WebHttp适配器的请求-响应发送端口。发送端口使用我开发的自定义WCF行为来附加OAuth授权头,可以看到这方面的详细信息。当从我的Azure dev vm运行时,所有这些都非常有效,但我刚刚在prem BizTalk server上第一次运行,这是它在运行时需要运行的地方,我遇到了一个问题 通过调整发送端口适配器配置页面“代理”选项卡中的设置,我尝试了以下场景: 通过公司代理-失败 直接指向目标web服务,无代理-失败 通

我有一个BizTalk 2013r2应用程序,它有一个使用WCF WebHttp适配器的请求-响应发送端口。发送端口使用我开发的自定义WCF行为来附加OAuth授权头,可以看到这方面的详细信息。当从我的Azure dev vm运行时,所有这些都非常有效,但我刚刚在prem BizTalk server上第一次运行,这是它在运行时需要运行的地方,我遇到了一个问题

通过调整发送端口适配器配置页面“代理”选项卡中的设置,我尝试了以下场景:

  • 通过公司代理-失败
  • 直接指向目标web服务,无代理-失败
  • 通过小提琴作品
  • 到本地模拟服务(由SoapUi托管)-工作
如果请求是通过公司代理或直接(已创建网络规则以允许此操作)发出的,则我会收到EndpointNotFound异常

针对失败的请求运行WCF跟踪时,我得到以下“消息日志跟踪”:

不久之后:

第二个请求似乎与第一个请求相同,只是添加了一个Addressing元素,并包含一个空Action元素。我可以看到第二个日志的source=TransportSend,而第一个日志的source=ServiceLevelSendRequest。紧接着第二个日志,我看到了异常:

<ExceptionType>System.ServiceModel.EndpointNotFoundException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>There was no endpoint listening at https://api-sandbox.tradeshift.com/tradeshift/rest/external/documents/dispatcher/?documentId=66553703-4f22-4294-9a28-1f3ecb22fcf2&documentProfileId=tradeshift.order.1.0 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.</Message>
<StackTrace>
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStreamAsyncResult.CompleteGetRequestStream(IAsyncResult result)
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStreamAsyncResult.OnGetRequestStream(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.HttpWebRequest.SetResponse(Exception E)
at System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult returnResult)
at System.Net.Connection.CompleteConnectionWrapper(Object request, Object state)
at System.Net.PooledStream.ConnectionCallback(Object owningObject, Exception e, Socket socket, IPAddress address)
at System.Net.ServicePoint.ConnectSocketCallback(IAsyncResult asyncResult)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
System.ServiceModel.EndpointNotFoundException,System.ServiceModel,版本=4.0.0.0,区域性=neutral,PublicKeyToken=b77a5c561934e089
没有端点在侦听https://api-sandbox.tradeshift.com/tradeshift/rest/external/documents/dispatcher/?documentId=66553703-4f22-4294-9a28-1f3ecb22fcf2&documentProfileId=tradeshift.order.1.0,可以接受该消息。这通常是由不正确的地址或SOAP操作引起的。有关更多详细信息,请参阅InnerException(如果存在)。
位于System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStreamAsyncResult.CompleteGetRequestStream(IAsyncResult结果)
位于System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStreamAsyncResult.OnGetRequestStream(IAsyncResult结果)
在System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult结果)中
在System.Net.LazyAsyncResult.Complete(IntPtr userToken)中
位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext、ContextCallback回调、对象状态、布尔值preserveSyncCtx)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态,布尔保存SyncCTX)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
在System.Net.ContextAwareResult.Complete(IntPtr userToken)
在System.Net.HttpWebRequest.SetResponse中(异常E)
在System.Net.ConnectionReturnResult.SetResponses处(ConnectionReturnResult)
位于System.Net.Connection.CompleteConnectionWrapper(对象请求、对象状态)
位于System.Net.PooledStream.ConnectionCallback(对象所有者对象、异常e、套接字套接字、IP地址)
位于System.Net.ServicePoint.ConnectSocketCallback(IAsyncResult asyncResult)
在System.Net.LazyAsyncResult.Complete(IntPtr userToken)中
在System.Net.ContextAwareResult.Complete(IntPtr userToken)
位于System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32错误代码,UInt32个字节,NativeOverlapped*NativeOverlapped)
在System.Threading.\u IOCompletionCallback.PerformiCompletionCallback(UInt32错误代码,UInt32个字节,本机重叠*pOVERLAP)
在我通过Fiddler发出请求的地方,我看到了相同的两个出站日志,一个用于ServiceLevelSendRequest,另一个用于TransportSend。然后,我看到TransportReceive后跟ServiceLevelReceiverReply,两者都包含一个HttpResponse元素


如果您能给我一些建议来解决这个问题,我将不胜感激,这样您就可以通过公司代理或直接提出请求——坚持认为在实时服务器上运行Fiddler并不是一个真正的选择

今天上午与一位能够在公司代理上运行跟踪的局域网工程师进行了一次精彩的会谈。我们进行了以下测试:

  • 发送了彻底的fiddler-成功了,可以看到fiddler通过公司代理路由
  • 关闭小提琴手,重试测试-失败,但工程师看不到任何痕迹
  • 脸掌!我意识到我仍然将fiddler的发送端口代理设置为127.0.0.1:8888
  • 将发送端口更改为使用公司代理-成功了
    工程师注意到从api-sandbox.tradeshift.com返回的目标ip地址确实有所不同。所以看起来他们这边的负载是平衡的。我们的公司防火墙没有每个服务器的地址,因此这也许可以解释为什么我上周无法通过我们的公司代理让BizTalk工作。

    通过Fiddler发出的请求有地址吗?对不起,科林,我的帖子不太好-希望我的编辑已经澄清了。如果你试图访问本地端点,它能工作吗?像internal一样,根本没有代理?Hi@Johns-305,我使用SoapUI创建了目标web服务的模拟。然后,我将发送端口的地址更改为指向本地模拟(使用http而不是https)。请求工作正常,模拟响应被返回。我仍然感到困惑,但我认为问题可能与颁发的证书有关——尽管这似乎是有效的