asp 调用 java写的webservic (用户和密码验证的)怎么调用??

greenjia0 2009-08-26 08:53:19
问题如上,我现在要调用一个java写的webservic(axis2),现在他那边要求用户名和密码验证,asp 怎么可以实现呀??
...全文
24 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
jerryleeee 2009-08-26
asp可以,之前有过帖子介绍构造包头
下面是包体 和调用

Function PostXmlAndGetResponse(PostToUrl,XmlBody)
set xhttp = createObject("Microsoft.XMLHTTP")
xhttp.open "POST", PostToUrl, False
xhttp.send XmlBody
PostXmlAndGetResponse= xhttp.responseText
set xhttp=nothing
End Function

if request.Form.count>0 then
PostToUrl="http://2**.1**.2.10/dsmp/dsmp.wsdl"
XmlBody=XmlBody+"<?xml version=""1.0"" encoding=""UTF-8"" ?> "&vbcrlf
XmlBody=XmlBody+"<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns=""http://www.monternet.com/dsmp/schemas/"">"&vbcrlf
XmlBody=XmlBody+"<SOAP-ENV:Header>"&vbcrlf
XmlBody=XmlBody+"<TransactionID xmlns=""http://www.monternet.com/dsmp/schemas/"" xsi:type=""xsd:string"">"&request.Form("TransactionID")&"</TransactionID> "&vbcrlf
XmlBody=XmlBody+"</SOAP-ENV:Header>"&vbcrlf
XmlBody=XmlBody+"<SOAP-ENV:Body>"&vbcrlf
XmlBody=XmlBody+"<UnSubscribeServiceReq xmlns=""http://www.monternet.com/dsmp/schemas/"">"&vbcrlf
XmlBody=XmlBody+"<Version>"&request.Form("Version")&"</Version> "&vbcrlf
XmlBody=XmlBody+"<MsgType>"&request.Form("MsgType")&"</MsgType> "&vbcrlf
XmlBody=XmlBody+"<Send_Address>"&vbcrlf
XmlBody=XmlBody+"<DeviceType>"&request.Form("Send_Address_DeviceType")&"</DeviceType> "&vbcrlf
XmlBody=XmlBody+"<DeviceID>"&request.Form("Send_Address_DeviceID")&"</DeviceID> "&vbcrlf
XmlBody=XmlBody+"</Send_Address>"&vbcrlf
XmlBody=XmlBody+"<Dest_Address>"&vbcrlf
XmlBody=XmlBody+"<DeviceType>"&request.Form("Dest_Address_DeviceType")&"</DeviceType> "&vbcrlf
XmlBody=XmlBody+"<DeviceID>"&request.Form("Dest_Address_DeviceID")&"</DeviceID> "&vbcrlf
XmlBody=XmlBody+"</Dest_Address>"&vbcrlf
XmlBody=XmlBody+"<FeeUser_ID>"&vbcrlf
XmlBody=XmlBody+"<UserIDType>"&request.Form("FeeUser_ID_UserIDType")&"</UserIDType> "&vbcrlf
XmlBody=XmlBody+"<MSISDN>"&request.Form("FeeUser_ID_MSISDN")&"</MSISDN> "&vbcrlf
XmlBody=XmlBody+"<PseudoCode /> "&vbcrlf
XmlBody=XmlBody+"</FeeUser_ID>"&vbcrlf
XmlBody=XmlBody+"<DestUser_ID>"&vbcrlf
XmlBody=XmlBody+"<UserIDType>"&request.Form("DestUser_ID_UserIDType")&"</UserIDType> "&vbcrlf
XmlBody=XmlBody+"<MSISDN>"&request.Form("DestUser_ID_MSISDN")&"</MSISDN> "&vbcrlf
XmlBody=XmlBody+"<PseudoCode /> "&vbcrlf
XmlBody=XmlBody+"</DestUser_ID>"&vbcrlf
XmlBody=XmlBody+"<Service_ID>"&vbcrlf
XmlBody=XmlBody+"<ServiceIDType>"&request.Form("ServiceIDType")&"</ServiceIDType> "&vbcrlf
XmlBody=XmlBody+"<ID>"&request.Form("ID")&"</ID> "&vbcrlf
XmlBody=XmlBody+"<SPServiceID>"&request.Form("SPServiceID")&"</SPServiceID> "&vbcrlf
XmlBody=XmlBody+"<AccessNo /> "&vbcrlf
XmlBody=XmlBody+"<FeatureStr />"&vbcrlf
XmlBody=XmlBody+"</Service_ID>"&vbcrlf
XmlBody=XmlBody+"<FeatureStr />"&vbcrlf
XmlBody=XmlBody+"</UnSubscribeServiceReq>"&vbcrlf
XmlBody=XmlBody+"</SOAP-ENV:Body>"&vbcrlf
XmlBody=XmlBody+"</SOAP-ENV:Envelope>"
'response.Write XmlBody
ReturnValue=PostXmlAndGetResponse(PostToUrl,XmlBody)
response.Write(ReturnValue)
回复
hookee 2009-08-26
可以用第三方组件比较简单 PocketSOAP http://www.pocketsoap.com/pocketsoap/
回复
ilxl520 2009-08-26
可以这样用吗??
回复
发动态
发帖子
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
社区公告
暂无公告