wood burning stoves*
The moose likes Web Services and the fly likes JAXM Soap client- cannot authenticate through proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXM Soap client- cannot authenticate through proxy" Watch "JAXM Soap client- cannot authenticate through proxy" New topic

JAXM Soap client- cannot authenticate through proxy

Matthew X. Brown
Ranch Hand

Joined: Nov 08, 2000
Posts: 165
I'm using the current SOAP implementation as provided by sun/java. I cannot seem to authenticate through our proxy. When I run my program from home, where I don't have a proxy server, the program successfully connects to a webservice... I've tried using the -Dhttp parameters to pass in- but to no avail. I'm using the System.properties to store the http proxy stuff- but it doesn't seem to work. Please let me know if you see anything in my code....
(Please note that I've perused the forums looking for an answer already to my question, and although I have found and tried many of the solutions, none have worked. So just to let you know, I've done some upfront work on this.....Here goes.......)
import javax.xml.soap.*;
import javax.activation.*;
import javax.naming.*;
import java.net.*;
import java.io.*;
import java.util.*;
import javax.xml.*;
import javax.xml.messaging.*;
import javax.xml.soap.*;
import javax.xml.parsers.*;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import com.xxx.xxx.xxxx.databeans.*;
import com.sun.xml.messaging.jaxm.soaprp.*;
import java.net.*;
import java.io.*;
import com.xxx.xxx.xxxx.utilities.*;
import java.util.*;
public class WebServiceSendCmd {
private ProviderConnectionFactory pcf;
private ProviderConnection pc;
private MessageFactory mf = null;
private String from ="";
private String to = "";
private String data = "";
MessageFactory messageFactory;
public void Execute() {
public java.lang.String GetXml(java.lang.String argFileName) {
return null;
ArrayList SendMessage(AsnDto dto, EndPointConfiguration configEnd) { ArrayList list = new ArrayList();
System.out.println("SENDING MESSAGE");
SOAPConnection con;
//get parser factory (uses contextclassloader)
this.messageFactory = MessageFactory.newInstance();

SOAPMessage soapMessage = messageFactory.createMessage();
String soapAction = "http://www.regom.de/Soup";
SOAPPart soapPart = soapMessage.getSOAPPart();
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
SOAPBody soapBody = soapEnvelope.getBody();
SOAPConnectionFactory soapFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapFactory.createConnection();
URLEndpoint pt = new URLEndpoint(configEnd.getUrl());
String host = "myproxy.host";
String userid = new sun.misc.BASE64Encoder().encode("UserName".getBytes());
String password = new sun.misc.BASE64Encoder().encode("password".getBytes());
java.util.Properties props = new Properties();
Properties systemProps = System.getProperties();
Enumeration iter = props.propertyNames();
while (iter.hasMoreElements()) {
String s = (String) iter.nextElement();
systemProps.put(s, props.getProperty(s));
System.out.println(s+" "+props.getProperty(s));
Enumeration iter2 = System.getProperties().propertyNames();
while (iter2.hasMoreElements()) {
System.out.println((String) iter2.nextElement());
SOAPMessage replyMsg = soapConnection.call(soapMessage,pt);
Iterator i = replyMsg.getSOAPBody().getAllAttributes();
SOAPBody returnBody = replyMsg.getSOAPBody();
String xmlNode = i.next().toString();
MimeHeaders mimeHeaders = replyMsg.getMimeHeaders();
Iterator mimeList = mimeHeaders.getAllHeaders();
}catch(Exception e){
return list;
I agree. Here's the link: http://aspose.com/file-tools
subject: JAXM Soap client- cannot authenticate through proxy
Similar Threads
Consume .Net webservice
SOAP Request object is null
Display SOAP request line by line
Servlet using SAAJ and HTTP Authorization Header
Servlet using SAAJ and HTTP Authorization Header