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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:48:36+00:00 2026-05-22T12:48:36+00:00

I’ve created an e-book reader app & it supports in-app-purchase. The transaction receipt which

  • 0

I’ve created an e-book reader app & it supports in-app-purchase. The transaction receipt which gets generated is being sent to a jboss server. The following piece of code has been written to send the transaction receipt to server. here i’m converting .xml file to NSdata & passing the NSdata object to server.

-(IBAction)download:(id)sender{
    NSString *XMLPath = [[NSBundle mainBundle] pathForResource:@"ebook" ofType:@"xml"];

    NSString *name = @"photo1"; 
    NSData *imageData = [NSData dataWithContentsOfFile:XMLPath];
    NSLog(@"size of imageDATA %d",imageData.length);
    //NSString *Datastring = [NSString strin]
    NSString *dataString = [[NSString alloc] initWithData:imageData encoding:NSUTF8StringEncoding];
    //transaction.transactionReceipt;
    //NSData * imageData = UIImagePNGRepresentation(image); 
    // NSString *postLength = [NSString stringWithFormat:@"%d", [imageData length]];        
    NSString *urlString = @"http://172.18.11.162:8080/DRM_15April/ReceiptDownload";
    //urlString = [urlString stringByAppendingString:@"tranReceipt"];
    //urlString = [urlString stringByAppendingString:@"&name="];
    //urlString = [urlString stringByAppendingString:name]; 
    //urlString = [urlString stringByAppendingString:@"&lang=en_US.UTF-8"]; 
    NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
    [request setURL:[NSURL URLWithString:urlString]];
    NSLog(@"the url is %@",urlString);
    [request setHTTPMethod:@"POST"];
    NSMutableData *postBody = [NSMutableData data];



    //add data field and file data
    [postBody appendData:[NSData dataWithData:imageData]];
    NSLog(@"size of DATA %d",postBody.length);
    // ---------

    [request setHTTPBody:postBody];

    // now lets make the connection to the web
    NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];

    NSLog(@"return strind is %@",returnString);

}

This is logging the following in my console window.

-[KitabooBookShelf download:] the url is http://172.18.11.162:8080/DRM_15April/ReceiptDownload
(1) -[KitabooBookShelf download:] size of DATA 364
(1) -[KitabooBookShelf download:] return strind is <html><head><title>JBossWeb/2.0.1.GA - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.io.StreamCorruptedException: invalid stream header: 3C3F786D
    java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
    java.io.ObjectInputStream.&lt;init&gt;(ObjectInputStream.java:279)
    com.hurix.drm.servlet.ReceiptDownload.doPost(ReceiptDownload.java:40)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    com.hurix.drm.common.filter.SessionFilter.doFilter(SessionFilter.java:75)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.1.GA</h3></body></html>

can anyone suggest me what could be going wrong at my application side.

  • 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-22T12:48:37+00:00Added an answer on May 22, 2026 at 12:48 pm

    You trying to read an XML data with an ObjectInputStream, but as the javadoc says:

    An ObjectInputStream deserializes primitive data and objects previously written using an ObjectOutputStream.

    So actually there is nothing wrong on client side, but on server side.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
In order to apply a triggered animation to all ToolTip s in my app,
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
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

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.