Http Post Problem


I'm developing an Android application and ran into a problem while using the SendPostcardAndAddress method. I'm making http post requests to send postcards, without using the Postal Methods Java Toolkit, but for some reason I'm not able to get it working.

You can check out the url of the test http post request I make by accessing this text document:

And the response I get after making the request:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
                <soap:Text xml:lang="en">Server was unable to process request. ---&gt; Data at the root level is invalid. Line 1, position 1.</soap:Text>
            <soap:Detail />

Any ideas what I might be doing wrong?

Let me know if you need more details.



Hi Boti, As you can see in

Hi Boti,

As you can see in some other threads in this forum, the reason for your problem is that we do not support HTTP POST requests for sending letters and postcards. These complex requests of string variables along with binary data is not supported by our server. You can use HTTP POST and GET for the simpler methods, such as GetStatus.

I've Googled some tutorials and discussions regarding using SOAP with Android but we have not tried it ourselves.

Thanks for the quick

Thanks for the quick response. It looks like I have to check out those SOAP requests after all.

Another quick question, now

Another quick question, now about the SOAP request...

I'm in the middle of implementing a request using the kSoap toolkit. To make a request and send it I need four variables which values I'm not sure of. This is what I use at the moment:

final String SOAP_ACTION = "PostalMethods/SendPostcardAndAddress";
final String METHOD_NAME = "SendPostcardAndAddress";
final String NAMESPACE = "";
final String URL = "";

I'm sure one the values is not correct because I always get a -4001 and the username is set. Just that I couldn't figure it out so far.

You can check this or this to see a sample of the toolkit in action.

Thanks again,

Try using the following

Try using the following values:

final String SOAP_ACTION = "PostalMethods/SendPostcardAndAddress";
final String METHOD_NAME = "SendPostcardAndAddress";
final String NAMESPACE = "PostalMethods";
final String URL = "";

If found the following description here.

   private static final String SOAP_ACTION = "";
   private static final String METHOD_NAME = "MethodName";
   private static final String NAMESPACE = "";
   private static final String URL = "";

All of the data above can be retrieved from the web service definition(WSDL).
METHOD_NAME is the name of the method that we define in the web service.
NAMESPACE is the namespace of the web service, default is “”, can be specific to your own organization.
SOAP_ACTION is the direct concatenation of NAMESPACE followed by METHOD_NAME.
URL is the location where the web service can be accessed from. If the connection will be through SSL, you need to specify it here.(e.g. https)