.NET WCF无法解码“Chunked”响应

时间:2009-05-06 15:39:43

标签: .net wcf http soap transfer-encoding

我从WCF调用一个轴Web服务。请求工作得很好但我得到了返回null值。使用Fiddler,我能够确定响应是基于Transfer-Encoding:chunked。这意味着在xml之前的响应中有控制字符。 WCF不会抛出错误。它只是继续前进,而Method应该返回的对象为null。谁能告诉我如何告诉WCF如何正确处理HTTP 1.1分块编码消息?

这是指向某人询问similer问题的链接:

http://www.biztalkgurus.com/forums/t/10860.aspx

肥皂反应:

HTTP/1.1 200 OK
Date: Wed, 06 May 2009 15:34:41 GMT
Server: Apache
Set-Cookie: JSESSIONID=01A43C26DB5E284B70F1F6D466D5CD5D; Path=/arsys
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml;charset=utf-8

ba7
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns0:HelpDesk_QueryList_ServiceResponse xmlns:ns0="urn:Port" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns0:getListValues>
        <ns0:Assigned_Group>CHQ-TSR-WEL</ns0:Assigned_Group>
        <ns0:Assigned_Group_Shift_Name/>
        <ns0:Assigned_Support_Company>IT Support</ns0:Assigned_Support_Company>
        <ns0:Assigned_Support_Organization>WH</ns0:Assigned_Support_Organization>
        <ns0:Assignee>David</ns0:Assignee>
        <ns0:Categorization_Tier_1>ADD</ns0:Categorization_Tier_1>
        <ns0:Categorization_Tier_2>HARDWARE</ns0:Categorization_Tier_2>
        <ns0:Categorization_Tier_3>DESKTOP/LAPTOP/NOTEBOOK</ns0:Categorization_Tier_3>
        <ns0:City/>
        <ns0:Closure_Manufacturer/>
        <ns0:Closure_Product_Category_Tier1/>
        <ns0:Closure_Product_Category_Tier2/>
        <ns0:Closure_Product_Category_Tier3/>
        <ns0:Closure_Product_Model_Version/>
        <ns0:Closure_Product_Name/>
        <ns0:Company>IT Support</ns0:Company>
        <ns0:Contact_Company>IT Support</ns0:Contact_Company>
        <ns0:Contact_Sensitivity>Standard</ns0:Contact_Sensitivity>
        <ns0:Country/>
        <ns0:Department>WEL</ns0:Department>
        <ns0:Summary>Old PC to be Cascaded
</ns0:Summary>
        <ns0:Notes> User Name:
Make: Dell
Model: Latitude D600
Serial Number: 
Location: </ns0:Notes>
        <ns0:First_Name>James</ns0:First_Name>
        <ns0:Impact>3-Moderado/Limitado</ns0:Impact>
        <ns0:Incident_Number>INC000000009017</ns0:Incident_Number>
        <ns0:Internet_E-mail></ns0:Internet_E-mail>
        <ns0:Last_Name>Goodrich</ns0:Last_Name>
        <ns0:Manufacturer/>
        <ns0:Middle_Initial/>
        <ns0:Organization>--</ns0:Organization>
        <ns0:Phone_Number>+326</ns0:Phone_Number>
        <ns0:Priority>Medium</ns0:Priority>
        <ns0:Priority_Weight/>
        <ns0:Product_Categorization_Tier_1>HARDWARE</ns0:Product_Categorization_Tier_1>
        <ns0:Product_Categorization_Tier_2>DESKTOP/LAPTOP/NOTEBOOK</ns0:Product_Categorization_Tier_2>
        <ns0:Product_Categorization_Tier_3>CASCADE PC</ns0:Product_Categorization_Tier_3>
        <ns0:Product_Model_Version/>
        <ns0:Product_Name/>
        <ns0:Region></ns0:Region>
        <ns0:Reported_Source/>
        <ns0:Resolution>New PC
Make: 
Model: 
Serial Number: 
Ship to:
Shipping Carrier:
Tracking Number:</ns0:Resolution>
        <ns0:Resolution_Category/>
        <ns0:Resolution_Category_Tier_2/>
        <ns0:Resolution_Category_Tier_3/>
        <ns0:Service_Type>User Service Request</ns0:Service_Type>
        <ns0:Site>Salt Lake City</ns0:Site>
        <ns0:Site_Group/>
        <ns0:Status>Assigned</ns0:Status>
        <ns0:Status_Reason/>
        <ns0:Urgency>3-Medium</ns0:Urgency>
        <ns0:VIP>No</ns0:VIP>
    </ns0:getListValues>
</ns0:HelpDesk_QueryList_ServiceResponse></soapenv:Body></soapenv:Envelope>
0

1 个答案:

答案 0 :(得分:0)

我认为你无法让它工作,因为IIS(或客户端取决于你在哪一方面)应该在它到达你之前将其剥离,就像你不应该手动de -gzip一个请求。

this case中,服务器软件似乎没有很好地支持chunked。