JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-3411

Http endpoint contentType element value gets ignored and overwritten with default value

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.1
  • Fix Version/s: 2.2
  • Component/s: Transport: HTTP(S) / Jetty
  • Labels:
    • 20-config
  • User impact:
    Medium
  • Effort points:
    0.5
  • Similar Issues:
    None

Description

contentType element for Http endpoint sets property as "ContentType" instead of "Content-Type". ContentType property set by endpoint element is ignored and default Content-Type is set.

ContentType "text/xml" is ignored and default "text/plain" is used:
<http:endpoint name="storePhysician" address="http://localhost:8088/.../store.xqy" contentType="text/xml" method="POST" />

Workaround:
<http:endpoint name="storePhysician" address="http://localhost:8088/.../store.xqy" method="POST">
<property key="Content-Type" value="text/xml" />
</http:endpoint>

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MULE-3979 ContentType should be Content-type

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Dirk Olmes added a comment - 28/May/08 11:41 PM

A quick check in the sources doesn't come up with the literal "ContentType" in the Mule sources.

To debug further, can you please provide a test case that demos this problem?

Show
Dirk Olmes added a comment - 28/May/08 11:41 PM A quick check in the sources doesn't come up with the literal "ContentType" in the Mule sources. To debug further, can you please provide a test case that demos this problem?
Hide
Permalink
Rajesh Shah added a comment - 02/Jun/08 03:50 PM

the xqy I post to accepts content with "text/xml" mime type only.

<http:endpoint name="storePhysician" address="http://localhost:8088/.../store.xqy" contentType="text/xml" method="POST" />

sets following request headers

[ContentType: text/xml
, X-MULE_ENDPOINT: http://localhost:8088/.../store.xqy
, X-MULE_REMOTE_SYNC: true
, method: POST
]

"ContentType" should be "Content-Type".

You do not see "ContentType" in Mule sources because it's spring loaded.

When ObjectToHttpClientMethodRequest class trying to read mime type it doesn't find it. Because it's looking for "Content-Type" property and endpoint sets "ContentType".

String mimeType = msg.getStringProperty(HttpConstants.HEADER_CONTENT_TYPE, null);

Since it doesn't find "Content-Type" property on endpoint, it sets default mime type of "text/plain". That's why I have to set <property key="Content-Type" value="text/xml" /> on the http connector and that works but it's a workaround. Basically that should be achieved by "contentType" element of http endpoint.

I hope this helps.

Show
Rajesh Shah added a comment - 02/Jun/08 03:50 PM the xqy I post to accepts content with "text/xml" mime type only. <http:endpoint name="storePhysician" address="http://localhost:8088/.../store.xqy" contentType="text/xml" method="POST" /> sets following request headers [ContentType: text/xml , X-MULE_ENDPOINT: http://localhost:8088/.../store.xqy , X-MULE_REMOTE_SYNC: true , method: POST ] "ContentType" should be "Content-Type". You do not see "ContentType" in Mule sources because it's spring loaded. When ObjectToHttpClientMethodRequest class trying to read mime type it doesn't find it. Because it's looking for "Content-Type" property and endpoint sets "ContentType". String mimeType = msg.getStringProperty(HttpConstants.HEADER_CONTENT_TYPE, null); Since it doesn't find "Content-Type" property on endpoint, it sets default mime type of "text/plain". That's why I have to set <property key="Content-Type" value="text/xml" /> on the http connector and that works but it's a workaround. Basically that should be achieved by "contentType" element of http endpoint. I hope this helps.
Hide
Permalink
Ross Mason added a comment - 29/Nov/08 03:10 AM

This has been bugging me too. There is some magic bean name processing going on here. May not be such an easy fix. Looking into it.

Show
Ross Mason added a comment - 29/Nov/08 03:10 AM This has been bugging me too. There is some magic bean name processing going on here. May not be such an easy fix. Looking into it.
Hide
Permalink
Ross Mason added a comment - 30/Nov/08 10:13 AM

Thanks for reporting. This is fixed in the latest snapshot: http://fisheye.codehaus.org/changelog/mule/?cs=13442

Show
Ross Mason added a comment - 30/Nov/08 10:13 AM Thanks for reporting. This is fixed in the latest snapshot: http://fisheye.codehaus.org/changelog/mule/?cs=13442

People

  • Assignee:
    Ross Mason
    Reporter:
    Rajesh Shah
Vote (0)
Watch (0)

Dates

  • Created:
    28/May/08 10:58 AM
    Updated:
    30/Nov/08 10:13 AM
    Resolved:
    30/Nov/08 10:13 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.