服务端传送数据使用SSL加密    基于wsse2.0开发的.net webservice

soap xml:   

  message = qq{  <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">  
        <soap:Header>
            <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
                <wsse:UsernameToken>
                    <wsse:Username>u_name</wsse:Username>
                    <wsse:Password>u_pwd</wsse:Password>
                </wsse:UsernameToken>
            </wsse:Security>

          </soap:Header>       
          <soap:Body>
            ......
            </soap:Body>
        </soap:Envelope>};

 

my $userAgent = LWP::UserAgent->new();
    $userAgent->credentials('globusfamily.com:80','',$u_name,$u_pwd);
    my $request = HTTP::Request->new(POST => $vendor_url);

 

$request->authorization_basic('amy@gotobus.com', 'gotobus888');
        $request->header(SOAPAction => 'http://www.globusfamily.com/api/booking/ws/internal/GVI_Booking');
        $request->content($message);   
        $request->content_type("text/xml; charset=utf-8");   
        my $response = $userAgent->request($request);
        #die $message;
        if($response->code == 200) {
   
            my $return_xml = $response->as_string;       
            $return_xml = JUtility->unescape_XML($return_xml);
            $return_xml =~ s/&amp;/&/g;           
        }
        else
        {

            return "";
        }