Forum Discussion

haeoraki_127471's avatar
haeoraki_127471
Icon for Nimbostratus rankNimbostratus
Mar 17, 2004

SOAPHTTPConnection Error

I decided to use SOAP.

 

 

I installed iControl SDK on my computer. I compiled successfully SOAP Java Sample code - the codes are at iControl-4.5\iControl-4.5\sdk\support\SOAP\java

 

 

When I execute java code, error message displayed like this :

 

run.bat GlobalLBDataCenter 156.147.36.225 80 XXXX XXXX     
          
 [SOAPException: faultCode=SOAP-ENV:Client; 
   msg=Error opening socket: java.net.ConnectException: Connection refused: 
     connect; targetException=java.lang.IllegalArgumentException: 
   Error opening socket: java.net.ConnectException: Connection refused: connect]     
 at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:354)     
   at org.apache.soap.rpc.Call.invoke(Call.java:248)     
   at support.SOAP.java.GlobalLB.GlobalLBDataCenter.getDataCenterList 
     (GlobalLBDataCenter.java:154)     
   at support.SOAP.java.GlobalLB.GlobalLBDataCenter.processRequest 
     (GlobalLBDataCenter.java:302)     
   at support.SOAP.java.GlobalLB.GlobalLBDataCenter.main 
     (GlobalLBDataCenter.java:312)

 

 

156.147.36.225 is ip and 80 is port. XXXX are id and password.

 

Because SOAP use http protocol I wrote port 80. Am I wrong?

 

 

How can I get the port which support SOAP?

10 Replies

  • Upper is very useful for me. It is very good article.

    I download the file /config/bigconfig/server_fully_qualified_file.crt from BIG-IP and execute the command

      
       keytool -import     
         -alias mykey     
         -keystore "C:\Documents and Settings\Administrator\.keystore"     
         -file server_fully_qualified_file.crt 
            (at my company server_fully_qualified_file.crt => bigip1.lge.com.crt)   

    When I execute the command( run GlobalLBDataCenter 156.147.36.225 443 id password ), I met other Error like this :

          
       at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)    
       at org.apache.soap.rpc.Call.invoke(Call.java:255)    
       at support.SOAP.java.GlobalLB.GlobalLBDataCenter.getDataCenterList 
         (GlobalLBDataCenter.java:154)    
       at support.SOAP.java.GlobalLB.GlobalLBDataCenter.processRequest 
         (GlobalLBDataCenter.java:302)    
       at support.SOAP.java.GlobalLB.GlobalLBDataCenter.main    
         (GlobalLBDataCenter.java:312)

    To my thinking, connection is completed and other error occurred. Right?
  • You are getting a connection refused exception becuase all of our interfaces are encrypted over ssl so you will have to use https with port 443. The correct url for our iControl endpoint is

     

     

    https://

     

     

    Since you are using java, once you try this I guarantee you will get a different connection error. Take a look at the following tech article on our site that describes the issue and what you need to do to work around it.

     

     

     

     

    This article illustrates how to manually install the server certificate into the client's truststore. Since this article was written, I've uploaded a command line tool that will do it automatically. You can get it in the java section of CodeShare on DevCentral.

     

     

     

     

    On thing to keep in mind is that you will have to already have a truststore created before you use this app. If you don't have one, you can generate one with the jdk "keytool" commmand with the "-genkey" parameter.

     

     

    Good luck, and let us know how it goes...

     

     

    -Joe
  • It looks like you do not have the iControl endpoint specified correctly. The error stating that the "A problem has occurred in the configuration utility" tells me that you are trying to access the web GUI and not the iControl endpoint. Make sure that your namespace and url are set correctly to

     

     

    https://bigip_address/iControl/iControlPortal.cgi

     

     

    URL deskURI;    
      String urn;    
      destURI = new URL("https:///iControl/iControlPortal.cgi");    
      urn = "urn:iControl:ITCMSystem/SystemInfo";  <-- or whichever  
       interface you are trying to access.  The format is  
       urn:iControl//    
      Response resp = call.invoke(destURI, urn);

     

     

    All of these steps are illustrated in the SDK sample code. I'd recommend you compare your code to the sample code to make sure you are setting the values correctly.

     

     

    Cheers,

     

     

    -Joe
  • I entered web admin id, password. So Authorization Error disappered but

     
      [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content ty  
      pe "text/html", must be: "text/xml". Response was:  
        
        
                ;/bigipgui/scripts/styles.css">  
              Configuration Utility  
                
        
        ;  
                
                                             
                                        
                                      A problem has occurred in the configuration util  
      ity.  
                                        
                                      An attempt to re-load the requested page will be  
       made every 5 seconds  
                                      while the system automatically recovers from thi  
      s error.  
                                        
                                      If the configuration utility does not recover fr  
      om this error within  
                                      30 seconds, the error was likely unrecoverable a  
      nd a customer service  
                                      representative should be contacted.  
                                        
                                                                                             
                
        
        
        
        
      ]  
              at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)  
              at org.apache.soap.rpc.Call.invoke(Call.java:255)  
              at support.SOAP.java.LocalLB.LocalLBNode.getProperty(LocalLBNode.java:86  
      )  
              at support.SOAP.java.LocalLB.LocalLBNode.getNodeState(LocalLBNode.java:2  
      11)  
              at support.SOAP.java.LocalLB.LocalLBNode.processRequest(LocalLBNode.java  
      :249)  
              at support.SOAP.java.LocalLB.LocalLBNode.main(LocalLBNode.java:257) 
     
  • The last section says it all:

    "

    [b:f801fb6e23]401 Authorization Required[/b:f801fb6e23]

    Authorization Required

    This server could not verify that you

    are authorized to access the document

    requested. Either you supplied the wrong

    credentials (e.g., bad password), or your

    browser doesn&t understand how to supply

    the credentials required."

    This means you do not have the correct user credentials. These would be the same credentials you use to log into the Web based GUI configuration. The username and password are attributes of the SOAPHTTPConnection object and can be set as follows:

    // Perform basic authentication requested by the server.  
      SOAPHTTPConnection connection = new SOAPHTTPConnection();  
      connection.setMaintainSession(true);  
      connection.setUserName("username_goes_here");   <--- ***  
      connection.setPassword("password_goes_here");   <--- ***  
      call.setSOAPTransport(connection);

    -Joe
  • Thanks for the comments on the article. I'm glad that my writing is helping some people B-).

     

     

    As for that exception, it sure doesn't tell you much. This doesn't look like a connectivitiy issue but just to be sure you can add the java debug flag in the run script

     

     

    Set SSL_DEBUG=-Djavax.net.debug=ssl

     

     

    It should be in all the run.bat(Windows) and run.sh(Unix) scripts and you just uncomment the declaration.

     

     

    This will print out a bunch of status and network data that should help isolate whether it is an ssl issue.

     

     

    -Joe
  • Excellent! Please let us know what you are doing with iControl and don't hesitate to post questions whenever they arise.

     

     

    -Joe
  • Kernel Version: BIG-IP Kernel 4.5.10 Build84

     

     

    I'm having a similar problem to the post on 3/18/2004 5:39:12 AM

     

     

    I had an iContol app set up and working fine until we changed the management IP. Now when I point to the new IP I get the following error:

     

     

     

    Error: Client found response content type of 'text/html', but expected 'text/xml'. The request failed with the error message: --

     

    A problem has occurred in the configuration utility.

     

    An attempt to re-load the requested page will be made every 5 seconds while the system automatically recovers from this error.

     

     

    If the configuration utility does not recover from this error within 30 seconds, the error was likely unrecoverable and a customer service representative should be contacted.

     

     

     

    --.

     

    Stack Trace: at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at QAControl_V1._0.Pool.ITCMLocalLBPool.get_list() in c:\inetpub\wwwroot\QAControl V1.0\Web References\Pool\Reference.vb:line 50 at QAControl_V1._0.clsPool.getPoolList(String sHost, String sUser, String sPwd) in c:\inetpub\wwwroot\QAControl V1.0\clsPool.vb:line 18 at QAControl_V1._0.WebForm1.btnGetPools_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\QAControl V1.0\WebForm1.aspx.vb:line 75 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain()

     

     

    I'm not sure why changing the management IP would cause this. I can view the WSDL and the web configuration utility at the new IP. The same app continues to work against other BigIP boxes on the network... the only variable in the code is the IP of the target BigIP. Also, I get my project web reference from a BigIP that hasn't changed IPs.
  • The fact that it says that the server is returning 'text/html' instead of 'text/xml' tells me that the SOAP request isn't getting to the iControl server code but is getting stopped at the management interface.

     

     

    The first thing I would suggest is that you test the WSDL endpoint which it looks like you already have done.

     

     

    Another question would be whether you rebooted the system after you changed the admin ip? I don't know how this would effect the functionality of the iControl portal, but it's worth a shot.

     

     

    The only think left I can think of is that on 4.x, the core of our processing is performed in a CORBA server. If the SOAP endpoint cannot communicate with the CORBA server, then I could see a possible issue.

     

     

    What I would suggest at this point is to take one of the perl samples out of the SDK (say sdk/support/soap/System/SystemInfo.pl), put it on your BIG-IP, and run it to test the iControl endpoint (using the new management address). If this fails as well, then we can narrow it down to functionality within the iControlPortal itself, and not the configuration of the administrative webserver.

     

     

    Let me know if the perl sample works for you. If not, then we can do a few more debugging on the server to find out where things are failing.

     

     

    If you try all this out and the perl sample doesn't work, then you will be better off contacting F5 Tech Support and get a case for this issue. DevCentral is meant primarily for developer support and there are limits to the level of product support we can offer. It is looking like this is a product specific configuration issue.

     

     

    -Joe
  • Loc_Pham_101863's avatar
    Loc_Pham_101863
    Historic F5 Account
    Another note is that since the Portal was spinned up using the old IP address, when changing the management IP, you might need to rerun "config" (select "I" option) to change the iControl Portal's IIOP/FSSL address to this new IP, so that the Portal can start listening for requests on the new address. Once the new IIOP address is changed, you'll have to restart the Portal and the CORBA servers by:

     

     

    bigstart shutdown portal

     

    bigstart start portal

     

    bigstart start corbalocallb

     

    bigstart start corbasystem

     

    bigstart start corbanetwork

     

    bigstart start corbamgmt

     

     

    Hope this helps.

     

    Thanks,

     

    Loc