k to the z
k to the z

Reputation: 3185

PHP SoapClient on tcp port 808

Normally using SOAP over port 80 is simple:

$client = new SoapClient('http://domain.com/webservice?wsdl');

How would you consume the web service over another tcp port? (Not 80 or 443)

Upvotes: 1

Views: 3943

Answers (1)

masoud
masoud

Reputation: 56479

Try :

http://domain.com:808/webservice?wsdl

=>

$client = new SoapClient('http://domain.com:808/webservice?wsdl');

Term :808 indicates port number of an URI, if you omit it, it will use default port number for specified protocol. (80: for HTTP)

RFC 3986:

In general, a URI that uses the generic syntax for authority with an empty path should be normalized to a path of "/". Likewise, an explicit ":port", for which the port is empty or the default for the
scheme, is equivalent to one where the port and its ":" delimiter are elided and thus should be removed by scheme-based normalization. For example, the second URI above is the normal form for the "http"
scheme.

A good overview for URI is here.

Upvotes: 2

Related Questions