Results 1 to 2 of 2
  1. #1
    Zarah is offline Senior Member
    Join Date
    Mar 2014
    Posts
    116
    Rep Power
    0

    Default Soap Fault (faultcode: soapenv:Client, faultstring:Bad Request)

    I am writing a client to consume a SOAP web service in Android using ksoap2. And I have received a SOAP FAULT exception. Here is an excerpt from the LogCat.

    Java Code:
    <soapenv:Body><soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soapenv:Client</faultcode><faultstring>Bad request</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    04-06 09:04:09.693: E/SearchPublications(1159): SoapFault - faultcode: 'soapenv:Client' faultstring: 'Bad request' faultactor: 'null' detail: null
    This is how I extracted the values of the final strings from the WSDL:

    Namespace: The value of the attribute namespace of xsd:import element, which is a child element of xsd:schema, which is a child element of types

    SoapAction: Namespace appended by the method's name

    MethodName: The name of the method in the API

    URL: The actual URL of the WSDL

    Reference: This article

    I understand that there is something wrong with my code, but can anyone say what might be causing it and if I have set the values of the mentioned final variables correctly?

    I tried by setting the dotnet flag as true and false as well. I am trying to get the response in an SoapObject as it is an XML document, and I have read in an article that if the result is in XML, use SoapObject.

    I also tried to debug it, and all the variables are apparently having their correct values (as shown in the debug perspective) before this line:

    Java Code:
    result= (SoapObject) envelope.getResponse();
    At this line, a SoapFault excetion is thrown; you can compare the following piece of code and the screenshot. Can somebody suggest why this might be occurring and what else to try to fix it?

    Java Code:
    try{
    result = (SoapObject) soapEnvelope.getResponse();
    } catch (Throwable e) {
    Soap Fault (faultcode: soapenv:Client, faultstring:Bad Request)-bad-request.png

    I posted this question on stackoverflow as well.
    Last edited by Zarah; 04-08-2014 at 07:08 PM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,016
    Rep Power
    20

    Default Re: Soap Fault (faultcode: soapenv:Client, faultstring:Bad Request)

    Where are you building the request?
    Post that code.
    What is the definition for the request in the wsdl?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 07-30-2013, 02:37 PM
  2. Sending SOAP request server
    By lemdan in forum Java Servlet
    Replies: 0
    Last Post: 10-10-2012, 02:46 PM
  3. Replies: 3
    Last Post: 09-07-2012, 04:46 PM
  4. Replies: 5
    Last Post: 10-28-2009, 01:59 PM
  5. Replies: 2
    Last Post: 07-02-2007, 05:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •