Forum Discussion

soapuiMonoUser's avatar
13 years ago

Content Type problem


I'm trying to implement a WCF Web service in C#. I run the service under Mono in a Linux system.
I'm creating a SelfHost host for my test cases.
ServiceHost selfHost = new ServiceHost(typeof(WCFMonoCalculatorService), baseAddress);

The problem is the when I send the following request I get an error about the content type
but the content type itself seems exactly same except one space between text/xml;(there is no space in soap ui request)charset=utf-8

POST http://soda5-update-test:100/Calculator/Service HTTP/1.1
Content-Type: text/xml;charset=utf-8 <==Mono server complains about this line
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: soda5-update-test:100
Expect: 100-continue
Content-Length: 337

<soapenv:Envelope xmlns:soapenv="" xmlns:tem="">

This is the response I get from the server.

HTTP/1.1 415 Expected content-type 'text/xml; charset=utf-8' but got 'text/xml;charset=utf-8'
Server: Mono-HTTPAPI/1.0
Date: Tue, 22 Nov 2011 15:51:57 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=99

The same service is working for the following response and request pair properly.

POST /Calculator/Service HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: soda5-update-test:100
Content-Length: 159
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

HTTP/1.1 100 Continue

<s:Envelope xmlns:s=""><s:Body><Add xmlns=""><n1>100</n1><n2>15.99</n2></Add></s:Body></s:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Server: Mono-HTTPAPI/1.0
Date: Tue, 22 Nov 2011 16:03:46 GMT
Content-Length: 219
Keep-Alive: timeout=15,max=100

...<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s=""><s:Body><AddResponse xmlns=""><AddResult>115.99</AddResult></AddResponse></s:Body></s:Envelope>

Is there any way to edit content-type http header in soap ui or do you have any other ideas??

Thanks in advice.

Best Regards
No RepliesBe the first to reply