C++ classes for HTTP support

I'm reposting my question with more specifics. I want to use a C++ program to send an HTTP POST to a Web server. Java has built in classes to do this and I'm looking for some c++ classes to do the same. I'm working on Solaris 2.6, so most of the Windows implementations I have found on the web won't work.
Can anyone help me out? Web site? tar file?
Bob

1. Libwww library in http://www.w3.org/Library/User/ (free, in C)
2. RogueWave "Tools.h++ Professional" Class Library -
http://www.roguewave.com (for $)

Similar Messages

  • Weblogic does not call the ProxySelector class for http url

    We are using weblogic server for our project. I have created a ProxySelector class and made it the default in my code. When my code tried to access the external url, the ProxySelector is called for socket url but not http url. Because of this, I am not able to return any HTTP proxy object from the ProxySelector and it fails.
    Note: The code works fine if I execute it from tomcat.

    Hi This is the method that I have for invoking webservices. It uses a Dispatch API. The myProxySelector is an instance of MyProxySelector which is already made defult in the appication startup.
    This MyProxySelector has a threadlocal variable useProxy to indicate whether the proxy should be used or not. so I am setting the variable just before reply = dispatch.invoke(sm);
    public class WebServiceDispatch {
    public Object invoke() throws GLException {
    Object result = null;
    try {
    Service service = Service.create(getOperation().getServiceName());
    service.addPort(getOperation().getOperationName(), SOAPBinding.SOAP11HTTP_BINDING, call.getServiceEndpoint());
    Dispatch<SOAPMessage> dispatch = service.createDispatch(getOperation().getOperationName(), SOAPMessage.class, Service.Mode.MESSAGE);
    initHandlers(dispatch);
    Map<String, Object> ctx = dispatch.getRequestContext();
    if (call.useWSS()) {
    ctx.put(SOAPConstants.WSSE_SECURITY, new WSSHeader(getCredentials().getUsername(), getCredentials().getPassword(), call.sendEncryptedPassword()));
    } else if (call.getCredentials() != null ) {
    String user = getCredentials().getUsername();
    if ( user != null ) {
    ctx.put(Dispatch.USERNAME_PROPERTY, user);
    if (getCredentials().getPassword() != null ) {
    if (call.sendEncryptedPassword()) {
    ctx.put(Dispatch.PASSWORD_PROPERTY, getCredentials().getPassword().getEncryption());
    } else {
    ctx.put(Dispatch.PASSWORD_PROPERTY, getCredentials().getPassword().getText());
    MessageFactory mf = MessageFactory.newInstance();
    SOAPMessage sm = mf.createMessage();
    SOAPHeader sh = sm.getSOAPHeader();
    SOAPBody sb = sm.getSOAPBody();
    for ( Iterator<?> it = call.getOperation().getOrderedParameters().iterator(); it.hasNext(); ) {
    WebServiceParameter parameter = (WebServiceParameter) it.next();
    if (parameter.isBodyParam()) {
    sb.addChildElement((SOAPElement)call.getParameterValue(parameter));
    } else {
    sh.addChildElement((SOAPElement)call.getParameterValue(parameter));
    String endPoint = call.getServiceEndpoint();
    myProxySelector.setUseProxy(useProxyServer);
    if (getOperation().getReturn() != null) {
    reply = dispatch.invoke(sm);
    result = getReplyElement(reply);
    call.setParameterValue(getOperation().getReturn(), result);
    } else {
    dispatch.invokeOneWay(sm);
    } catch (Throwable t) {
    throw GLException.factory(new CausedBy("Error Invoking Web Service Dispatch"),t);
    return result;
    .........// more code to get webservice details from db and load useProxyServer flag value
    Here is the ProxySelector code
    public class MyProxySelector extends ProxySelector {
    protected ThreadLocal<Boolean> useProxy = new ThreadLocal<Boolean>();
         public ThreadLocal<Boolean> getUseProxy() {
              return useProxy;
         public void setUseProxy(boolean useProxy) {
              setUseProxy(useProxy? Boolean.TRUE: Boolean.FALSE);
         public void setUseProxy(Boolean useProxy) {
              this.useProxy.set(useProxy);
         private ProxySelector jvmDefaultSelector = null;
         public ProxySelector getJVMDefaultSelector() {
              return jvmDefaultSelector;
         private static MyProxySelector myProxySelector = null;
         private MyProxySelector(ProxySelector jvmDefaultSelector) {
              this.jvmDefaultSelector = jvmDefaultSelector;
         public static MyProxySelector getInstance() {
              if(myProxySelector==null) {
                   myProxySelector = new MyProxySelector(ProxySelector.getDefault());
              return myProxySelector;
         @Override
         public List<Proxy> select(URI uri) {
              try {
                   if (uri == null) {
                        throw new IllegalArgumentException("URI can't be null.");
                   Boolean useProxyObject = useProxy.get();
                   if(useProxyObject == null) {
                        String protocol = uri.getScheme();
                        if ("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) {
                             return getProxyList();
                        } else if(jvmDefaultSelector != null) {
                             return jvmDefaultSelector.select(uri);;
                   if(useProxyObject.booleanValue()) {
                        String protocol = uri.getScheme();
                        if ("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) {
                             return getProxyList();
              } catch(Exception e) {
              } finally {
                   if (useProxy != null) {
                        useProxy.remove();
              return getNoProxyList();
         @Override
         public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
              if (uri == null || sa == null || ioe == null) {
                   throw new IllegalArgumentException("Arguments can't be null.");
              if (jvmDefaultSelector != null) {
                   jvmDefaultSelector.connectFailed(uri, sa, ioe);
    private static final String PROXY_HOST = "glog.integration.http.proxyHost";
    private static String httpProxyHost = GLProperties.get().getProperty(PROXY_HOST);
    private static final String PROXY_PORT = "glog.integration.http.proxyPort";
    private static String httpProxyPort = GLProperties.get().getProperty(PROXY_PORT);
    private static ArrayList getNoProxyList() {
              ArrayList noProxyList = new ArrayList<Proxy>();
              noProxyList.add(Proxy.NO_PROXY);
              return noProxyList;
    private static ArrayList getProxyList() {
         Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(httpProxyHost, Integer.parseInt(httpProxyPort)));
              ArrayList proxyList = new ArrayList<Proxy>();
              proxyList.add(proxy);
              return proxyList;
    public static class Startup implements StartupShutdown {
    public void load(T2SharedConnection conn) throws GLException {}
    public void activate(T2SharedConnection conn) throws GLException {
         ProxySelector.setDefault(getInstance());
    public void unload() throws GLException {}
    Edited by: pshivrat on Sep 3, 2010 10:09 PM

  • WSDL-Compiler for HTTP-Binding

    I am searching for a wsdl-compiler, which is able to compile wsdl documents using http-binding but not soap-binding.
    Thanks a lot for your helping.

    Doesn't it generate classes for HTTP binding? I never tried to compile WSDL with HTTP binding. What happens when you do that?

  • [svn:osmf:] 13828: 1. Add MBR + DRM support for http streaming

    Revision: 13828
    Revision: 13828
    Author:   [email protected]
    Date:     2010-01-27 14:56:10 -0800 (Wed, 27 Jan 2010)
    Log Message:
    1. Add MBR + DRM support for http streaming
    2. Fix unit TestManifestParser.as to reflect the changes
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/manifest/ManifestParser.as
        osmf/trunk/framework/OSMF/org/osmf/net/NetStreamPlayTrait.as
        osmf/trunk/framework/OSMF/org/osmf/net/httpstreaming/HTTPNetStream.as
        osmf/trunk/framework/OSMF/org/osmf/net/httpstreaming/f4f/HTTPStreamingF4FIndexHandler.as
        osmf/trunk/framework/OSMF/org/osmf/video/VideoElement.as
        osmf/trunk/framework/OSMFTest/org/osmf/manifest/TestManifestParser.as

    Hello Alex,
    I don't have an answer for you.
    But, can you try to use http://drmtest2.adobe.com:8080/Content/anonymous.f4v with locally hosted OSMF player? This content doens't require user/pass info.
    I'm wondering that Google TV's flash player doesn't support prompt dialog.
    http://drmtest2.adobe.com/AccessPlayer/player.html requires flash player 11. That's why it won't be loaded with flash player 10.x.
    Thanks,
    -- Hiroshi

  • WAAS Support for HTTPS

    Hi,
    As the topic says does WAAS support acceleration of https traffic? If so where can I find this information?
    Also and more importantly where can I find performance and scalability information (Max Opt tcp connections, WAN capacity etc.) for WAAS and WAVE devices?

    HTTPS is currently only accelerated with TFO (no compression or AO) in WAAS 4.1.1 and before. HTTPS support is being introduced with a Application Optimizer in the upcoming release WAAS 4.1.3. 4.1.3 will allow optimization past TFO to include Full Optimization, etc.
    Look for a late March release date with more information on the HTTPS AO as well as Scaling information at that time.
    The current scalability numbers can be obtained from your partner and/or sales team, which would probably be the best way to review all the models.
    Thanks,
    Dan

  • Does WAAS really support TFO, DRE and LZC for HTTPS?

    We are currently using WAAS 4.0.17.b.14 to optimize HTTP across the WAN using TFO, DRE and LZ Compression. Does this same WAAS version (or a newer one) support all methods of optimization for HTTPS too?

    In 4.0.17, you should only configure HTTPS traffic for TFO (TCP Flow Optimization). If you configure HTTPS for full optimization, then you will just be wasting CPU processing and DRE disk space as WAAS can't look inside the encryption. In a future release (4.1.x) there will be SSL decryption available so you can take advantage of full optimization of HTTPS traffic.
    Dan

  • M.AA265"No depreciation area 07 defined for investment support 01 in class"

    Hi All,
    Creating an asset SAP gives me the follow message:
    n. AA265: "No depreciation area 07 defined for investment support 01 in class"
    Could anyone show mw the customizing step to set it?
    Thanks
    Gandalf

    Hi,
    If you are not using the dep area 07 then go to the dep area list and deleted all the dep areas which are not used
    If you are copying the chart of depreciation from standard then all the depreciations will be copied, so only required should be there and other to be deleted, other wise you can not create the asset master even, once if you delete 07 dep area, it will through other error of dep area 53 etc.
    so, maintain on required dep areas.
    Regards,
    Padma

  • Github as a source for an unofficial repo? https support in pacman

    I suspect the answer is no but can pacman handle a server over https?  I'd like to use my github repo as an unofficial pacman repo, but AFAIK, I can only do so via https, not http.
    Last edited by graysky (2011-01-14 22:28:20)

    Allan wrote:
    graysky wrote: Maybe Allan can do it in his spare time
    no need...  falconindy has already coded a switch from libfetch to libcurl.  https support will be there once that is finished.
    Oh man those pacman devs are so cool they just add features even if you don't want too 

  • Server Side Actionscript for HTTP Streaming Connections, is it supported?

    Hi, I have a server side actionscript application working for RTMP, and I would like to reuse this code for HTTP connections.
    Is this possible?

    Thank you for your answer.  If I understand what you are saying, the apache modules proxy http to rtmp on the streaming server.  I have an application that is passing context into the rtmp server side javascript using a url similar to this:
    rtmp://myhostname.com/myapp?mycontext/mp4:myfilename
    Do you think there is a way to pass the mycontext through the http url so that the Server Side Actionscript can perform an operation based on that context?

  • ASP Error: Class does not support Automation

    Hi,
    I am trying to schedule a Webi report thru SDK using classic ASP.  I am using the sample code provided here...
    http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/BOE_SDK/boesdk_com_doc/doc/boesdk_com_doc/Tutorials48.html
    Inside ScheduleWebiReport.asp, there's the subroutine below...
    Sub ScheduleWebiReport(iStore, webiID, format)
        Dim webiDocs
        Set webiDocs = iStore.Query("Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_ID=" & webiID)
        If (webiDocs.Count = 0) Then
            redirectWithError "../Error.asp", "The Web Intelligence document does not exist."
        End If
        Dim webiDoc
        Set webiDoc = webiDocs.Item(1).PluginInterface("")        
        Dim scheduleInfo
        'Creates an interface to the scheduling options for the Webi report.
        Set scheduleInfo = webiDoc.SchedulingInfo
        ' Runs the Webi report once.
        scheduleInfo.Type = 0
        ' Runs it right now.
        scheduleInfo.RightNow = True
        ' Set the scheduled format
        webiDoc.WebiFormatOptions.Format = format
        iStore.Schedule(webiDocs)   
    End Sub
    Whenever I reach the line: Set webiDoc = webiDocs.Item(1).PluginInterface("") (bolded above), I always get the error below...
    Microsoft VBScript runtime error '800a01ae'
    Class doesn't support Automation
    Has anyone encounter this issue or no how to fix this?
    Thanks in advance.

    Hi,
    I am trying to schedule a Webi report thru SDK using classic ASP.  I am using the sample code provided here...
    http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/BOE_SDK/boesdk_com_doc/doc/boesdk_com_doc/Tutorials48.html
    Inside ScheduleWebiReport.asp, there's the subroutine below...
    Sub ScheduleWebiReport(iStore, webiID, format)
        Dim webiDocs
        Set webiDocs = iStore.Query("Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_ID=" & webiID)
        If (webiDocs.Count = 0) Then
            redirectWithError "../Error.asp", "The Web Intelligence document does not exist."
        End If
        Dim webiDoc
        Set webiDoc = webiDocs.Item(1).PluginInterface("")        
        Dim scheduleInfo
        'Creates an interface to the scheduling options for the Webi report.
        Set scheduleInfo = webiDoc.SchedulingInfo
        ' Runs the Webi report once.
        scheduleInfo.Type = 0
        ' Runs it right now.
        scheduleInfo.RightNow = True
        ' Set the scheduled format
        webiDoc.WebiFormatOptions.Format = format
        iStore.Schedule(webiDocs)   
    End Sub
    Whenever I reach the line: Set webiDoc = webiDocs.Item(1).PluginInterface("") (bolded above), I always get the error below...
    Microsoft VBScript runtime error '800a01ae'
    Class doesn't support Automation
    Has anyone encounter this issue or no how to fix this?
    Thanks in advance.

  • Best Practice for WSDL Generate Proxy Class for Web Service with Two Versions

    Dear All
    Thank you in advance for you help.
    I would like to generate proxy classes for same function but with two versions.
    Old version web service (v23.2) is used for stable modules in a project which is not going to modify.
    However, enhancement is added in new version web service (v24) and is going to use in any future modules.
    For example,
    wsdl.exe -o="TestProxy.cs" -l:CS -n:Test -sharetypes https://community.workday.com/custom/developer/API/Notification/v23.2/Notification.wsdl https://community.workday.com/custom/developer/API/Notification/v24.0/Notification.wsdl
    It generates similar classes with an '1' added at the end of the class name.
    ublic partial class Event_TargetObjectType {
    private Event_TargetObjectIDType[] idField;
    public partial class Event_TargetObjectType1 {
    private Event_TargetObjectIDType1[] idField; ...}
    Since the function inside some class is the same, is it possible for WSDL.exe to generate proxy classes automatically that if the class is the same, then generate one class only (sameFunction())  but if it detects the class is different, then add '1'
    to the end of class name (differentFunction() and differentFunction1())
    i.e.
    public class sameFunction()
    public class differentFunction()
    private int a;}
    public class differentFunction1()
    { private int b;
    Best Regards
    mintssoul

    Hi  mintssoul,
      As per this case, I have shared corresponding details below :
    1.As far as I know, WCF doesn’t support method overloading directly
    2.Because WSDL doesn’t support method overloading (not OOPs).
    3.WCF generates WSDL which specifies the location of the service and the operation or methods the service exposes.
    4.WCF use Document/Literal WSDL Style : Microsoft proposed this standard where the soap body element will contain the web method name.
    5.By default all the WCF services conform to the document literal standard where the soap body should include the method name.
    6.but you can differ the method in the same manually by using Name attribute like below 
    For example:
        [OperationContract(Name="Integers")]
        int Display(int a,int b)
        [OperationContract(Name="Doubles")]
    double Display(double a,double b)
    7. Or I suggest you that can use svcutil to map multiple namespaces for generating wcf service proxies .
        for more information about this, refer here :
    http://stackoverflow.com/questions/1103686/use-svcutil-to-map-multiple-namespaces-for-generating-wcf-service-proxies

  • Why can we only use 1 release class for overall Release of Purchase Req?

    Hi,
    After realizing that it would be beneficial to use more than one release class for overall release of Purchase Requisition with classification, in use with release groups for overall release, I now ask if someone knows why SAP has chosen to only allow 1 release class for overall release of Purchase Requisition?
    In my scenario I would like Release group US, used for release strategies for US-plant to be able to use 1 release class with a specific set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_USD including a characteristic PR_TOTVAL_USD looking at CEBAN-GFWRT. The chosen currency for this characteristic would be USD.
    I would then like to allow Release group FR, used for release strategies for FRANCE-plant to use another release class with another set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_EUR including a characteristic PR_TOTVAL_EUR looking at CEBAN-GFWRT. The chosen currency for this characteristic would be EUR.
    In this way the release strategies for the respective release groups US and FR, could maintain their overall limit values in their respective release strategies in their own currencies.
    1. Observe that I do not want to use the same Release class for both release groups for overall release, even though I know that this is currently the only allowed option, as far as I've understood.
    2. Observe that I do not want to specify the two characteristics PR_TOTVAL_USD and PR_TOTVAL_EUR for overall value in the same release class, as this would lead to double maintenance for a large number of release strategies. Also consider the maintenance when new countries with new currencies want release strategies.
    3. Observe that I only want to use overall release.
    What I'm trying to avoid is having to continuously translate local business USD overall value limits to limits in the currency chosen for the overall value characteristic. If this for example is specified in DKK, this would lead to a need to adjust the overall value limits as soon as the exchange rate between USD and DKK changes in the system.
    Please consider this simple example:
    Local requirement is that USD purchase requisitions should be blocked when the USD value is above 1000 USD. However in my release strategy I would have to maintain a value of >5365 DDK, if DKK is chosen as the currency for overall characteristic.(e.g exchange rate 5,365).
    Next month the currency exchange rate in the system between USD and DKK has changed, and therefore I would have to go into CL24N and maintain the value to reflect the new exchange rate between USD and DKK. Lets say it has gone up to 5,435. I would now have to maintain a value of > 5435 DKK in my release strategy to correctly reflect the local business requirement of 1000 USD.
    So if anyone could please explain why SAP has taken the decision to make the Release class for overall release client specific that would be much appreciated and awarded accordingly. Also if you have any suggestion on how I could obtain the above scenario on maintaning overall value limits in different currencies than that would be awarded to.
    BR Jakob F. Skott

    You can give feed back to Apple from the iTunes drop-down menu in the iTunes menu bar..
    You can also contact the iTS Customer Service from the links on this page - http://www.apple.com/support/itunes/store/
    MJ

  • 'ResourceDictionary' root element is a generic type and requires a x:Class attribute to support the x:TypeArguments attribute sp

    Error : 'ResourceDictionary' root element is a generic type and requires a x:Class attribute to support the x:TypeArguments attribute specified on the root element tag.
    Hi,
    I get this error when i include some namespaces in my ResourceDictionary to specify a Style for a custom control.
    Can anyone help me?
    Thx
    Stardusty

    Hi,
    That's the whole point. I don't want to use x:TypeArguments on a ResourceDictionary but the compiler says it needs it.
    And i don't know why.
    This code give no error:
    <ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespaceystem;assembly=mscorlib">  
    </ResourceDictionary>
    And by adding 3 namespaces it gives that weard error:
    <ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:MyTime.View.Controls"
    xmlns:converters="clr-namespace:MyTime.View.Converters"
    xmlns:validationrules="clr-namespace:MyTime.View.ValidationRules"
    xmlns:sys="clr-namespaceystem;assembly=mscorlib">  
    </ResourceDictionary>

  • Here is example code for HTTPS Tunneling through proxy(400 Lines of code

    Here is the source for Https Tunneling that I have gotten working. It is based on Pua Yeow Cheong's JavaWorld Tip 111. Thanks to David Lord for providing the final breakthrough that I needed.
    I have posted it here for anyone who wishes to use it. If you find any bugs, or write any improvements, please tack them onto the end of this thread.
    I have been trying to tackle this problem for quite some time, so I hope this helps a few of you out there.
    Lots of Luck,
    nightmask.
    <----- Begin Copy and Paste -------->
    import java.net.*;
    import java.io.*;
    import java.security.*;
    import sun.misc.BASE64Encoder;
    import javax.net.*;
    import javax.net.ssl.*;
    *  This example is based on JavaWorld Tip 111. Thanks to Pua Yeow Cheong for writing it.
    *  It tunnels through a proxy using the Https protocol.
    *  Thanks go to David Lord in the java forums for figuring out the main problem with Tip 111
    *  PLEASE NOTE: You need to have the JSSE 1.0.2 jars installed for this to work
    *  Downloads contents of a URL, using Proxy Tunneling and Basic Authentication
    public class URLReader {
         *  The main program for the URLReader class
        public static void main(String[] args) throws Exception {
            //set up strings for use in app. Change these to your own settings
            String proxyPassword = "password";
            String proxyUsername = "username";
            String proxyHost = "myproxy.com";
            String proxyPort = "3128";
            String connectionURL = "https://www.verisign.com";
            //set up system properties to indicate we are using a proxy
            System.setProperty("https.proxyHost", proxyHost);
            System.setProperty("https.proxyPort", proxyPort);
            System.setProperty("proxyHost", proxyHost);
            System.setProperty("proxyPort", proxyPort);
            System.setProperty("proxySet", "true");
            System.setProperty("http.proxyHost", proxyHost);
            System.setProperty("http.proxyPort", proxyPort);
            System.setProperty("http.proxySet", "true");
            //set up handler for jsse
            System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
            java.security.Provider prov = new com.sun.net.ssl.internal.ssl.Provider();
            Security.addProvider(prov);
            //create the connection
            URL myURL = new URL(connectionURL);
            URLConnection myConnection = myURL.openConnection();
            if (myConnection instanceof com.sun.net.ssl.HttpsURLConnection) {
                ((com.sun.net.ssl.HttpsURLConnection) myConnection).setSSLSocketFactory(new SSLTunnelSocketFactory(System.getProperty("proxyHost"), System.getProperty("proxyPort")));
            myConnection.setDoInput(true);
            myConnection.setDoOutput(true);
            BufferedReader in;
            try {
                System.err.println("opening Input stream1");
                in = new BufferedReader(
                        new InputStreamReader(
                        myConnection.getInputStream()));
                String inputLine;
                System.err.println("Input stream is Open1");
                while ((inputLine = in.readLine()) != null) {
                    System.err.println(inputLine);
                in.close();
                System.err.println("Input stream is Closed1");
            } catch (Exception e) {
                e.printStackTrace(System.err);
                String tmp = e.getMessage().toLowerCase().trim();
                System.err.println("tmp *" + tmp + "*");
                if (tmp.indexOf("http") > -1) {
                    //http error message to be parsed
                    tmp = tmp.substring(tmp.indexOf("http")).trim();
                    System.err.println("tmp *" + tmp + "*");
                    tmp = tmp.substring(8).trim();
                    System.err.println("tmp *" + tmp + "*");
                    if (tmp.startsWith("407")) {
                        //proxy authentication required
                        myURL = new URL(connectionURL);
                        myConnection = myURL.openConnection();
                        if (myConnection instanceof com.sun.net.ssl.HttpsURLConnection) {
                            ((com.sun.net.ssl.HttpsURLConnection) myConnection).setSSLSocketFactory(new SSLTunnelSocketFactory(System.getProperty("proxyHost"), System.getProperty("proxyPort"), proxyUsername, proxyPassword));
                        myConnection.setDoInput(true);
                        myConnection.setDoOutput(true);
                        try {
                            System.err.println("opening Input stream 2");
                            in = new BufferedReader(
                                    new InputStreamReader(
                                    myConnection.getInputStream()));
                            String inputLine;
                            System.err.println("Input stream is Open 2");
                            while ((inputLine = in.readLine()) != null) {
                                System.out.println(inputLine);
                            in.close();
                            System.err.println("Input stream is closed 2");
                        } catch (Exception ex) {
                            System.err.println(ex.getMessage());
                            ex.printStackTrace(System.err);
    *  SSLSocket used to tunnel through a proxy
    class SSLTunnelSocketFactory extends SSLSocketFactory {
        private String tunnelHost;
        private int tunnelPort;
        private SSLSocketFactory dfactory;
        private String tunnelPassword;
        private String tunnelUserName;
        private boolean socketConnected = false;
        private int falsecount = 0;
         *  Constructor for the SSLTunnelSocketFactory object
         *@param  proxyHost  The url of the proxy host
         *@param  proxyPort  the port of the proxy
        public SSLTunnelSocketFactory(String proxyHost, String proxyPort) {
            System.err.println("creating Socket Factory");
            tunnelHost = proxyHost;
            tunnelPort = Integer.parseInt(proxyPort);
            dfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
         *  Constructor for the SSLTunnelSocketFactory object
         *@param  proxyHost      The url of the proxy host
         *@param  proxyPort      the port of the proxy
         *@param  proxyUserName  username for authenticating with the proxy
         *@param  proxyPassword  password for authenticating with the proxy
        public SSLTunnelSocketFactory(String proxyHost, String proxyPort, String proxyUserName, String proxyPassword) {
            System.err.println("creating Socket Factory with password/username");
            tunnelHost = proxyHost;
            tunnelPort = Integer.parseInt(proxyPort);
            tunnelUserName = proxyUserName;
            tunnelPassword = proxyPassword;
            dfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
         *  Sets the proxyUserName attribute of the SSLTunnelSocketFactory object
         *@param  proxyUserName  The new proxyUserName value
        public void setProxyUserName(String proxyUserName) {
            tunnelUserName = proxyUserName;
         *  Sets the proxyPassword attribute of the SSLTunnelSocketFactory object
         *@param  proxyPassword  The new proxyPassword value
        public void setProxyPassword(String proxyPassword) {
            tunnelPassword = proxyPassword;
         *  Gets the supportedCipherSuites attribute of the SSLTunnelSocketFactory
         *  object
         *@return    The supportedCipherSuites value
        public String[] getSupportedCipherSuites() {
            return dfactory.getSupportedCipherSuites();
         *  Gets the defaultCipherSuites attribute of the SSLTunnelSocketFactory
         *  object
         *@return    The defaultCipherSuites value
        public String[] getDefaultCipherSuites() {
            return dfactory.getDefaultCipherSuites();
         *  Gets the socketConnected attribute of the SSLTunnelSocketFactory object
         *@return    The socketConnected value
        public synchronized boolean getSocketConnected() {
            return socketConnected;
         *  Creates a new SSL Tunneled Socket
         *@param  s                         Ignored
         *@param  host                      destination host
         *@param  port                      destination port
         *@param  autoClose                 wether to close the socket automaticly
         *@return                           proxy tunneled socket
         *@exception  IOException           raised by an IO error
         *@exception  UnknownHostException  raised when the host is unknown
        public Socket createSocket(Socket s, String host, int port, boolean autoClose)
                 throws IOException, UnknownHostException {
            Socket tunnel = new Socket(tunnelHost, tunnelPort);
            doTunnelHandshake(tunnel, host, port);
            SSLSocket result = (SSLSocket) dfactory.createSocket(tunnel, host, port, autoClose);
            result.addHandshakeCompletedListener(
                new HandshakeCompletedListener() {
                    public void handshakeCompleted(HandshakeCompletedEvent event) {
                        System.out.println("Handshake Finished!");
                        System.out.println("\t CipherSuite :" + event.getCipherSuite());
                        System.out.println("\t SessionId: " + event.getSession());
                        System.out.println("\t PeerHost: " + event.getSession().getPeerHost());
                        setSocketConnected(true);
            // thanks to David Lord in the java forums for figuring out this line is the problem
            // result.startHandshake(); //this line is the bug which stops Tip111 from working correctly
            return result;
         *  Creates a new SSL Tunneled Socket
         *@param  host                      destination host
         *@param  port                      destination port
         *@return                           tunneled SSL Socket
         *@exception  IOException           raised by IO error
         *@exception  UnknownHostException  raised when the host is unknown
        public Socket createSocket(String host, int port)
                 throws IOException, UnknownHostException {
            return createSocket(null, host, port, true);
         *  Creates a new SSL Tunneled Socket
         *@param  host                      Destination Host
         *@param  port                      Destination Port
         *@param  clientHost                Ignored
         *@param  clientPort                Ignored
         *@return                           SSL Tunneled Socket
         *@exception  IOException           Raised when IO error occurs
         *@exception  UnknownHostException  Raised when the destination host is
         *      unknown
        public Socket createSocket(String host, int port, InetAddress clientHost,
                int clientPort)
                 throws IOException, UnknownHostException {
            return createSocket(null, host, port, true);
         *  Creates a new SSL Tunneled Socket
         *@param  host             destination host
         *@param  port             destination port
         *@return                  tunneled SSL Socket
         *@exception  IOException  raised when IO error occurs
        public Socket createSocket(InetAddress host, int port)
                 throws IOException {
            return createSocket(null, host.getHostName(), port, true);
         *  Creates a new SSL Tunneled Socket
         *@param  address          destination host
         *@param  port             destination port
         *@param  clientAddress    ignored
         *@param  clientPort       ignored
         *@return                  tunneled SSL Socket
         *@exception  IOException  raised when IO exception occurs
        public Socket createSocket(InetAddress address, int port,
                InetAddress clientAddress, int clientPort)
                 throws IOException {
            return createSocket(null, address.getHostName(), port, true);
         *  Sets the socketConnected attribute of the SSLTunnelSocketFactory object
         *@param  b  The new socketConnected value
        private synchronized void setSocketConnected(boolean b) {
            socketConnected = b;
         *  Description of the Method
         *@param  tunnel           tunnel socket
         *@param  host             destination host
         *@param  port             destination port
         *@exception  IOException  raised when an IO error occurs
        private void doTunnelHandshake(Socket tunnel, String host, int port) throws IOException {
            OutputStream out = tunnel.getOutputStream();
            //generate connection string
            String msg = "CONNECT " + host + ":" + port + " HTTP/1.0\n"
                     + "User-Agent: "
                     + sun.net.www.protocol.http.HttpURLConnection.userAgent;
            if (tunnelUserName != null && tunnelPassword != null) {
                //add basic authentication header for the proxy
                sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
                String encodedPassword = enc.encode((tunnelUserName + ":" + tunnelPassword).getBytes());
                msg = msg + "\nProxy-Authorization: Basic " + encodedPassword;
            msg = msg + "\nContent-Length: 0";
            msg = msg + "\nPragma: no-cache";
            msg = msg + "\r\n\r\n";
            System.err.println(msg);
            byte b[];
            try {
                //we really do want ASCII7 as the http protocol doesnt change with locale
                b = msg.getBytes("ASCII7");
            } catch (UnsupportedEncodingException ignored) {
                //If ASCII7 isn't there, something is seriously wrong!
                b = msg.getBytes();
            out.write(b);
            out.flush();
            byte reply[] = new byte[200];
            int replyLen = 0;
            int newlinesSeen = 0;
            boolean headerDone = false;
            InputStream in = tunnel.getInputStream();
            boolean error = false;
            while (newlinesSeen < 2) {
                int i = in.read();
                if (i < 0) {
                    throw new IOException("Unexpected EOF from Proxy");
                if (i == '\n') {
                    headerDone = true;
                    ++newlinesSeen;
                } else
                        if (i != '\r') {
                    newlinesSeen = 0;
                    if (!headerDone && replyLen < reply.length) {
                        reply[replyLen++] = (byte) i;
            //convert byte array to string
            String replyStr;
            try {
                replyStr = new String(reply, 0, replyLen, "ASCII7");
            } catch (UnsupportedEncodingException ignored) {
                replyStr = new String(reply, 0, replyLen);
            //we check for connection established because our proxy returns http/1.1 instead of 1.0
            if (replyStr.toLowerCase().indexOf("200 connection established") == -1) {
                System.err.println(replyStr);
                throw new IOException("Unable to tunnel through " + tunnelHost + ":" + tunnelPort + ". Proxy returns\"" + replyStr + "\"");
            //tunneling hanshake was successful
    }<----- End Copy and Paste -------->

    BTW, if you are using an implementation in which
    the http/https implementation recognises
    the java.net.Authenticator properly, you can use
    that framework to do basic/digest authentication.
    I think Sun's JDK 1.4 supports both basic
    and digest for both proxies and the actual end
    site you connect via http/https, but I haven't
    tested it to be sure. I know it works
    with http/basic at the end host.
    Today's Ob hack:
    import java.net.*;
    import java.io.*;
    class MyAuth extends Authenticator {
        protected PasswordAuthentication getPasswordAuthentication() {
            System.out.println("The realm '" + getRequestingPrompt() +
                "' at '" + getRequestingHost() + ":" + getRequestingPort() +
                "'\n" + "using " + getRequestingProtocol() + " is requesting " +
                getRequestingScheme().toUpperCase() + " authentication.");
            System.out.println("");
            System.out.println("What should we send them?  Let's send them ...");
            System.out.println("");
            return new PasswordAuthentication("username", "password".toCharArray());    }  
    public class MyURL {
        public static void main(String[] args) throws Exception {
            // set to the authenticator you want to use.
            Authenticator.setDefault(new myAuth());
            URL url =
                new URL("http://www.some.com/something_protected/index.htm");
            BufferedReader in = new BufferedReader(
                                    new InputStreamReader(
                                    url.openStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null) {
                System.out.println(inputLine);
            in.close();

  • Wscompile only generates classes for the first wsdl:portType encountered

    Greetings.
    When
    compiling a WSDL with port types as follows below;
    classes are generated for port type: AccountsManagement only.
      <portType name="AccountsManagement">
          <operation name="CreateAccount" parameterOrder="Account">
              <input message="tns:CreateAccountReq"/> <!-- name defaults to CreateAccountReqRequest -->
              <output message="tns:CreateAccountReqResponse"/>
          </operation>
          <operation name="CreateAccountForPerson" parameterOrder="Account UniqueId">
              <input message="tns:CreateAccountForPersonReq"/>
              <output message="tns:CreateAccountForPersonReqResponse"/>
          </operation>
      </portType>
      <portType name="PersonsManagement">
          <operation name="AddPerson" parameterOrder="Person">
              <input message="tns:AddPersonReq" name="AddPersonReq"/>
              <output message="tns:AddPersonReqResponse" name="AddPersonReqResponse"/>
          </operation>
          <operation name="AddPersonWithAccount" parameterOrder="Person Account">
              <input message="tns:AddPersonWithAccountReq" name="AddPersonWithAccountReq"/>
              <output message="tns:AddPersonWithAccountReqResponse" name="AddPersonWithAccountReqResponse"/>
          </operation>
      </portType>
      <portType name="TellersOperations">
          <operation name="ListAccountsForPerson" parameterOrder="UniqueId">
              <input message="tns:ListAccountsForPersonReq"/>
              <output message="tns:ListAccountsForPersonReqResponse"/>
          </operation>
      </portType>Netbeans output:
    init:
    wscompile-init:
    Created dir: C:\PROJECTS\WSTest\build\generated\wsclient
    Created dir: C:\PROJECTS\WSTest\build\generated\wsservice
    Created dir: C:\PROJECTS\WSTest\build\generated\wsbinary
    TestBankingService_wscompile:
    command line: wscompile "C:\Program Files\Java\jdk1.5.0_03\jre\bin\java.exe" -classpath "C:\Program Files\Java\jdk1.5.0_03\lib\tools.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\j2ee.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\saaj-api.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\saaj-impl.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\jaxrpc-api.jar;C:\Program Files\netbeans-4.1\SunAppServer8.1\lib\jaxrpc-impl.jar" com.sun.xml.rpc.tools.wscompile.Main -d "C:\PROJECTS\WSTest\build\generated\wsbinary" -features:wsi,strict -import -keep -mapping "C:\PROJECTS\WSTest\web\WEB-INF\TestBankingService-mapping.xml" -nd "C:\PROJECTS\WSTest\build\web\WEB-INF\wsdl" -s "C:\PROJECTS\WSTest\src\java" -verbose -Xprintstacktrace "C:\PROJECTS\WSTest\src\java\bankers\server\TestBankingService-config.xml"
    [ServiceInterfaceGenerator: creating service interface: bankers.server.TestBankingService]
    [CustomClassGenerator: generating JavaClass for: Account]
    BUILD SUCCESSFUL (total time: 2 seconds)There should be a class for Person as well. If I move port type:
    PersonsManagement to the top no Account class will be generated, but
    instead the Person class will be generated.
    Loading up the WSDL in Netbeans (client) works and shows
    all three Ports with their respective operations.
    Is there a reason for only allowing more than one port type per WSDL?
    Checked the man page for switches to "loop" though all portTypes but noluck.
    A bug?
    Thanks,
    WSDL for reference
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="BankingService" targetNamespace="http://www.mycomp.org/schemas/MyWebService"
        xmlns:tns="http://www.mycomp.org/schemas/MyWebService"
        xmlns:ns1="urn:WS/types"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <!-- Type definitions -->
      <types>
        <xsd:schema targetNamespace="urn:WS/types">
            <xsd:element name="Person" type="ns1:Person"/>
            <xsd:element name="Account" type="ns1:Account"/>
            <xsd:element name="ListOfAccounts" type="ns1:ListOfAccounts"/>
            <xsd:element name="ResultCode" type="xsd:unsignedInt"/>
            <xsd:element name="AccountNumber" type="xsd:string"/>
            <xsd:element name="UniqueId" type="xsd:string"/>
            <xsd:complexType name="Person">
                <xsd:sequence>
                    <xsd:element name="DisplayName" type="xsd:string"/>
                    <xsd:element name="UniqueId" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="Account">
                <xsd:sequence>
                    <xsd:element name="Number" type="xsd:string"/>
                    <xsd:element name="Type" type="xsd:token"/>
                    <xsd:element name="Amount" type="xsd:integer"/>
                </xsd:sequence>
            </xsd:complexType> 
          <xsd:complexType name="ListOfAccounts">
              <xsd:sequence>
                  <xsd:element name="Account" type="ns1:Account" minOccurs="0" maxOccurs="unbounded"/>
              </xsd:sequence>
          </xsd:complexType>
        </xsd:schema>
      </types>
      <message name="AddPersonReq">
          <part name="Person" element="ns1:Person"/>
      </message>
      <message name="AddPersonReqResponse">
          <part name="ResultCode" element="ns1:ResultCode"/>
      </message>
      <message name="AddPersonWithAccountReq">
          <part name="Person" element="ns1:Person"/>
          <part name="Account" element="ns1:Account"/>
      </message>
      <message name="AddPersonWithAccountReqResponse">
          <part name="AccountNumber" element="ns1:AccountNumber"/>
      </message>
      <message name="CreateAccountReq">
          <part name="Account" element="ns1:Account"/>
      </message>
      <message name="CreateAccountReqResponse">
          <part name="AccountNumber" element="ns1:AccountNumber"/>
      </message>
      <message name="CreateAccountForPersonReq">
          <part name="Account" element="ns1:Account"/>
          <part name="UniqueId" element="ns1:UniqueId"/>
      </message>
      <message name="CreateAccountForPersonReqResponse">
          <part name="AccountNumber" element="ns1:AccountNumber"/>
      </message>
      <message name="ListAccountsForPersonReq">
          <part name="UniqueId" element="ns1:UniqueId"/>
      </message>
      <message name="ListAccountsForPersonReqResponse">
          <part name="Accounts" element="ns1:ListOfAccounts"/>
      </message>
      <!--
            NOTE THAT wscompile WILL PICK THE FIRST AND ONLY FIRST portType
            IS THIS A BUG OR A FEATURE?
      -->
      <portType name="AccountsManagement">
          <operation name="CreateAccount" parameterOrder="Account">
              <input message="tns:CreateAccountReq"/> <!-- name defaults to CreateAccountReqRequest -->
              <output message="tns:CreateAccountReqResponse"/>
          </operation>
          <operation name="CreateAccountForPerson" parameterOrder="Account UniqueId">
              <input message="tns:CreateAccountForPersonReq"/>
              <output message="tns:CreateAccountForPersonReqResponse"/>
          </operation>
      </portType>
      <portType name="PersonsManagement">
          <operation name="AddPerson" parameterOrder="Person">
              <input message="tns:AddPersonReq" name="AddPersonReq"/>
              <output message="tns:AddPersonReqResponse" name="AddPersonReqResponse"/>
          </operation>
          <operation name="AddPersonWithAccount" parameterOrder="Person Account">
              <input message="tns:AddPersonWithAccountReq" name="AddPersonWithAccountReq"/>
              <output message="tns:AddPersonWithAccountReqResponse" name="AddPersonWithAccountReqResponse"/>
          </operation>
      </portType>
      <portType name="TellersOperations">
          <operation name="ListAccountsForPerson" parameterOrder="UniqueId">
              <input message="tns:ListAccountsForPersonReq"/>
              <output message="tns:ListAccountsForPersonReqResponse"/>
          </operation>
      </portType>
      <binding name="AccountsManagementBinding" type="tns:AccountsManagement">
          <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <operation name="CreateAccount">
              <soap:operation soapAction=""/>
              <input name="CreateAccountReq">
                  <soap:body use="literal"/>
              </input>
              <output name="CreateAccountReqResponse">
                  <soap:body use="literal"/>
              </output>
          </operation>
          <operation name="CreateAccountForPerson">
              <soap:operation soapAction=""/>
              <input name="CreateAccountForPersonReq">
                  <soap:body use="literal"/>
              </input>
              <output name="CreateAccountForPersonReqResponse">
                  <soap:body use="literal"/>
              </output>
          </operation>
      </binding>
      <binding name="PersonsManagementBinding" type="tns:PersonsManagement">
          <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <operation name="AddPerson">
              <soap:operation soapAction=""/>
              <input name="AddPersonReq">
                  <soap:body use="literal"/>
              </input>
              <output name="AddPersonReqResponse">
                  <soap:body use="literal"/>
              </output>
          </operation>
          <operation name="AddPersonWithAccount">
              <soap:operation soapAction=""/>
              <input name="AddPersonWithAccountReq">
                  <soap:body use="literal"/>
              </input>
              <output name="AddPersonWithAccountReqResponse">
                  <soap:body use="literal"/>
              </output>
          </operation>
      </binding>
      <binding name="TellersOperationsBinding" type="tns:TellersOperations">
          <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <operation name="ListAccountsForPerson">
              <soap:operation soapAction=""/>
              <input name="ListAccountsForPersonReq">
                  <soap:body use="literal"/>
              </input>
              <output name="ListAccountsForPersonReqResponse">
                  <soap:body use="literal"/>
              </output>
          </operation>
      </binding>
      <service name="BankingService">
          <port name="AccountsManagementService" binding="tns:AccountsManagementBinding">
              <soap:address location="__URL__"/>
          </port>
          <port name="PersonsManagementService" binding="tns:PersonsManagementBinding">
              <soap:address location="__URL__"/>
          </port>
          <port name="TellersOperationsService" binding="tns:TellersOperationsBinding">
              <soap:address location="__URL__"/>
          </port>
      </service>
    </definitions>

    I saw this post elsewhere:
    JAXRPC specification required support for only subset of schema types. Abstract schema type support was not required. For the schema types that are not supported, the spcification requires that they should be mapped to javax.xml.soap.SOAPElement.
    This is what jaxrpc wscompile tool does. At tool time, the type in the sample code posted is extended frm an abstract type so it should be getting mapped to SOAPElement. SOAPElement extends Node and Element. You may like to see its javadoc.
    -vivek.
    This is basically the behavior I am seeing, but I don't see this as being extended from an abstract type. if someone can see that and explain that to me I would appreciate it....if this is even the right path to the answer to my problem.

Maybe you are looking for

  • External disk access privileges

    I got some VERY bad advice on access privileges and I am now unable to access my external firewire disk. I added my user id to the root of my boot disk and did an apply to all subfolders. I was trying to protect my data, but the disk now disapeared f

  • Cffunction returntype question

    I've got a function (below) in a CFC that executes a stored procedure. The procedure has 2 input parameters and a single output parameter. I want to cfoutput the value of the output parameter in the procedure. The procedure does it's job in CF if I d

  • HTTPS XI adapter

    Hi, I am trying to sending some message via XI adapter to my partner using https. I am getting below error but if my partner sender communication channel send to http then it successful. My problem is im send using https and tested the connection usi

  • How to activate an InfoObject in background in target system

    Hello, after I made changes to an characteristic InfoObject in development system I have activated it in background, this has run the background job  IOBJ_ACTIVATE. When I transported the IO change and activation into the test system, the IO has been

  • Sharing partitions - Possible?

    Is it possible and how to share a partition? My HDD is partitioned in two parts. When I connect another machine to my macbook it shows the home dir with all the folders: documents, library, music etc. and nothing else. Here are my questions: 1. how t