VB 6 and WSE 2.0
Hi Everyone
I need some help getting an attachment out of a SOAP request in VB6.
My code is :
Function UseSOAPClient(ByVal Method As String, _
Optional DocKey As String) As String
Dim SoapClient As SoapClient30
Dim Serializer As SoapSerializer30
Dim Reader As SoapReader30
Dim Parser As DimeParser30
Dim ResultElm As IXMLDOMElement
Dim FaultElm As IXMLDOMElement
Dim Connector As SoapConnector30
Dim strOutputXML As String
Const SoapAction = "getFileNamed"
Const END_POINT_URL = "http://axjcudft99:9081/DocRetrieval/services/GetDocService"
Const LIST_NAMESPACE = "http://presentment.docucorp.ib.metlife.com"
Const ENC = "http://schemas.xmlsoap.org/soap/encoding/"
Const env = "http://schemas.xmlsoap.org/soap/envelope/"
Const XSI = "http://www.w3.org/2001/XMLSchema-instance"
Const XSD = "http://www.w3.org/2001/XMLSchema"
Set Connector = New HttpConnector30
Connector.Property("EndPointURL") = END_POINT_URL
Connector.Connect
' binding/operation/soapoperation
Connector.Property("SoapAction") = SoapAction
Connector.BeginMessage
Set Serializer = New SoapSerializer30
With Serializer
.Init Connector.InputStream
.StartEnvelope , env
.SoapNamespace "xsi", XSI
.SoapNamespace "xsd", XSD
.SoapNamespace "SOAP-ENC", ENC
.StartBody
.startElement SoapAction, LIST_NAMESPACE
'begin writing XML for the request
.startElement "getDocKey"
.WriteString DocKey
.endElement
.endElement 'soapaction
.EndBody
.EndEnvelope
End With
Connector.EndMessage
Set Reader = New SoapReader30
Reader.LoadWithParser Connector.OutputStream, Parser 'the error is here.
If Not Reader.Fault Is Nothing Then
MsgBox Reader.FaultString.Text & vbCrLf & Reader.Fault.Text, vbExclamation
Else
Set ResultElm = Reader.Dom
End If
'Debug.Print Reader.RpcResult
End Function
The problem I'm having is on the line described. The error returned is "Invalid Procedure Call or Argument". Could someone shed some light on why this is?
|