From: Chris Gunnels Date: 2010-02-05T05:30:16+09:00 Subject: Send a SOAP request to a url that requires basic authenticat Hey all, I have scoured the web looking for an answer but can't seem to find one. I need to send a SOAP request to a server that requires basic authentication. I can create the base64 encoded username and password that the server requires, but I can't seem to send that or add that to the header as the server requires. code i have right now: ENDPOINT = "https://asldfjlsf.com" request_xml_string = 'xml...' stream = SOAP::HTTPStreamHandler.new(SOAP::Property.new) header = SOAP::SOAPHeader.new header.add("authorization", HTTPAuth::Basic.pack_authorization("username", "pass")) body_item = SOAP::SOAPElement.new('getResponse', request_xml_string) body = SOAP::SOAPBody.new(body_item) envelope = SOAP::SOAPEnvelope.new(header, body) request_string = SOAP::Processor.marshal(envelope) request = SOAP::StreamHandler::ConnectionData.new(request_string) resp_data = stream.send(ENDPOINT, request, 'getResponse') puts "Got response:" puts resp_data.receive_string Any help? -- Posted via http://www.ruby-forum.com/.