Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7398883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:55:41+00:00 2026-05-29T03:55:41+00:00

I have a web service with both SOAP and REST endpoints. I have to

  • 0

I have a web service with both SOAP and REST endpoints. I have to accept requests from a client that I do not have any control over on my REST endpoint. Currently the client gets a 400 response and the tracelog on my server shows this error:

The incoming message has an unexpected message format 'Raw'. 
The expected message formats for the operation are 'Xml', 'Json'. 

I’ve tried everything I can think of with the WebContentTypeMapper but seem to end up right where I started every time. The request from the client doesn’t appear to be well formed XML or JSON so if I try to force XML or JSON types from the WebContentTypeMapper I end up with parser errors.

So I guess I need to find out if I can force this endpoint to accept the message anyway. That should be easy, right guys? …guys? …right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:55:42+00:00Added an answer on May 29, 2026 at 3:55 am

    If you make the operation take a stream then you can analyse the incoming data yourself and work out what to do with it. The ContentType of the HTTP request should tell you what is in the stream

    As an example, say you had a service which allowed you to upload images. You may want to perform different kinds of image processing depending on the image type. So we have a service contract as follows:

    [ServiceContract]
    interface IImageProcessing
    {
        [OperationContract]
        [WebInvoke(Method="POST", UriTemplate = "images")]
        void CreateImage(Stream stm);
    }
    

    The implementation checks the Content type of the request and performs processing dependent on it:

    public void CreateImage(Stream stm)
    {
        switch(WebOperationContext.Current.IncomingRequest.ContentType)
        {
          case "image/jpeg":
              // do jpeg processing on the stream
              break;
    
          case "image/gif":
              // do GIF processing on the stream
              break;
    
          case "image/png":
              // do PNG processing on the stream
              break;
    
          default:
              throw new WebFaultException(HttpStatusCode.UnsupportedMediaType);
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET web service running that accepts both HTTP POST and SOAP
I have two WebService(SOAP) Requests. The responses of both web service calls are exactly
I have classes that are needed in both my web service and my server.
I have a website that talks to a remote WCF web service. Both use
I have a console application that communicates with a web service. Both of them
I have written a service that I would like expose both via rest and
I have a web service that I want to access through SOAP. But I
I have a flex client connecting to a web service that needs an authentication
I am implementing a web service and I have implemented both a REST and
We have multiple versions of our web services (both REST and SOAP) in production,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.