在asp.net中调用Axis Web服务 [英] Invoke Axis Webservice in asp.net

查看:572
本文介绍了在asp.net中调用Axis Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我从第三方那里得到了一个Web服务,他们分配了一个URL(不是wsdl或asmx).样本网址:http://100.100.100.100/services/spm

如果我在浏览器中提供该网址,则会显示.

这是AXIS服务!
也许这里会有一种调用服务的表格.


现在,我需要的是访问给定URL中的服务.他们已经得到我的IP地址用于认证puprose.我正在使用asp.net c#

现在,如何在该URL中调用Web服务?
有人可以提出想法吗?如果您需要更多信息,请告诉我.

预先感谢.

Hi all,

I got a webservice from a third party.They have assigned a URL.(Not wsdl nor asmx). Sample url:http://100.100.100.100/services/spm

If i give the url in browser, it shows.

Hi there, this is an AXIS service!
Perhaps there will be a form for invoking the service here..


Now all i need is to access the service in the given url. They alredy got my ip address for authendication puprose. I am using asp.net c#

Now, How can i call the Webservice in that URL?
Could anybody give some idea? Please let me know, if you need more information.

Thanks in advance.

推荐答案



使用MSXML术语可以实现IT


Hi,

ITs possible using MSXML terminology


Hi,

Yes it is possible with msxml. The below code is a complete working code where you have to replace with values that u want.

strDetail = "XMLHTTP"
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
With objXMLHTTP
    strDetail = "POST"
    .Open "POST", mstrMethod, False

    strXML = "<?xml version=""1.0"" encoding=""utf-8""?>" & _
    "<soap:Envelope" & _

    " xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""" & _

    " xmlns:xsd=""http://www.w3.org/2001/XMLSchema""" & _

    " xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/""" & _

    " xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
    "<soap:Body soap:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"" >" & _
    "<MethodName xmlns="" http://webservicenamespace/Service/"">" & _
    "<argument1>" arg "</argument1>" & _
    "<argument2>" agr1 "</argument2>" & _
    "</MethodName >" & _
    "</soap:Body>" & _
    "</soap:Envelope>"

    strDetail = "SET REQUEST HEADER"
    .setRequestHeader "Content-Type", "text/xml"
    .setRequestHeader "encoded", "true"
    .setRequestHeader "encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/"
    .setRequestHeader "SOAPAction", mstrMethod

    strDetail = "SEND XML"
    .send (strXML)

    strDetail = "RESPONSE"
    strResponse = .responseText
    strDetail = "loadXML"
    objDom.loadXML strResponse

End With
strDetail = "RETURN VALUE"
Set objNode = objDom.getElementsByTagName("return")

Reply Quote


这篇关于在asp.net中调用Axis Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆