2016-03-14 36 views
1

我想this tutorial到我的項目:Visual Studio的Web服務請求415錯誤

我設置標題:SOAPActionhttp://somuri.com/IHubService/processAirLFSearch

和我的身體看起來像:

<?xml version="1.0" encoding="utf-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://someuri.com"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <OTA_AirLowFareSearchRQ> 
     ... 
     </OTA_AirLowFareSearchRQ> 
    </soapenv:Body> 
</soapenv:Envelope> 

終於我的網址要服務的是:http://localhost:24030/HubService.svc

但是我經常這個錯誤:

HTTP/1.1 415 Cannot process the message because the content type 'application/octet-stream' was not the expected type 'text/xml; charset=utf-8'.

我在做什麼錯?

這裏的路是什麼樣子我的項目屏幕截圖: enter image description here

+0

顯示請求。 – BWA

+0

@BWA是的,讓我來做 –

+0

同樣的問題也在[33485373]中涵蓋(https://stackoverflow.com/questions/33485373/vs-web-load-test-returning-415-unsupported-media-type-though -content-type-is-spe) – user3613932

回答

1

什麼的小提琴手捕獲:
這是成功請求頭

POST http://mycomputer:8989/MyService.svc HTTP/1.1 
Accept-Encoding: gzip,deflate 
Content-Type: text/xml;charset=UTF-8 
SOAPAction: "http://someuri.com/Login" 
Content-Length: 389 
Host: mycomputer:8989 
Connection: Keep-Alive 
User-Agent: Apache-HttpClient/4.1.1 (java 1.5) 

,這是不成功請求頭

POST http://mycomputer:8989/MyService.svc HTTP/1.1 
SOAPAction: http://someuir.com/Login 
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) 
Accept: */* 
Accept-Language: en-US 
Accept-Encoding: GZIP 
Host: mcomputer:8989 
Content-Length: 1604 
Expect: 100-continue 
Connection: Keep-Alive 

所以就這樣在Web性能測試設置在繩體的Content-type的Visual Studio失蹤

Content-Type: text/xml;charset=UTF-8

解決問題的小提琴手或其他工具捕獲

enter image description here

+0

更快關注[33485373](https://stackoverflow.com/questions/33485373/vs-web-load-test-returning-415-unsupported-media-type-though-content型-是-SPE) – user3613932