使用JMeter执行WCF服务的负载测试

时间:2012-03-08 15:01:04

标签: jmeter

我正在尝试使用JMeter V2.5.1运行负载测试。 WCF服务在IIS中作为WCF-CustomIsolated发布。

如果我按照网址http://twenty6-jc.blogspot.com/2011/11/performance-and-loading-testing-wcf.html中指定的说明操作,请求会由工具发送,但我会收到以下错误代码:

Response code:415
Response Message:Cannot process the message because the content type 'text/xml' was not the expected type 'application/soap+xml; charset=utf-8'.

Cabeceras de respuesta:
HTTP/1.1 415 Cannot process the message because the content type 'text/xml' was not the expected type 'application/soap+xml; charset=utf-8'.
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Thu, 08 Mar 2012 13:33:17 GMT
Connection: close
Content-Length: 0


HTTPSampleResult campos:
ContentType: text/xml
DataEncoding: utf-8

我在SOAP / XML-RPC文本框中建立的XML消息如下:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xun="http://Xunta.IFRT.Servicios.Firma.ValidarCertificado.Peticion">
   <soap:Header>
   <To soap:mustUnderstand="1" xmlns="http://www.w3.org/2005/08/addressing">
https://localhost/ValidarCertificado/ValidarCertificado.svc</To>
</soap:Header>
   <soap:Body>
      <xun:Peticion>
            <!--Optional:-->
            <xun:Atributos>
               <!--Optional:-->
               <xun:DatosAutorizacion>
                  <!--Optional:-->
                  <xun:IdentificadorSolicitante>OficinaEadmin</xun:IdentificadorSolicitante>
                  <!--Optional:-->
                  <xun:TokenPassword>nimdaEanicifO</xun:TokenPassword>
                  <!--Optional:-->
                  <xun:Motivo>Motivo</xun:Motivo>
               </xun:DatosAutorizacion>
               <!--Optional:-->
               <xun:DatosEjecucion>
                  <!--Optional:-->
                  <xun:IdentificadorSolicitudCliente>1234</xun:IdentificadorSolicitudCliente>
               </xun:DatosEjecucion>
            </xun:Atributos>
            <!--Optional:-->
            <xun:MensajeEntrada>
               <xun:TipoPeticion>ObtenerInfoCertificado</xun:TipoPeticion>
               <!--Optional:-->
               <xun:Parametros>
                  <!--Optional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Y0BjYW1lcmZpcm1hLmNvbTCBkgYDVR0gBIGKMIGHMIGEBg0rBgEEAYGHLgoJAgEBMHMwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2FtZXJmaXJtYS5jb20vY3BzL2FjX2NhbWVyZmlybWFfY2MuaHRtbDAwBggrBgEFBQcCAjAkGiJDRVJUSUZJQ0FETyBDVUFMSUZJQ0FETyAtIFJBOiBDQzk5MC8GCCsGAQUFBwEDBCMwITAIBgYEAI5GAQEwFQYGBACORgECMAsTA0VVUgIBAAIBATANBgkqhkiG9w0BAQUFAAOCAQEAiWS4udGKR1Vc6XetwO8jOwFvCDE0kTnyz6yUswEzVQxYCgwr9Iufvg5SeUsf+26pWbEVs+GnkwDKej1EY8zWjWX/W6o/tcJiUGgdMlLCKlv+DsLyGJs6J/2xhlqzVKKJC4dB5Cme0sYkkhfvyAtroqEcLNGij2XzIWrRY+47tEoll4Tw0mhZNsHjLy7R0kbbZPtAaxxmFpt6XJUWTP0urhZ3ryg7CYwZZPLa9u+9+Q9lQaFSXkqAuTMvIWkc1HJdXrhAyBwU8zU9A5ljlmUyqD7ODuhymwRQ6VSsyVf+IGZnK+9cbdf6IAF8vXI5mfLmysPptCKY457Oj572Wo0QUA==</xun:certificado>
                  <!--Optional:-->
                  <xun:modoValidacion>2</xun:modoValidacion>
                  <xun:obtenerInfo>true</xun:obtenerInfo>
               </xun:Parametros>
            </xun:MensajeEntrada>
         </xun:Peticion>
   </soap:Body>
</soap:Envelope>

有关此错误消息的任何想法?

致以最诚挚的问候,

1 个答案:

答案 0 :(得分:2)

尝试使用HTTP Header Manager指定正确的标头(内容类型:'application / soap + xml; charset = utf-8')。