Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Perl Version: ActiveState 5.6.1, 633. Platform: Windows 2000

I want to call a SOAP server on an internal network. How do you tell SOAP::Lite not to use proxy?
Example:
use SOAP::Lite; print SOAP::Lite -> uri('http://internalserver/WebServices/Mail.WSDL') ->proxy('What Goes here') ->SendMail ("email address", "Test subject", "Test Message") ->result; # If I take the proxy line out or put in 'false' I get an error tellin +g me I need it. # VB equivalent Set soapClient = CreateObject("MSSOAP.SoapClient") soapClient.mssoapinit "http://internalserver/WebServices/Mail.WSDL" soapClient.ConnectorProperty("UseProxy") = False soapClient.SendMail "Email address", "Test subject", "Test message"
Any help would be much appreciated, thanks.

Edit: BazB, changed title; was "SOAP:Lite"

Replies are listed 'Best First'.
Re: Using SOAP::Lite without a proxy
by meetraz (Hermit) on Oct 30, 2003 at 20:46 UTC
    The URL & Proxy parameters are used when you don't have a WSDL to reference. Since you do have a WSDL file, Try this:

    use SOAP::Lite; print SOAP::Lite -> service('http://internalserver/WebServices/Mail.WSDL') -> SendMail ("email address", "Test subject", "Test Message");
      Thanks for getting back to me.

      I tried your sugestion, but I get the following error:

      401 Access Denied

      How can I pass credentials? I didn't see it in the documentation. In VB it would be...
      ConnectorProperty("AuthUser") = "domain\username" ConnectorProperty("AuthPassword") = "Password"

        If the endpoint uses basic authentication then you have to override the get_basic_credentials method in SOAP::Transport::HTTP::Client...

        sub SOAP::Transport::HTTP::Client::get_basic_credentials { return('domain\username','Password'); }

        perl.com has a good SOAP::Lite tutorial which covers other kinds of authentication you might encounter on the endpoint.


        We're not surrounded, we're in a target-rich environment!