www.webdeveloper.com
Results 1 to 2 of 2

Thread: VBScript to invoke the web service

  1. #1
    Join Date
    Jul 2012
    Posts
    2

    VBScript to invoke the web service

    Hi

    I am creating VB script for the first time and don't know anything about it.

    I have to create a vb script to call a web service(Web service is hosted in Tibco BW) . We have two input parameters for web service.

    I have got the following code from internet, but it is giving me error:
    Object Required string: "application/x-www-fo"(Line No 11)

    VB Script:
    option Explicit

    'Declare Variables
    Dim objCreated, objDate
    Dim objFileToWrite
    Dim fso 'As Scripting.FileSystemObject
    Dim oWinHttp,sContentType , sWebServiceURL, sSOAPAction, sSOAPRequest,sResponse,servicename

    Set oWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
    'Set sContentType="application/soap+xml;charset=UTF-8"
    Set sContentType="application/x-www-form-urlencoded"
    sSoapAction = "/SharedResources/WebService/Service.serviceagent/PortTypeEndpoint1/ApplicationStatus"
    sWebServiceURL = "http://localhost:7858/SharedResources/WebService/Service.serviceagent/PortTypeEndpoint1"


    oWinHttp.Open "POST", sWebServiceURL, False
    oWinHttp.setRequestHeader "Content-Type", sContentType
    oWinHttp.setRequestHeader "SOAPAction", sSOAPAction
    oWinHttp.Send sSOAPRequest
    sResponse = oWinHttp.ResponseText
    Set oWinHttp = Nothing


    I am even not sure if this VB script is correct one for me.


    Can anybody help me in this regard.

  2. #2
    Join Date
    Jul 2012
    Posts
    2
    Does anyone has any idea on this ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles