Logo
English Russian German French Spanish Italian
contact usprivacy
   Support Forums
chart
• Adjust flexgrid cell
• Animation
• Centering form text
• Coffee machine
• Creating fileshares
• Creating shortcuts
• Custom buttons
• Directory browser
• Disable mouse events
• File search by ext
• File transfer
• File watcher
• Formatting flexgrid
• Get Content Type
• Get HTML source
• Get modem port
• HTTP proxy
• ipconfig
• Large file split/merge
• MAPI
• MCI Sound Player
• Menu with images
• MP3 normalizer
• Net Send
• Netstat 2000
• No duplicate entries
• Outlook Address Book
• Set font color
• Shapes
• SOAP test
• Text-to-image
• Text file viewer
• Text find/replace
• UPS component
• View NT groups
• Word template
• Writing DNS control
    • Using DNS control
• Writing SMTP control
    • Sending email
    • Mailing list
• Writing WhoIs control
    • Using WhoIs control
• View HTML source
OISV - Organization of Independent Software Vendors - Contributing Member
VB projects - SOAP test

Description: sending test SOAP request to web service and displaying response
Minimum requirements: VB6
Download: source code
Screenshot:
VB projects - SOAP test
Project: EXE
Controls: CommandButton cmdRequest, TextBox txtResponseHeaders (MultiLine = -1 'True, ScrollBars = 2 'Vertical), TextBox txtResponse (MultiLine = -1 'True, ScrollBars = 2 'Vertical)
Additional references: Microsoft XML, v3.0 (msxml3.dll)
Code:
Option Explicit

Private Sub cmdRequest_Click() Dim o As New XMLHTTP Dim s As String On Error GoTo err_handler s = s & "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf s = s & "<SOAP-ENV:Envelope" & vbCrLf s = s & "SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""" & vbCrLf s = s & "xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/""" & vbCrLf s = s & "xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/""" & vbCrLf s = s & "xmlns:ns0=""capeconnect:GlobalWeather:GlobalWeather""" & vbCrLf s = s & "xmlns:xsd=""http://www.w3.org/2001/XMLSchema""" & vbCrLf s = s & "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" & vbCrLf s = s & "<SOAP-ENV:Body>" & vbCrLf s = s & "<ns0:getWeatherReport>" & vbCrLf s = s & "<code xsi:type=""xsd:string"">CYVR</code>" & vbCrLf s = s & "</ns0:getWeatherReport>" & vbCrLf s = s & "</SOAP-ENV:Body>" & vbCrLf s = s & "</SOAP-ENV:Envelope>" & vbCrLf o.open "POST", "http://live.capescience.com:80/ccx/GlobalWeather", False o.setRequestHeader "Content-Type", "text/xml" o.setRequestHeader "Connection", "close" o.setRequestHeader "SOAPAction", "" o.send s txtResponseHeaders = o.getAllResponseHeaders txtResponse = o.responseText err_handler: If Err.Number <> 0 Then MsgBox "Error " & Err.Number & ": " & Err.Description End Sub

Copyright © 1996-2010 OstroSoft. All rights reserved. info@ostrosoft.com