Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2005, 02:14 PM
Authorized User
 
Join Date: Oct 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default SOAP attachments - VB6

Hi Everyone
I need some urgent help getting an attachment out of a SOAP request in VB6.

My code so far 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?

"A spirit with a vision is a dream with a mission"
__________________
\"A spirit with a vision is a dream with a mission\"
 
Old August 25th, 2005, 11:56 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Does intellisense show the LoadWithParser method, what's the definition in the object browser? I've never used the reader but most examples just have a load method.

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 & SOAP multipart attachments forkhead XML 2 November 27th, 2012 05:06 PM
Regarding Attachments mvnaidu ASP.NET 1.0 and 1.1 Professional 2 June 26th, 2006 07:49 AM
attachments nishant_k JSP Basics 2 December 10th, 2004 04:19 PM
attachments lily611 Forum and Wrox.com Feedback 1 June 15th, 2004 08:37 AM
Calling WebService from VB6 without use SOAP toolk sanjaykabra82 .NET Web Services 1 February 25th, 2004 08:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.