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

Hello all, I asked a question about pushing and X509 certificate using SOAP the other day and it turns out I asked the wrong question. I have to attach my certificate during the SSL handshake (which is outside of the soap envelope). I think NET::SSLeay will do the trick, but I can not figure out the syntax. I am assuming I need to do something like the following:
use Net::SSLeay, qw(get_https make_headers); ($page, $result, %headers)= get_https('www.websiteIwanttogoto.com', 44 +3, '/address of their soap service', make_headers(Authorization => somehow put my certificate here));
I am confused how to get my soap call in there and what exact syntax might be. Any help will be much appreciated. I have tried putting the certificate in the SOAP call (in the envelope), I have tried exporting it through Apache, and now this. If nothing else, I am getting exposed to a lot ...

Replies are listed 'Best First'.
Re: Using Net::SSLeay and Soap
by bpphillips (Friar) on Sep 16, 2004 at 16:13 UTC
      Yes I am using Soap lite, so I will take a look at what you have sent me and reply back. This is the most exciting news I have heard for DAYS! Thanks
Re: Using Net::SSLeay and Soap
by Hammy (Scribe) on Sep 16, 2004 at 19:01 UTC
    Life is almost good that solved my problem with pushing the certificate, but I have one more problem - I am getting an error returned from their service that says
    Server did not recognize the value of HTTP Header SOAPAction: http://d +i.wellmed.com/SoapService#PerformUpdate.
    the person owning the service says they are expecting
    http://di.wellmed.com/SoapService/PerformUpdate
    The problem here is Soap Lite attaches the call to the method to the end of the URI with the '#' sign. How do I override that? Any ideas. I tried just putting in soapAction and putting in the actual .../PerformUpdate, but it told me it does not recognize PerformUpdate and may be forgot to load SOAP::SOM? Any ideas. Thanks again for the first part!
      I'm not sure if this will fix it or not but I think you need to specify an "on_action" property. This can either go in your use SOAP::Lite statement like:
      use SOAP::Lite on_action => sub{join '', @_};
      or I think you can also do it in your call like:
      my $soap = SOAP::Lite->new(%options)->uri($uri)->proxy($server)->on_ac +tion(sub{join ' ', @_});
      You'll have to try it out and see whether you need to put the '/' on the end of the proxy address to get it to look right.

      The perldoc for SOAP::Lite talks a bit about communicating with .Net (look at "To use SOAP::Lite client and .NET server") which I'm guessing is applicable to you.

      HTH --b
        Is Love too strong a term here! Our processes still do not work, but I am getting an XML document back from them that indicates an exception error in their service. The error at least indicates that the connection is made and the certificate is recognized. Thank You - Thank You