Title: RE: Using SSL and SOAP

This is most likely a un-trusted server certificate issue.  Try adding the following to your runtime environment.

        -Djavax.net.debug=ssl

If you see that it's a server cert issue, then you'll need to install the server cert into your local truststore.  See the keytool documentation for this.

-Joe

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 6:52 AM
To: [EMAIL PROTECTED]
Subject: Using SSL and SOAP
Importance: High


Hello,
 
can someone help me? I try to do SOAP-Calls over HTTPS and I always get the following result:
 
[SOAP-Exception: faultCode=SOAP-ENV:Client; msg=Error opening socket: null;
targetException=java.lang.IllegalArgumentException: Error opening socket: null]
 
The SOAP-Documentation says, that there's noone listening at the desired address & port, but when I point my browser to the address I get the response from the rpcrouter servlet...

 
My client-side code looks like this:
   
    ....
    try
    {
      SOAPHTTPConnection shc = new SOAPHTTPConnection();
      shc.setMaintainSession(false);
 
      Properties theProps = System.getProperties();
 
      switch(object.getProxyTyp())
      {
        case 1 :
        {
          if(object.sslEnabled())
          {
            theProps.put("https.proxySet", "true");
            theProps.put("https.proxyHost", pHost);
            theProps.put("https.proxyPort", pPort);
          }
          else
          {
            theProps.put("proxySet", "true");
            theProps.put("proxyHost", pHost);
            theProps.put("proxyPort", pPort);
          }
          break;
        }
        case 2 :
          if(object.sslEnabled())
          {
            theProps.put("https.socksProxySet", "true");
            theProps.put("https.socksProxyHost", pHost);
            theProps.put("https.socksProxyPort", pPort);
          }
          else
          {
            theProps.put("socksProxySet", "true");
            theProps.put("socksProxyHost", pHost);
            theProps.put("socksProxyPort", pPort);
          }
          break;
        default :
        {
          theProps.put("proxySet", "false");
          theProps.put("socksProxySet", "false");
          theProps.put("https.proxySet", "false");
          theProps.put("https.socksProxySet", "false");
        }
      }
 
      if(object.sslEnabled())
      {
        theProps.put("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
        Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
 
        if(m_strServerPort.equals("443"))
          m_strServerURL = "https://" + m_strServerIP + "/soap/servlet/rpcrouter";
        else
          m_strServerURL = "https" + m_strServerURL;
      }
      else
        m_strServerURL = "http" + m_strServerURL;
 
      System.setProperties(theProps);
 
      Vector params = new Vector ();
 
      params.addElement(new Parameter("arg1", String.class, m_strRequest, null));
 
// making the SOAP-Call
      Call theCall = new Call();
 
      theCall.setSOAPTransport(shc);
      theCall.setTargetObjectURI(m_strTargetObjectURI);
      theCall.setMethodName(web_service);
      theCall.setEncodingStyleURI(m_strEncodingStyleURI);
      theCall.setParams(params);
 
      URL ServerUrl = new URL(m_strServerURL);
 
      Response inquiry_response = theCall.invoke(ServerUrl, null);
 
      Parameter result = inquiry_response.getReturnValue();
 
      if(inquiry_response.generatedFault())
      {
        Fault theFault = inquiry_response.getFault();
        inquiry_result_string = stringError("01", "Fehler beim Aufruf des WebService\n" + theFault.getFaultCode() + "\n" + theFault.getFaultString());

      }
      else
        inquiry_result_string = inquiry_response.getReturnValue().getValue().toString();
    ......
   
 
Can someone tell me where I'm going wrong and how I can correct the problem, please. I don't (and cannot) use client authentication, so I left that out. I'm working with Apache SOAP v.2.2 and JSSE 1.0.2, but it's no problem to change versions if that solves the problem!

 
 
Thank you for your time!
 
Sincerely,
Carsten Kortmann

Reply via email to