4 Replies Latest reply on Jan 30, 2012 3:46 PM by tdanner

    Trouble getting the Java Client example to work

    tcwatkins

      Hello

      I am trying to get the JavaClient example from the SDK to work. Here is the error I keep getting:

       

       

       

       

       

       

      Exception in thread "main"

       

       

      javax.xml.ws.WebServiceException: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException

      : Connection reset

      at com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(Unknown Source)

      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(Unknown Source)

      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(Unknown Source)

      at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(Unknown Source)

      at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

      at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)

      at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)

      at javax.xml.ws.Service.<init>(Unknown Source)

      at org.tempuri.InformationService_Service.<init>(

       

       

      InformationService_Service.java:46

      )

      at SwisClient.getSwisClient(

       

       

      SwisClient.java:90

      )

      at SwisClient.main(

       

       

      SwisClient.java:42

      )

      Caused by:

       

       

      javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException

      : Connection reset

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)

      at com.sun.net.ssl.internal.ssl.AppInputStream.available(Unknown Source)

      at java.io.BufferedInputStream.available(Unknown Source)

      at sun.net.www.MeteredStream.available(Unknown Source)

      at sun.net.www.http.KeepAliveStream.close(Unknown Source)

      at java.io.FilterInputStream.close(Unknown Source)

      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)

      ... 11 more

      Caused by:

       

       

      javax.net.ssl.SSLException: java.net.SocketException

      : Connection reset

      at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)

      at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)

      at java.io.BufferedInputStream.fill(Unknown Source)

      at java.io.BufferedInputStream.read1(Unknown Source)

      at java.io.BufferedInputStream.read(Unknown Source)

      at sun.net.www.MeteredStream.read(Unknown Source)

      at java.io.FilterInputStream.read(Unknown Source)

      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanQName(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)

      at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source)

      at com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter.next(Unknown Source)

      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.next(Unknown Source)

      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.nextContent(Unknown Source)

      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.nextElementContent(Unknown Source)

      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseBindingOperation(Unknown Source)

      at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(Unknown Source)

      ... 10 more

      Caused by:

       

       

      java.net.SocketException

      : Connection reset

      Any help would be greatly appreciated

        • Re: Trouble getting the Java Client example to work
          tcwatkins

          So I connected to https://localhost:17778/SolarWinds/InformationService. It has a certificate error saying that the certificate is invalid. Also I tried running svcutil.exe https://localhost:17778/SolarWinds/InformationService?wsdl and that also gave an error about not trusting the certificate. I tried installing the certificate in the trusted authorities and now I get a mismatch address certificate error. How can I move pass the certificate error.

            • Re: Trouble getting the Java Client example to work
              tdanner

              The certificate errors you are getting are because the certificate SWIS uses for HTTPS is intentionally not a valid certificate. It is self-signed rather than issued from a proper certificate authority like Verisign, and its common name is CN=SolarWinds-Orion instead of whatever the FQDN of your server is. In this mode, HTTPS provides confidentiality and replay protection, but not host authentication.

              svcutil.exe doesn't have a way to tell it to skip the certificate validation. Visual Studio's "Add Service Reference" dialog will let you ignore the error and generates the same kind of proxy as svcutil.exe. There's also a method to trick svcutil.exe using Fiddler.

              The Java sample has code for skipping certificate validation, so I don't think that's the problem you are getting there. I recommend looking in C:\ProgramData\Solarwinds\InformationService\v2.0\Orion.InformationService.log to see if you see any errors there. You can also check that the HTTPS endpoint for SWIS is working by using SWQL Studio (which is installed with the SDK) to connect using the "Orion over HTTPS" server type.

                • Re: Trouble getting the Java Client example to work
                  tcwatkins

                  Hello

                  I am trying to create a SWIS Client using c#. I used the "Add Service Reference" in Visual Studio to get the proxy classes. When I run my client code, when it goes to query the database I get a "RunQuery failed, check fault information" error. Here is my code:

                   

                  static void Main(string[] args)

                          {

                              byte[] response = new byte[256];

                   

                              ServiceReference1.InformationServiceClient client = new ServiceReference1.InformationServiceClient("BasicHttpBinding_InformationService");

                              client.ClientCredentials.UserName.UserName = "admin";

                              client.ClientCredentials.UserName.Password = "";

                   

                              string query = "SELECT NodeID, Caption FROM Orion.Nodes";

                   

                              ServiceReference1.QueryOptions options = new ServiceReference1.QueryOptions();

                              options.outputFormat = 0;

                             

                              Trust.InitiateSSLTrust();

                              response = client.Query(query,options);

                             

                              client.Close();

                          }

                   

                  The error happens at "response = client.Query(query,options);"

                  Thanks