Hi
My web service has a method which accepts byte array as parameter.
<WebMethod()> _
Public Function SendLoan(ByVal data As Byte()) As String
Dim filePath As String
filePath = System.AppDomai n.CurrentDomain .BaseDirectory( ) &
"\WorkingFiles\ "
objImportExport = New BrainImportExpo rt.BrainImportE xport
SendLoan = objImportExport .ImportLoanByLo an(data, filePath)
objImportExport = Nothing
End Function
I am calling this function from VBA client. Following is the code
Dim arr1() As Byte
ReDim arr1(Len("Data= " & xmlDoc.xml))
arr1 = StrConv(("Data= " & xmlDoc.xml), vbFromUnicode)
Dim objXMLHTTP As New MSXML2.XMLHTTP3 0
Dim strResponse As String
Dim strURL As String 'Web service url
strURL = "http://localhost/brainwebservice s/brainwebservice s.asmx/SendLoan"
objXMLHTTP.Open "POST", strURL, True
objXMLHTTP.setR equestHeader "Content-Type",
"applicatio n/x-www-form-urlencoded"
objXMLHTTP.setR equestHeader "Content-Length", UBound(arr1)
'Call web service and pass its parameters
objXMLHTTP.send arr1
'>>> Loop until the call comes back
Do Until objXMLHTTP.read yState = 4
DoEvents
Loop
'When exiting the loop, get the response from the webservice
strResponse = objXMLHTTP.resp onseText
If objXMLHTTP.stat usText = "OK" Then
MsgBox "Data sent to web services successfully"
Else
MsgBox "Error in sending data to web services"
End If
I am getting following error:
System.Argument Exception: Cannot convert to System.Byte.
Parameter name: type ---> System.FormatEx ception: Input string was not
in a correct format.
at System.Number.P arseInt32(Strin g s, NumberStyles style,
NumberFormatInf o info)
at System.Byte.Par se(String s, NumberStyles style, IFormatProvider
provider)
at System.String.S ystem.IConverti ble.ToByte(IFor matProvider
provider)
at System.Convert. ChangeType(Obje ct value, Type conversionType,
IFormatProvider provider)
at System.Convert. ChangeType(Obje ct value, Type conversionType)
at System.Web.Serv ices.Protocols. ScalarFormatter .FromString(Str ing
value, Type type)
--- End of inner exception stack trace ---
at System.Web.Serv ices.Protocols. ScalarFormatter .FromString(Str ing
value, Type type)
at System.Web.Serv ices.Protocols. ValueCollection ParameterReader .Read(NameValue Collection
collection)
at System.Web.Serv ices.Protocols. HtmlFormParamet erReader.Read(H ttpRequest
request)
at System.Web.Serv ices.Protocols. HttpServerProto col.ReadParamet ers()
at System.Web.Serv ices.Protocols. WebServiceHandl er.Invoke()
at System.Web.Serv ices.Protocols. WebServiceHandl er.CoreProcessR equest()
Earlier i was using SOAP Toolkit 3.0.It was working fine.
Please let me know if am missing anything.
Thanks in advance
Regards
gagan 0 4423 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sergiusz Michalski |
last post by:
Hallo!!
According to my previous post with popups hanging, now I'm trying to bypass
this strange behaviour using loading JavaScript image not by image.src=URL
but straight away from stream using HTTP GET method.
The problem is, how to assign stream from downloaded image (ex. GIF89a) to a
JavaScript Image object ?
Below is my code with explanation what I'm trying to do:
|
by: Paul Michaud |
last post by:
Consider the following:
Class A
{
....
}
Class B:A
{
....
|
by: Arne |
last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart
from a pocket PC to a webservice.
What is the right datatype?
II have tried dataset as a datatype, but I can't get it to compile.
<WebMethod()> _
Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet
Test program :
Dim cartSet As DataSet
cartSet = ws.VerifySku(cartSet)
|
by: gagans |
last post by:
Hi
My web service has a method which accepts byte array as parameter.
<WebMethod()> _
Public Function SendLoan(ByVal data As Byte()) As String
Dim filePath As String
filePath = System.AppDomain.CurrentDomain.BaseDirectory() &
"\WorkingFiles\"
objImportExport = New BrainImportExport.BrainImportExport
SendLoan = objImportExport.ImportLoanByLoan(data, filePath)
objImportExport = Nothing
|
by: Slim |
last post by:
I have a problem converting binary to text
I am reading a page using xmlhttp
xmlhttp.open "GET", url, false ,"userName","password"
xmlhttp.send ""
tex3 = xmlhttp.responseBody
now I have the binary data of the html page I am reading
| |
by: Slim |
last post by:
I have a problem converting binary to text
I am reading a page using xmlhttp
xmlhttp.open "GET", url, false ,"userName","password"
xmlhttp.send ""
tex3 = xmlhttp.responseBody
now I have the binary data of the html page I am reading
|
by: Slim |
last post by:
I have a problem converting binary to text
I am reading a page using xmlhttp
xmlhttp.open "GET", url, false ,"userName","password"
xmlhttp.send ""
tex3 = xmlhttp.responseBody
now I have the binary data of the html page I am reading
|
by: Andy |
last post by:
Hi,
I created a sample web service and tried calling it from my VBScript.
Here it is:
----------------------------------------------------------------------------
---------------
'-- Declare variables
dim fs
|
by: Andy |
last post by:
Hi there,
How do I send binary files to a web service from VBScript?
I read a file, converted it into a stream and submitted using xmlhttp.send
(post method).
objXmlhttp.send BinaryStream.Read(BinaryStream.Size)
Is this the correct approach?
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |