“EndpointDispatcher上的AddressFilter不匹配”

时间:2013-12-18 23:53:11

标签: wcf soap vbscript asp-classic

我试图通过使用SOAP 1.2消息连接到某些WCF Web服务来扩展经典ASP站点。所以在客户端,没有绑定我只是使用XMLHTTP。

由于EndpointDispatcher上的AddressFilter不匹配,我得到了可怕的“带有To的消息”无法在接收方处理。错误。

我的客户端使用的是自签名SSL证书,服务端也设置了SSL证书。

此问题的大多数解决方案都涉及客户端上的ServiceBehavior配置以关闭地址过滤器,但在这种情况下不适用。有什么帮助吗?

代码

我在VBScript中创建了一个类

Class SOAPRequest 
    Private objXMLHttp, webServiceURL, contentType
    Public servicePath, XmlNS, action, SOAPRequest, SOAPResponse 

    Private Sub Class_Initialize 
        set objXMLHttp = Server.CreateObject("MSXML2.XMLHTTP")
        webServiceURL =  Application("Web Service URL")
        contentType =    "application/soap+xml;charset=UTF-8" 
    End Sub 

    Public Function SendRequest 
        'Open HTTP connection  
        objXMLHttp.Open "POST", webServiceURL & "/wcf/" & servicePath, False 

        'Setting request headers  
        objXMLHttp.setRequestHeader "Content-Type", contentType 
        objXMLHttp.setRequestHeader "SOAPAction", webServiceURL & "/wcf/" & servicePath & "?wsdl"

        dim SOAPEnvelopeStart, SOAPEnvelopeEnd
        SOAPEnvelopeStart = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:urn='" & XmlNS & "'><soap:Header/><soap:Body>"
        SOAPEnvelopeEnd = "</soap:Body></soap:Envelope>"            

        'Send SOAP request 
        objXMLHttp.Send SOAPEnvelopeStart & SOAPRequest & SOAPEnvelopeEnd

        'Get XML Response 
        SOAPResponse = objXMLHttp.ResponseText 
    End Function 

    Public Function Close 
        Set objXMLHttp = Nothing 
    End Function 
End Class 

然后我称之为

set objSOAP = New SOAPRequest

'set up the request
with objSOAP
    .servicePath    = "myservice.svc"       
    .XmlNS          = "urn:MyNamespace"
    .action         = "Action"
    .SOAPRequest    = "<urn:GetMyData></urn:GetMyData>"
end with

objSOAP.SendRequest

0 个答案:

没有答案