Jump to content

Web Services


neo-truth

Recommended Posts

Greetings, all:

 

I have a website hosted with IX Webhosting.  I'm attempting to use the website to communicate with a program I have on the application server here at my office.  I have tried using both Keith Deven's XML-RPC Library for PHP as well as nuSOAP and get similar results with both.  I can't seem to open a connection to the local server.  I can plug in the IP address into a browser and it will open up the Axis service page as well as the WSDL for our program, but when I use the same URLs in the PHP scripts, it times out every time.  I've also tried just using a simple fsockopen() script to rule out any issues with the code packages, but it doesn't work either.  When I plug in the wrong port number (e.g. https instead of web services) I get a 400 bad request response, but with the right port number, it just times out.

 

Is it possible my web host is somehow blocking this sort of connection?  Could it be a local issue with the firewall or server setup -- if so, why can I open the URL in a browser?

 

I'm really at a wall here.  I've exhausted my limited knowledge.  I'm not a "professional" developer, but I need to get this working for our business.  Any help would be greatly appreciated. :)

Link to comment
Share on other sites

Well, here's the long story.  I have been playing around with HTML and the like for the past 10-12 years.  I made websites for myself and occasionally for friends or family.  I have no real formal education in programming aside from one semester in C++ about 4 years ago (I made an A if that counts for anything  ;D).  I've played around with PHP casually off and on during that time.

 

My step-father owns several businesses and I've made websites for two of them.  I don't run any businesses, I'm just the guy that got suckered into making websites and doing "computer stuff" for my step-father.

 

The site in question is bristolautoauction.net.  It's coded in PHP/MySQL and held together with duct tape and super glue.  Everything was going fine until they installed a new program and computer system at the auction.  The program-maker installed application and database servers that handle the program at the auction.  Now they want to use web services to keep the servers and website in sync.  So, I have to try and make that work.

 

I've tried numerous different approaches and haven't made any headway.  I really don't know how to proceed.  I decided I would post here, since I'm using PHP as a web services client, and ask for some form of help or guidance.

 

Here is the nuSOAP PHP code I am trying to use (I've replaced the actual IP and port with "ip:port"):

<?php
// Pull in the NuSOAP code
require_once('../../nusoap/lib/nusoap.php');
// Create the client instance
$client = new nusoap_client('http://ip:port/VeroWebService/services/VeroWebService');

// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<p><b>Constructor error: ' . $err . '</b></p>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call(
'getVehiclesForPresale',	// method name
array('SaleId' => '4'),		// input parameters
'urn:VehicleModel',			// namespace
'VasWebService'				// SOAPAction
);


// Check for a fault
if ($client->fault) {
    echo '<p><b>Fault: ';
    print_r($result);
    echo '</b></p>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<p><b>Error: ' . $err . '</b></p>';
    } else {
        // Display the result
        print_r($result);
    }

// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';

}

?>

 

Basically copied and pasted from the documentation.

 

And here is the Debug information that nuSOAP spits out:

 

Error: HTTP Error: Couldn't open socket connection to server http://ip:port/VeroWebService/services/VeroWebService, Error (110): Connection timed out
Request

Response

Debug

2007-11-26 10:28:16.567644 nusoap_client: ctor wsdl= timeout=0 response_timeout=30
endpoint=string(61) "http://ip:port/VeroWebService/services/VeroWebService"
2007-11-26 10:28:16.567748 nusoap_client: instantiate SOAP with endpoint at http://ip:port/VeroWebService/services/VeroWebService
2007-11-26 10:28:16.567830 nusoap_client: call: operation=getVehiclesForPresale, namespace=http://ejb.bll.webservices.vas.vero.com, soapAction=http://ip:port/VeroWebService/services/VeroWebService?VasWebService, rpcParams=, style=rpc, use=encoded, endpointType=soap
params=array(1) {
  ["SaleId"]=>
  string(1) "4"
}
headers=bool(false)
2007-11-26 10:28:16.568048 nusoap_client: serializing param array for operation getVehiclesForPresale
2007-11-26 10:28:16.568121 nusoap_client: in serialize_val: name=SaleId, type=, name_ns=, type_ns=, use=encoded, soapval=
value=string(1) "4"
attributes=bool(false)
2007-11-26 10:28:16.568223 nusoap_client: serialize_val: serialize string
2007-11-26 10:28:16.568291 nusoap_client: serialize_val returning <SaleId xsi:type="xsd:string">4</SaleId>
2007-11-26 10:28:16.568341 nusoap_client: wrapping RPC request with encoded method element
2007-11-26 10:28:16.568410 nusoap_client: In serializeEnvelope length=156 body (max 1000 characters)=<ns4082:getVehiclesForPresale xmlns:ns4082="http://ejb.bll.webservices.vas.vero.com"><SaleId xsi:type="xsd:string">4</SaleId></ns4082:getVehiclesForPresale> style=rpc use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
2007-11-26 10:28:16.568457 nusoap_client: headers:
bool(false)
2007-11-26 10:28:16.568512 nusoap_client: namespaces:
array(0) {
}
2007-11-26 10:28:16.568611 nusoap_client: endpoint=http://ip:port/VeroWebService/services/VeroWebService, soapAction=http://ip:port/VeroWebService/services/VeroWebService?VasWebService, namespace=http://ejb.bll.webservices.vas.vero.com, style=rpc, use=encoded, encodingStyle=http://schemas.xmlsoap.org/soap/encoding/
2007-11-26 10:28:16.568665 nusoap_client: SOAP message length=553 contents (max 1000 bytes)=<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns4082:getVehiclesForPresale xmlns:ns4082="http://ejb.bll.webservices.vas.vero.com"><SaleId xsi:type="xsd:string">4</SaleId></ns4082:getVehiclesForPresale></SOAP-ENV:Body></SOAP-ENV:Envelope>
2007-11-26 10:28:16.568746 nusoap_client: transporting via HTTP
2007-11-26 10:28:16.569473 nusoap_client: sending message, length=553
2007-11-26 10:28:16.568882 soap_transport_http: ctor url=http://ip:port/VeroWebService/services/VeroWebService use_curl= curl_options:
array(0) {
}
2007-11-26 10:28:16.568964 soap_transport_http: parsed URL scheme = http
2007-11-26 10:28:16.569012 soap_transport_http: parsed URL host = 72.12.57.2
2007-11-26 10:28:16.569058 soap_transport_http: parsed URL port = 5800
2007-11-26 10:28:16.569101 soap_transport_http: parsed URL path = /VeroWebService/services/VeroWebService
2007-11-26 10:28:16.569161 soap_transport_http: set header Host: ip:port
2007-11-26 10:28:16.569248 soap_transport_http: set header User-Agent: NuSOAP/0.7.3 (1.114)
2007-11-26 10:28:16.569372 soap_transport_http: set header Content-Type: text/xml; charset=ISO-8859-1
2007-11-26 10:28:16.569423 soap_transport_http: set header SOAPAction: "http://ip:port/VeroWebService/services/VeroWebService?VasWebService"
2007-11-26 10:28:16.569551 soap_transport_http: entered send() with data of length: 553
2007-11-26 10:28:16.569610 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host 72.12.57.2, port 5800
2007-11-26 10:28:16.569671 soap_transport_http: calling fsockopen with host 72.12.57.2 connection_timeout 0
2007-11-26 10:29:16.569552 soap_transport_http: Couldn't open socket connection to server http://ip:port/VeroWebService/services/VeroWebService, Error (110): Connection timed out
2007-11-26 10:29:16.569697 nusoap_client: Error: HTTP Error: Couldn't open socket connection to server http://ip:port/VeroWebService/services/VeroWebService, Error (110): Connection timed out

 

Every which way I've tried it, it times out.  When I've tried the https port, that doesn't point to the web service, a request and response are actually sent, which doesn't appear to happen with the correct port number.

 

If there's no issue with the PHP code, perhaps someone can suggest some other means of figuring this thing out.  I really don't know what the problem could be.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.