加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

利用perl soap服务向.net、https服务端传送UserToken

发布时间:2020-12-15 20:51:44 所属栏目:大数据 来源:网络整理
导读:服务端传送数据使用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

服务端传送数据使用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 ""; ??? ??? }???

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读