ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Using HTTPRequest to communicate with server through proxy

Post new topic  Reply to topic
 Using HTTPRequest to communicate with server through proxy « View previous topic :: View next topic » 
Author Message
jharringa
PostPosted: Mon May 05, 2008 1:26 pm    Post subject: Using HTTPRequest to communicate with server through proxy Reply with quote

Acolyte

Joined: 24 Aug 2007
Posts: 70

I need to go through a proxy to access external resources and so far have not had any luck setting up the correct headers to accomplish this.

Right now, these are the headers that I'm setting up to do this and I come out with a HTTP 407 which tells me to enter my credentials:

Code:

      SET OutputRoot.Properties = InputProperties;
      SET OutputRoot.HTTPRequestHeader."Proxy-Authorization" = 'Basic ' || <Base64 encoded user:password>;
      SET OutputRoot.HTTPRequestHeader."Proxy-Connection" = 'Keep-Alive';


The properties on the HTTP Request node are configured as such:
Web Service URL: https://serverURL/path.aspx
HTTP(S) proxy location: proxy.domain.com:80
Follow HTTP(S) redirection (tried both ways)
HTTP Version: 1.1
Enable HTTP/1.1 keep-alive: checked
SSL Protocol: SSL

My response looks like this:

Code:

HTTPResponseHeader
   X-Original-HTTP-Status-Line:CHARACTER:HTTP/1.1 407 Proxy Authentication Required
   X-Original-HTTP-Status-Code:INTEGER:407
   Proxy-Authenticate:CHARACTER:BASIC realm="Enter Host RACF Credentials:"
   Cache-Control:CHARACTER:no-cache
   Pragma:CHARACTER:no-cache
   Content-Type:CHARACTER:text/html; charset=utf-8
   Proxy-Connection:CHARACTER:close
   Set-Cookie:CHARACTER:BCSI-CSCOOKIEC1=2; Path=/
   Connection:CHARACTER:close
   Content-Length:CHARACTER:849


So far, Google and other searches have come up with questions about this but no answers. Any ideas?
Back to top
View user's profile Send private message
mgk
PostPosted: Tue May 06, 2008 3:42 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi.

Headers set under OutputRoot.HTTPRequestHeaders will only be sent to the remote server (after the proxy connection has been made). To send headers to the proxy itself you need to set the ProxyConnectHeaders in the LocalEnvrionment before the HTTPRequestNode. Each header you want ot send has to be concatenated together with a CRLF between each header as shown below:

Code:
DECLARE CRLF CHAR CAST(X'0D0A' AS CHAR CCSID 1208);     
SET OutputLocalEnvironment.Destination.HTTP.ProxyConnectHeaders =
'Proxy-Authorization: Basic Zm5lcmJsZTpwYXNzd29yZAo=' || CRLF || 'Proxy-Connection: Keep-Alive' || CRLF;


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
jharringa
PostPosted: Tue May 06, 2008 6:22 am    Post subject: Reply with quote

Acolyte

Joined: 24 Aug 2007
Posts: 70

That makes sense. I knew this one would be a "head-slapper."

Thanks mgk!

Back to top
View user's profile Send private message
HOMETOWN47
PostPosted: Fri May 09, 2008 2:50 am    Post subject: Can't get this to work for my example Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 34

Hi,
I'm having Proxy Authentication issues in a mflow (in WMB 6.1.0) that I'm trying to create to call out to a public web service.
I've tried setting this

SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.ProxyConnectHeaders =
'Proxy-Authorization: Basic Zm5lcmJsZTpwYXNzd29yZAo=' || CRLF || 'Proxy-Connection: Keep-Alive' || CRLF;

in a compute node before a SOAPRequest node but it doesn't seem to help !

In my SOAPRequest node I'm setting the HTTP Proxy Location to the IP address of the proxy that we use (got this IP from the IE settings for my company).

Can anyone shed some light on what I'm doing wrong ? Surely someone else has had to of got this working!!
Back to top
View user's profile Send private message
mgk
PostPosted: Fri May 09, 2008 3:30 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

1: What is the error you are getting? If it is not authorized, then you have not specified the correct password (in your post you pasted the same password as I set above, which will not work - you need to base64 encode *your* password and use that!).

2: Did you set the "compute mode" on the compute node to include "local envrionemnt"?

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
HOMETOWN47
PostPosted: Fri May 09, 2008 7:02 am    Post subject: Unable to Authenticate Reply with quote

Apprentice

Joined: 25 Mar 2003
Posts: 34

The error I get is '407 Proxy Authenticate' and I've tried my user name and password (do I need to include any domain names in my user name ?). I'm assuming that if I used the incorrect username/password combination I would get a different error (complaining about invalid authorization).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Using HTTPRequest to communicate with server through proxy
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.