FedEx Sun One server does not allow POST

Hello,
I am attempting to communicate with FedEx's Direct XML Track. They use a Sun One Server v. 6.1 w/ SSL. When I do a POST with my XML document, I get back a 504, Method Not Allowed. Have communicated with FedEx technical support to no avail. Have downloaded server 6.1 and installed, trying to reverse-problem solve. Cannot see anywhere in the server where POSTs might be set to prohibited. The FedEx documentation specifically says to use a POST, which of course makes sense. Has anyone successfully used FedEx XML Direct, and/or could supply me with a hint as to why this might be happening? Also, am URL-encoding the reuest. Here's the code:
public class FedexHTTPS {
static final int HTTPS_PORT = 443;
public static String enc = "encoding='UTF-8'";
public static String subRequest = "<?xml version = '1.0' encoding = 'UTF-8'?><RequestHeader><AccountNumber>xxxxxxxxx</AccountNumber></RequestHeader>     <Contact><PersonName>name </PersonName><CompanyName>Ubercom</CompanyName><Department>ActiveIdentity</Department><PhoneNumber>xxxx</PhoneNumber><E-MailAddress>[email protected]</E-MailAddress></Contact><Address><Line1>12 main st</Line1><Line2/><City>Leesburg</City><StateOrProvinceCode>VA</StateOrProvinceCode><PostalCode>20111</PostalCode><CountryCode>US</CountryCode></Address></FDXSubscriptionRequest>>";
public static String address = "gatewaybeta.fedex.com";
public static void main(String argv[]) throws Exception {
String encData=null;
try {
encData = URLEncoder.encode(subRequest,"UTF-8");
} catch (Exception ex){
System.out.println("Exception: " + ex.getMessage());
//System.out.println(encData);
int length = encData.length();
// Get a Socket factory
SocketFactory factory = SSLSocketFactory.getDefault();
// Get Socket from factory
Socket socket = factory.createSocket(address, HTTPS_PORT);
/*BufferedWriter out = new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream())); */
BufferedReader in = new BufferedReader(
new InputStreamReader(socket.getInputStream()));
OutputStream out = socket.getOutputStream();
String xmlEnc = "application/x-www-form-urlencoded";
String msg = "GET / HTTP/1.0\r\nContent-Length: " + length
+ "\r\nContent-Type: image/gif"
+ "\r\nReferer: www.EDS.com"
+ "\r\nHost: SSLserver.fedex.com"
+ "\r\nAccept-Encoding: image/jpeg"
+ "\r\nAccept: application/x-www-form-urlencoded, image/gif,image/jpeg,image pjpeg, text/plain,text/html/,*/*"
+ "\r\n\r\n" ;
out.write(msg.getBytes());
out.flush();
String line;
StringBuffer sb = new StringBuffer();
while((line = in.readLine()) != null) {
sb.append(line);
out.close();
in.close();
System.out.println(sb.toString());
}

I cleaned up the XML (thanks) and re-did using jakarta - still get the 504 Not Allowed....
public class FedexPost {
      public static String subRequest = "<?xml version="1.0" encoding="UTF-8"?><FDXSubscriptionRequest>     <RequestHeader>          <AccountNumber>1111111111</AccountNumber>     </RequestHeader>     <Contact>          <PersonName>name</PersonName>          <CompanyName>EDS</CompanyName>          <Department>ActiveIdentity</Department>          <PhoneNumber>7037773333</PhoneNumber>          <E-MailAddress>[email protected]</E-MailAddress>     </Contact>     <Address>          <Line1>10 Main St</Line1>          <Line2/>          <City>Anytown</City>          <StateOrProvinceCode>VA</StateOrProvinceCode>          <PostalCode>20175</PostalCode>          <CountryCode>US</CountryCode></Address></FDXSubscriptionRequest>";  
    public FedexPost() {
     * @param args the command line arguments
    public static void main(String[] args) {
        String encData=null;
        try {
           encData = URLEncoder.encode(subRequest,"UTF-8");
        } catch (Exception ex){
            System.out.println("Exception: " + ex.getMessage());
        // TODO code application logic here
        HttpClient httpclient = new HttpClient();
        PostMethod httpsPost = new PostMethod("https://gatewaybeta.fedex.com/");
        httpsPost.setRequestHeader("Connection", "close");
        try {
            httpsPost.setRequestEntity(new StringRequestEntity(encData, "application/x-www-form-urlencoded", "UTF-8"));
            httpclient.executeMethod(httpsPost);
            System.out.print(httpsPost.getStatusLine());
            System.out.println(httpsPost.getResponseBodyAsString());
        catch (IOException ex) {
            System.out.println(ex.getMessage());
        finally {
            httpsPost.releaseConnection();
 

Similar Messages

  • I have an Ipad 2 and are having problems sending out emails in one of my email address. I always get a message reading the email was not sent because the server does not allow relaying. This is an email account POP3. I have no such problem with gmail.

    I have an Ipad 2 and are having problems sending out emails in one of my email address. This is a POP3 email Account? I always get a message reading that the email was not sent because the server does not allow relaying. I have no such problem with gmail. What could be the problem and how do I resolve this. Is it about settings?
    Richard.

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact Apple ID Support, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
    The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
    Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
    Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
    Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do.

  • Server does not allow relaying

    I recently had to reset everything on my iPad due to iOS 6 upgrade. Now when I try to reply or forward emails from my preferred account (not iCloud ), I receive a note indicating the message could not be sent because the server does not allow relaying. What can I do?

    It happens when I try to reply or forward to anyone.
    I read another discussion string on this and someone indicated to turn off authentication. Mine wasn't on so that was not the problem. However, I selected Authentication to see what was behind it and  mistakenly touched one of the authentication types. Now it will not let me un-select it.
    So now I have two problems. Can u help please???

  • Email recipient is rejected as server does not allow relaying

    Hi there
    I wondered if there is someone that can help me. I have an iphone 3g and have my aol email account set up on the phone. It was working fine before I went away on holiday but since I have returned I am unable to send emails as iit keeps saying that the recipient has been rejected as the server does not allow relaying.
    I did not use my phone while I was away except for texting so didn't change any settings. I have read through similar questions and have tried all of different things suggested (turning off wifi, although it was never on wifi it was using 3g), making sure that both the primary server and the other SMTP servers are set as on and the details are filled out but still nothing works.
    Originally it was only set up with the primary server ticked as on and I never had a problem with it. I've also tried turning the phone off and on again several times and tried the power off and holding down the home key at the same time.
    Is there any one who could offer some further advice as it would be much appreciated.
    Many thanks
    Sam

    Go into Settings>Mail, Contacts, Calendars>your account>Outgoing mail Server SMTP>Primary Server then turn Server ON and fill in both User Name +Password under Outgoing Mail Server.

  • Updated my phone, now e-mail will not send because server does not allow relaying

    Updated iphone 3GS to iOS 5, now my company e-mail will not send "because server does not allow relaying".  I'm just an employee, not an IT type - have no idea what this means and I'm very frustrated. Also infuriated with Apple because THEIR update caused this to happen, yet I have to PAY for their support because I have an older iPhone. Someone please help.

    razmee209, thanks for your reply. After signing up for the community, I saw that I wasn't the only one. However, I think I've solved it by looking over the comments in reply to others with this problem.
    First, I think the iOS5 update may have made the phone default to IMAP setting. I noticed when I deleted my account and re-set it up that there is a large button at the top for either IMAP or POP. It is already defaulted to IMAP, but my account must be POP.  So this is the first thing to check when you're setting up your account.
    Second, I noted some other comments about needing to supply a username and password to the outgoing server even though it says optional. I included those, but got a message that it wasn't recognized (or something like that) and did I want to continue anyway. I told it to continue. After a few seconds, it verified my account, and now everything works.
    Hope this helps others having this problem.

  • I am having trouble sending email. I get reply that server does not allow relaying. iphone 4

    I am having trouble sending email. I get reply that server does not allow relaying. iphone 4

    having the same problem with iphone 4S. help! it's only happening from one email acct. gmail is fine.

  • An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider,
    error: 40 - Could not open a connection to SQL Server)

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named
    Pipes Provider, error: 40 - Could not open a connection to SQL Server)
    Hello,
    Make sure your SQL Server service is started.
    Make sure TCP\IP and names pipes protocol is enabled
    Make sure you have made an exception in firewall for SQL Server connection
    Make sure SQL Server browser service is enabled
    Make sure you connect with correct name hostname\instance name for named instance,MSSQLSERVER for default instance and Hotname\SQLEXPRESS for express edition.
    Please make sure you use port no when connecting to SQL server listeing on different port (hostname\instance ,portno)
    http://blogs.msdn.com/sql_protocols/archive/2006/09/30/SQL-Server-2005-Remote-Connectivity-Issue-TroubleShooting.aspx
    Hope this helps
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • TS3899 The email arrives with no problem, but when making a rely, the message pops up stating "The server does not allow relaying" and the reply is not sent.

    Received an iPad for Father's Day; during email setup, not able to send a reply to an email as a message appears stateing "Message not sent as server does not allow relaying." Can receive emails with no problem. Whoes server, theirs or mine.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • If I send a BCC email to my address I get ar error message stating the server does not allow relaying.

    I set up my eail account so I BCC a copy of the email to my desk top.  When I send an email from my IPhone I get a message stating that the recpient was rejected because the server does not allow relaying.  I can send the same email, BCC myself from my desktop with no problem.

    Go to Settings > Mail, Contacts, Calendars > Your Account > Account Name , tap on SMTP (under the 'Outgoing Mail Server' heading) and then tap on your Primary Server and enter your email account and password and see if things work.

  • When I attempt to reply or forward email, it says my server does not allow relaying and will not send.

    When I attempt to forward or reply emails. I get the error message that my server does not allow relaying and will not send.

    Some ISPs don't really handle you mail, they pass it off to another pipeline.  That is called relaying.  Some receiving servers will not accept relayed messages, as they are frequently associated with spammers.
    In some cases, I understand aol relays within thier own system, confusing the issue a little.
    Who is you mail provider?  If it is a big name, this should not be an issue.   As a test, if you have an alternate e mail account, like gmail, try to send a message from that account and see if it goes through.

  • My ipad doesn't send emails because it says the server does not allow relaying. What is relaying?

    My ipad doesn't send emails. Message says the server does not allow relaying. What does that mean and how do I fix it?

    Copied from here.
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    How to fix
    If this is an AOL issue, try these: go Settings > Mail, Contacts, Calendars > select your AOL.com account > SMTP from the Account Info Page > SMTP from the SMPT Page > make sure that the Server is ON, make sure that the Host Name is smtp.aol.com. Further make sure your username and password are correct and added in the Outgoing Mail server; make sure that Authentication is set to Password and make sure that Server Port is 587
    If this is not an AOL email: go Settings > Mail, Contacts, Calendars > Accounts >Account Info > SMPT> turn off primary server, turn on other (e.g. AT&T) SMTP server.
    Go into Settings > Mail, Contacts, Calendars > Your Account > Outgoing mail Server SMTP > Primary Server then turn Server ON and fill in both User Name and Password under Outgoing Mail Server.

  • TS3899 iPad 3 will no longer send mail. "Server does not allow relaying".  How can I fix?

    My iPad 3 will no longer send mail. "The server does not allow relaying:.  This happens on both cellular and wifi.  It happens for all recipients.  It does receive mail fins.  How can I fix this?

    Try going into Settings > Mail, Contacts, Calendars > select the account > account name , tap on SMTP (under the 'Outgoing Mail Server' heading) and then tap on your Primary Server and try entering your email account and password and see if it then works

  • I can't send an email.  I get a reply stating server does not allow relaying???

    I can't send an email.  It gives me a message stating can not send message, server does not allow relaying???  What is this and how do I fix it?

    Your SMTP setting .
    Ensure the settings in your Phone are those required by your carrier if using cellular or if wifi as required by by your broadband supplier
    http://www.apple.com/support/iphone/mail/

  • Can't send email.  Get message saying server does not allow relaying.  I do receive email just can't send.

    WWhy can't I send email but can receive it.  I get the message that the server does not allow relay.

    Hello kathyfromfalcon,
    Welcome to the Apple Support Communities!
    I understand that you are unable to send email but are still receiving email. In this situation, with the relaying denied alert, I would suggest reading over the attached article and working through the steps provided.
    Get help with Mail on iPhone, iPad, and iPod touch - Apple Support
    Have a great day,
    Joe

  • HT201320 Server does not allow relaying

    Changed e-mail address with verizon verified the account and cannot input my new e-mail in my iPhone or my ipad. Get same error message on both devices that the server does not allow relaying.

    See if this helps.
    Check the outgoing mail server setting. Make sure that your username and password are in there.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

Maybe you are looking for

  • Invoice Block with Qty Variance

    Hi All In one of my scenarios PO = 100 Qty - Overdelivery Tolerance - Unlimited GR = 120 Qty But as far as MIRO is concerned - my requirement is MIRO should be booked for PO qty only i.e. for 100. (Vendor Liability should be for PO Qty only) System t

  • Server Monitor tool

    Why cant i login to the server monitor tool on the server, also tryed from a remote machine.

  • Serialization vs SQL vs saving as text

    hello, I am at a standstill in my programming...I am writting a Meeting Reservation program and I am unsure about whether I sould use SQL or some form of database to organize the data for each meeting. The information that I am keepiong track of for

  • Putting a link inside a PDF

    Asking a dumb question here but how do I make an image in my pdf where it is linkable.

  • Need to verify account but don't know where my apple email account is

    need to verify my son's account said an email has been sent to *******@apple.co.uk  how do i find that?