BizTalk WCF-WebHttp适配器发送空的json请求数据时,它不应该... [英] BizTalk WCF-WebHttp adapter sending empty json request data when it shoudn't be...
问题描述
我有一个使用WCF-WebHttp适配器发送端口调用json Web服务的编排。请求消息格式
是json,响应消息格式也是json。创建了一个带有JSON编码器的自定义发送管道。
使用网络监视器观察流量后,我发现
json请求数据的内容长度为0(零)。
After observing the traffic using Network Monitor, I observed that the json request data's content length is 0 (zero).
我还使用相同的自定义发送管道将相同的消息副本(请参阅下图)发送到FILE适配器。
I also sending the same copy of the message (refer to the diagram below) to a FILE adapter using the same custom send pipeline.
以下是json请求数据(来自FILE适配器)我也创建了一个简单的程序将同一组数据发送到同一个json Web服务,没有问题。
Below is the json request data (from the FILE adapter) and I also create a simple program to send this same set of data to the same json web service with no issue.
{
" service_header" ;: {
" request_id":" 7829d13989118b339f6bd57e3fd11964",
   " request_timestamp":" 11022016 16:47:50",
的    " request_ip":" 10.2.1.10",
    " consumer_id":" BIZ-001"
  ; },
"有效负载":{
" can":" 1008201525112014"
}
}
---------------------------
---------------------------
下面是使用相同发送文件适配器(没有JSON编码)的请求数据,
并且可以正确验证此数据请求架构。
< ns0 :QueryCardDetails xmlns:ns0 =" http://xxx.BizTalk.xxx.Schemas.S01_QueryCardDetails_JsonRequest">< service_header>< request_id> 57b8732a3dbaae172ea0ea3f0d503ac2< / request_id>< request_timestamp> 11022016
16:37: 49 LT; / request_timestamp>< request_ip> 10.2.1.10< / request_ip>< consumer_id> BIZ-001< / consumer_id>< / service_header><有效载荷GT;<可> 1008201 525112014< / can>< / payload>< / ns0:QueryCardDetails>
<ns0:QueryCardDetails xmlns:ns0="http://xxx.BizTalk.xxx.Schemas.S01_QueryCardDetails_JsonRequest"><service_header><request_id>57b8732a3dbaae172ea0ea3f0d503ac2</request_id><request_timestamp>11022016
16:37:49</request_timestamp><request_ip>10.2.1.10</request_ip><consumer_id>BIZ-001</consumer_id></service_header><payload><can>1008201525112014</can></payload></ns0:QueryCardDetails>
--------------------------
--------------------------
WCF-WebHttp适配器属性设置如下: />
在常规标签中:
The WCF-WebHttp adapter properties set as below:
In General tab:
HTTP方法和网址映射: -
HTTP Method and URL Mapping:-
< BtsHttpUrlMapping>
< Operation Name =" QueryCardDetails"方法= QUOT; POST"地址=" / WS /卡/信息" />
< / BtsHttpUrlMapping>
在消息标签中:
In Message tab:
--------------- --------------------
-----------------------------------
我很奇怪为什么json请求数据的内容长度为零。
I'm puzzle why the content length of the json request data is zero.
我确实尝试了一个程序直接成功调用json Web服务。
I did try a program to call the json web service directly with success.
根据网络监视器,我注意到
Based on the network monitor, i notice the
对于正在调用的biztalk,contentlength为0(参考第2部分)。
that the contentlength is 0 for biztalk that is calling (refer to the 2nd part).
推荐答案
你的情景让我感到困惑。这些步骤似乎是正确的。虽然我确实阅读了这篇文章 https://biztalkinfo.wordpress。 com / tag / json-encoder / 其中
该人使用Newtosoft并使用JSON对象创建了他的请求。
Your scenario left me puzzled as well. To the steps seem correct. Although I did read this post https://biztalkinfo.wordpress.com/tag/json-encoder/ where the person used Newtosoft and created his request with a JSON object.
亲切的问候,
Steef-Jan Wiggers(Microsoft Azure MVP)
Steef-Jan Wiggers (Microsoft Azure MVP)
这篇关于BizTalk WCF-WebHttp适配器发送空的json请求数据时,它不应该...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!