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

  • SEARCH
  • Home
  • 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 6980391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:00:41+00:00 2026-05-27T18:00:41+00:00

I wrote some wcf interface ( REST ) that need to be called from

  • 0

I wrote some wcf interface ( REST ) that need to be called from android platform.
The first method is working good on any call from android – but the second method not working at all and i don’t see any reason to this to happaned.

The code in the client ( android ) is not make any exception – i just see in the HttpResponse the message ‘bad request’ and i dont see that the code is stop on the wcf code ( in the server ).

The WCF code:

    [OperationContract, WebInvoke( Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare )]
    Replay_1_DTO Method_01( Stream image );


    [OperationContract, WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml,  BodyStyle = WebMessageBodyStyle.Bare)]  
    Replay_2_DTO Method_02(int val1);

The android code for the second method:

      Replay_2_DTO Call_Method_02(int val1)
{
     DefaultHttpClient httpclient = new DefaultHttpClient();
     HttpPost httppost = new HttpPost(WEB_SERVICE_URL);
     Replay_2_DTO replay_2_DTO = null; 
     try
     {
    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);        

    nameValuePairs.add(new BasicNameValuePair("val1", val1));         

    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

    HttpResponse p = httpclient.execute(httppost);

    String str = EntityUtils.toString(p.getEntity());

                replay_2_DTO = parser( str );


      } 
      catch (Exception e) { ... }

            return replay_2_DTO;

        }
  • 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-27T18:00:42+00:00Added an answer on May 27, 2026 at 6:00 pm

    The most likely cause of this behavior is that the WCF service can’t serialize replay_2_DTO or one of its children.

    To figure this out, add the following to the section of your web.config. Once you have reproduced the error, double click on the file to use the log viewer tool, which should show you exactly what is happening.

      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true">
            <listeners>
              <add name="traceListener"
                  type="System.Diagnostics.XmlWriterTraceListener"
                  initializeData="c:\log\WebTrace.svclog"  />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    

    Another good tool to use, even before the above suggestion, is fiddler. Sometimes you can see more detailed information in the response that will lead you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote some WCF server that support SOAP. Now, i need to add some
So I wrote some perl that would parse results returned from the Amazon Web
I'm using WCF to create some REST service. One of the Rest Service method
I wrote some WCF service. I used basicHttp and i need to have the
I'm new in the WCF I wrote some server that work on IIS 7.5
I wrote a wcf service that uses BasicHttpBinding with some url and a client
I wrote some code with a lot of recursion, that takes quite a bit
I wrote some naive code(in the sense that it's synchronous calls) for a tableview
I wrote a WCF service with a function that using absolute path to get
I need to do authorization and auditing on some WCF service methods. I'd like

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.