Thanks Guys,

Bindul - thanks for your spot of mismatched ports...
I also had the domain incorrect - doh!

NTCredentials creds = new NTCredentials("andrej1", "corej2ee", "CBW107061", 
"www-cache.eu.nag.net");
NTCredentials creds = new NTCredentials("andrej1", "corej2ee", "CBW107061", 
"nag-eur");

so final working code is

public static void main(String[] args) throws Exception {
                // test interface
                String testURI = 
"https://wwwpp50.landg.com/OrigoTermV3/GatewayV3";;
                // live interface
                String liveURI = 
"https://www50.landg.com/OrigoTermV3/GatewayV3";;

                // response
                String responseContent = "";

                HttpClient httpClient = new HttpClient();
                
httpClient.getHostConfiguration().setHost("wwwpp50.landg.com/OrigoTermV3/GatewayV3",
 443, "https");
                // set the proxy host and port
                
httpClient.getHostConfiguration().setProxy("www-cache.eu.nag.net", 3128);
                NTCredentials creds = new NTCredentials("username", "password", 
"CBW107061", "nag-eur");
                AuthScope authscope =  new 
AuthScope("www-cache.eu.nag.net",AuthScope.ANY_PORT );
 httpClient.getState().setProxyCredentials(authscope,creds);

            PostMethod httpPost = new PostMethod(testURI);

                httpPost.setRequestHeader("Content-Type", "text/xml");
                httpPost.setRequestBody("asdfsdfsdf");

                httpClient.executeMethod(httpPost);
                responseContent = httpPost.getResponseBodyAsString();

                System.out.println("Response received from SP was: " + 
responseContent);
                int responseCode = httpPost.getStatusCode();
                String responseMsg = httpPost.getStatusText();
                System.out.println("http status code: " + responseCode + 
"\nhttp status message: " + responseMsg);

                httpPost.releaseConnection();

        }

Many thanks again guys - top drawer assistance!
Jon Andrews

===============================================================
National Australia Group Europe Limited (Company Number 02108635, Registered 
Office 88 Wood Street, London EC2V 7QQ) (NAGE) is a subsidiary of National 
Australia Bank Limited (an Australian registered company). The following UK 
companies are authorised and regulated by the Financial Services Authority: 
Clydesdale Bank PLC (trading as Clydesdale Bank and Yorkshire Bank),  MLC 
Savings Limited, MLC Trust Management Company Limited, Clydesdale Bank 
Insurance Brokers Limited, Yorkshire Bank Financial Services Limited, National 
Australia Insurance Services Limited and Custom Fleet Limited.

The views and opinions expressed in this email may not reflect the views and 
opinions of any member of the group of which NAGE forms part. The information 
contained in this message is confidential and may also be privileged. It is 
intended only for the addressee named above. The unauthorised use, disclosure, 
copying or alteration of this message is strictly prohibited. If you are not 
the addressee (or responsible for delivery of the message to the addressee), 
please notify the originator immediately by return message and destroy the 
original message. This message and any attachments have been scanned for 
viruses prior to leaving the NAGE network. However, NAGE does not guarantee the 
security of this message and will not be responsible for any damages arising as 
a result of any virus being passed on or arising from any alteration of this 
message by a third party. NAGE may monitor emails sent to and from the NAGE 
network.

Reply via email to