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 8799053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:13:57+00:00 2026-06-14T00:13:57+00:00

So i’ve created a program that allows the users to buy a bus ticket

  • 0

So i’ve created a program that allows the users to buy a bus ticket on their phones, and download a pdf file as soon as the transaction is finished. This is done by checking if the url has changed and contains the keyword: TicsnetReceipt.aspx letting me know that the transaction is done. This works fine as i also save other information like your name/email from the url for future use.

Then i use Soap to download the file:

public String getPDFxml(String ReferenceID){
    String NAMESPACE = "http://tempuri.org/";
    String METHOD_NAME = "GetPDFxml";
    String SOAP_ACTION = "http://tempuri.org/GetPDFxml";
    String URL = "http://77.40.188.73:28082/SasMobileWS/SasMobile.asmx?op=GetPDFxml";

    try {

        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

        PropertyInfo pi = new PropertyInfo();
        pi.setName("Reference");
        pi.setValue(ReferenceID);
        request.addProperty(pi);

        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet=true;
        envelope.setOutputSoapObject(request);

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

        androidHttpTransport.call(SOAP_ACTION, envelope);

        SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
        String strRes = result.toString();
        String temp[];
        temp = strRes.split("TravelDate");
        String Date[] = temp[1].split(">|<|/");
        String theDate = Date[1];
        return(theDate);
    } catch (IOException e) {
        e.printStackTrace();
    } catch (XmlPullParserException e) {
        e.printStackTrace();
    }
    return null;
}


public void getPDFbytes(String TransactionID, String Date){
    String NAMESPACE = "http://tempuri.org/";
    String METHOD_NAME = "GetPDFbytes";
    String SOAP_ACTION = "http://tempuri.org/GetPDFbytes";
    String URL = "http://77.40.188.73:28082/SasMobileWS/SasMobile.asmx?op=GetPDFbytes";

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

    PropertyInfo pi = new PropertyInfo();
    pi.setName("Reference");
    pi.setValue(TransactionID);
    request.addProperty(pi);

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet=true;
    envelope.setOutputSoapObject(request);

    try {
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        androidHttpTransport.call(SOAP_ACTION, envelope);
    } catch (Exception e) {
        e.printStackTrace();
    }

    SoapObject resultsRequestSOAP = null;
    try{
        resultsRequestSOAP = (SoapObject) envelope.getResponse();
    }catch (Exception e) {
        try{    
        resultsRequestSOAP = (SoapObject) envelope.bodyIn; 
        }catch(Exception f){
            f.printStackTrace();
        }
    } 
    byte[] result = null;
    try {
        result = Base64.decode(resultsRequestSOAP.getProperty("GetPDFbytesResult").toString());
    } catch(Exception e){
        e.printStackTrace();
    }
    try {
        Date = Date.replace(".", "");
        FileOutputStream fos = openFileOutput(Date + "_" + TransactionID + ".pdf", Context.MODE_WORLD_READABLE);

        fos.write(result);
        fos.close();

    } catch(FileNotFoundException ex){
        ex.printStackTrace();
    } catch(IOException ioe){
        ioe.printStackTrace();
    }
}

This all works fine on the other models i’ve tried on, but on S3 it just won’t download the file and tells the user the file doesn’t exist when he tries to open it in the viewer.

I’m 99% sure it’s something wrong with soap that i just can’t figure out. But if this looks fine then i have no clue what’s going on :p

Thanks in advance 🙂

After doing a bit more testing i know that the problem comes from:

  androidHttpTransport.call(SOAP_ACTION, envelope);

which won’t seem the read the data at all, which is weird since it’s supposed to be the same input as in the method above.
Both methods accept a string Reference (which is really a number) And the first one, GetPDFxml returns a string and GetPDFbytes returns base64Binary.

just before the program crashes i get the values from envolope and it says:

envelope    
SoapSerializationEnvelope  (id=830066090736)    
addAdornments   true    
avoidExceptionForUnknownProperty    false   
bodyIn  SoapFault  (id=830066150416)    
bodyOut SoapObject  (id=830066090472)   
classToQName    Hashtable  (id=830066090944)    
dotNet  true    
enc "http://schemas.xmlsoap.org/soap/encoding/" (id=830065748280)   
encodingStyle   null    
env "http://schemas.xmlsoap.org/soap/envelope/" (id=830065748552)   
headerIn    null    
headerOut   null    
idMap   Hashtable  (id=830066090864)    
implicitTypes   false   
multiRef    Vector  (id=830066102400)   
properties  Hashtable  (id=830066090824)    
qNameToClass    Hashtable  (id=830066090904)    
version 110 
xsd "http://www.w3.org/2001/XMLSchema" (id=830065748824)    
xsi "http://www.w3.org/2001/XMLSchema-instance" (id=830065749064)   

And then neither envelope.getResponse(); or resultsRequestSOAP = (SoapObject) envelope.bodyIn; returns a valid value.

  • 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-06-14T00:13:58+00:00Added an answer on June 14, 2026 at 12:13 am

    Since I don’t have enough rep, this should be a comment:

    If your soap call pops an exception, try adding something like :

    catch(Exception e){
    Log.e(TAG, "Exception during getting pdf " + e.getMessage());} 
    

    So you can actually see what might be happening.

    Now if your positive that it’s the Soap failing, you might want to check your soapservice inside SoapUI (SoapUI Homepage) which also has a Eclipse plugin : Eclipse plugin

    And you should try to access your service inside the webbrowser on the device. If it gives a blank page, it’s either a device problem or an IIS problem.

    On a side note; I personally had problems with my SoapSerializationEnvelope(SoapEnvelope.VER11) number.


    Things you could add for debugging is:

     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.setOutputSoapObject(request);
        envelope.dotNet = true;
        Log.d("SoapBody",envelope.bodyOut.toString()); //This
    
        HttpTransportSE httpTransport = new HttpTransportSE(URL);
        httpTransport.debug = true; //And this!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

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.