Servlet to service push not working

We are trying to do an upload file feature but due to architecure constraints we must have a servlet call the B2B service, passing the file data. Our servlet does not seem to be initiating the call to the service as there is no service call in the audit log. We’re initiating the call to the serice via:

URLConnection uc = url.openConnection();


OutputStream outS = uc.getOutputStream();

we can successfully write to the stream with no errors but nothing shows up in the audit log. We’ve tried running the servlet from two different IDE’s and the behavior is the same. Any suggestions?

Here’s a code snipit that works for my set up. The most obscure thing is needing to set the user agent request property.

Hope this helps

URL postTestURL = new URL(“http://Hunter:5555/invoke/Test/HttpPostTest”);

  HttpURLConnection connection = (HttpURLConnection)postTestURL.openConnection();
  String username_password = "Developer:b2bdev";

  byte[] user_pass_array = username_password.getBytes();
  sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();

  String sun_misc_encoded = encoder.encode(user_pass_array);
  System.out.println("sun.misc.Base64Encoder encoding: " + sun_misc_encoded);

   connection.setRequestProperty( "Authorization", "Basic " + sun_misc_encoded);

  // connection.setRequestProperty("Content-Type","text/xml");

  //fake out the B2B server to think it's getting a request from a browser
  connection.setRequestProperty("User-Agent","Mozilla/4.0 [en] (WinNT; I)");