Forum Discussion

soapuiMonoUser's avatar
13 years ago

Content Type problem

Hello,

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: "http://tempuri.org/ICalculator/Add"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: soda5-update-test:100
Expect: 100-continue
Content-Length: 337

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<!--Optional:-->
<tem:n1>5</tem:n1>
<!--Optional:-->
<tem:n2>10</tem:n2>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>

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: "http://tempuri.org/ICalculator/Add"
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="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><Add xmlns="http://tempuri.org/"><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="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><AddResponse xmlns="http://tempuri.org/"><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