Click here to Skip to main content
15,890,973 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Answer[Resolved] Re: My.Settings out of scope? Pin
Sonhospa24-Nov-16 2:32
Sonhospa24-Nov-16 2:32 
Questionvb.net using string and custom objects Pin
dcof18-Nov-16 17:10
dcof18-Nov-16 17:10 
AnswerRe: vb.net using string and custom objects Pin
Richard MacCutchan18-Nov-16 22:02
mveRichard MacCutchan18-Nov-16 22:02 
GeneralRe: vb.net using string and custom objects Pin
dcof21-Nov-16 5:31
dcof21-Nov-16 5:31 
GeneralRe: vb.net using string and custom objects Pin
Richard MacCutchan21-Nov-16 6:59
mveRichard MacCutchan21-Nov-16 6:59 
GeneralRe: vb.net using string and custom objects Pin
Dave Kreskowiak21-Nov-16 9:28
mveDave Kreskowiak21-Nov-16 9:28 
AnswerRe: vb.net using string and custom objects Pin
David Mujica21-Nov-16 10:56
David Mujica21-Nov-16 10:56 
Questionissue in vb script while using MSXML2.ServerXMLHTTP.6.0 object Pin
praveenvb17-Nov-16 0:17
praveenvb17-Nov-16 0:17 
C#
Hi We are calling the webservice function from vb script by using "MSSOAP.SoapClient30", the function returns the byte array and we are saving that as *.jar file below is the sample code

============================================================
sAdminSOAPUrl = "http://testapp.com:80/test/ecs/webservices/AdminService?wsdl"
Dim vaData
Set soapClient3 = CreateObject("MSSOAP.SoapClient30")
Call soapClient3.MSSoapInit(sAdminSOAPUrl, "AdminService", "AdminService")
soapClient3.ConnectorProperty("EndPointURL") = sAdminSOAPUrl

vaData = soapClient3.exportDeployment("test","test","test_data")

If (IsArray(vaData)) Then
rgData = vaData
WScript.Echo rgData
sFilename = sPath & "xplbio.jar"
hFile = FreeFile()

Open sFilename For Binary As #hFile
Put #hFile, , rgData
Close #hFile

Dim fso As New FileSystemObject
fso.CopyFile sFilename, sPath & sExportName & ".jar"
fso.DeleteFile sFilename, True
End If
============================================================

now we are trying to use the "MSXML2.ServerXMLHTTP.6.0" instead of "MSSOAP.SoapClient30" but facing issues while writing the response into *.jar file and its being corrupt. 
we have tried by channging the respose header as below but facing the same issue
"Content-Type", "text/xml; charset=utf-8",
"Content-Type" "multipart/form-data", 
"Content-Type" "application/x-www-form-urlencoded", 

is there any thing which I am missing please suggest, below is the sample updated code

==============================================================
' Namespaces.
Dim NS, NS_SOAP, NS_SOAPENC, NS_XSI, NS_XSD
NS_SOAP = "http://schemas.xmlsoap.org/soap/envelope/"

' Creates an XML DOM object.
Set DOM = CreateObject("MSXML2.DOMDocument.6.0") 

' XML DOM objects.
Dim Envelope, Body, Operation, Param
Const URL = "http://testapp.com:80/test/ecs/webservices/AdminService?wsdl"

' Creates the main elements.
Set Envelope = DOM.createNode(1, "soap:Envelope", NS_SOAP)
DOM.appendChild Envelope
Set Body = DOM.createElement("soap:Body")
Envelope.appendChild Body

' Creates an element for the exportDeployment function.
Set Operation = DOM.createNode(1, "exportDeployment","")
Body.appendChild Operation 

' Creates an element for the exportDeployment parameter
Set Param = DOM.createNode(1, "username","")
Param.Text = "test"
Operation.appendChild Param 

Set Param1 = DOM.createNode(1, "password","")
Param1.Text = "test"
Operation.appendChild Param1

Set Param2 = DOM.createNode(1, "deploymentName","")
Param2.Text = "test_data"
Operation.appendChild Param2

DIM test

Set XMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
XMLHTTP.Open "POST", URL, False 
XMLHTTP.setRequestHeader "Content-Type", "multipart/form-data; User-Agent: SOAP Sdk"
XMLHTTP.setRequestHeader "SOAPAction", URL
XMLHTTP.send DOM.xml 

' Loads the response to the DOM object.
DOM.LoadXML XMLHTTP.responseXML.xml 

' XML DOM objects.
Dim NodeList, Element, vaData 

' Searches for the exportDeploymentReturn object, which contains the value.
Set NodeList = DOM.getElementsByTagName("*")
For Each Element in NodeList
If Element.tagName = "exportDeploymentReturn" Then
vaData = Element.Text
Exit For
End If
Next 

If (IsArray(vaData)) Then
rgData = vaData
WScript.Echo rgData
sFilename = sPath & "xplbio.jar"
hFile = FreeFile()

Open sFilename For Binary As #hFile
Put #hFile, , rgData
Close #hFile

Dim fso As New FileSystemObject
fso.CopyFile sFilename, sPath & sExportName & ".jar"
fso.DeleteFile sFilename, True
End If
====================================================================

AnswerRe: issue in vb script while using MSXML2.ServerXMLHTTP.6.0 object Pin
Member 1032934426-Jul-17 17:23
Member 1032934426-Jul-17 17:23 
QuestionSet Focus on a textbox after showing form.showdialog() Pin
Hermawan2611-Nov-16 19:46
Hermawan2611-Nov-16 19:46 
AnswerRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard MacCutchan11-Nov-16 23:20
mveRichard MacCutchan11-Nov-16 23:20 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard Deeming12-Nov-16 3:55
mveRichard Deeming12-Nov-16 3:55 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard MacCutchan12-Nov-16 4:33
mveRichard MacCutchan12-Nov-16 4:33 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard Deeming12-Nov-16 4:37
mveRichard Deeming12-Nov-16 4:37 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard MacCutchan12-Nov-16 4:46
mveRichard MacCutchan12-Nov-16 4:46 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard Deeming12-Nov-16 5:48
mveRichard Deeming12-Nov-16 5:48 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard MacCutchan12-Nov-16 21:28
mveRichard MacCutchan12-Nov-16 21:28 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Dave Kreskowiak12-Nov-16 6:47
mveDave Kreskowiak12-Nov-16 6:47 
GeneralRe: Set Focus on a textbox after showing form.showdialog() Pin
Richard Deeming12-Nov-16 11:44
mveRichard Deeming12-Nov-16 11:44 
QuestionWhy this sub is executed 3 times ? Pin
desanti7-Nov-16 18:26
desanti7-Nov-16 18:26 
AnswerRe: Why this sub is executed 3 times ? Pin
Eddy Vluggen11-Nov-16 7:17
professionalEddy Vluggen11-Nov-16 7:17 
GeneralRe: Why this sub is executed 3 times ? Pin
desanti11-Nov-16 19:28
desanti11-Nov-16 19:28 
GeneralRe: Why this sub is executed 3 times ? Pin
Eddy Vluggen12-Nov-16 1:42
professionalEddy Vluggen12-Nov-16 1:42 
QuestionMy application does not close anymore Pin
desanti31-Oct-16 12:33
desanti31-Oct-16 12:33 
QuestionRe: My application does not close anymore Pin
Midi_Mick31-Oct-16 14:43
professionalMidi_Mick31-Oct-16 14:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.