
Signature
Labhesh Shrimali - MCP
Bangalore - India
9886497756
On Aug 8, 9:04 am, Labhesh Shrimali - Bangalore
<LabheshShrimaliBangal...@discussions.microsoft.com> wrote:
Hi Labhesh
> xmlHTTP.open "POST", sQuery, false
in a working example you do POST
> url="http://localhost/test.asmx/helloworld?param=test"; < this hangs
and in the problem code you do GET
So, what the exact code which returned an error?
url="http://localhost/test.asmx/helloworld?param=test"
Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP")
xmlHTTP.Open "GET", url, False
xmlHTTP.Send
Like this?
The message is from .NET, where do you get it?
> The following Message comes:
>
> System.InvalidOperationException
> at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.WebServiceHandler.Invoke()
> at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
Can you post the service description and an asmx, so we can take look?
Does web service return an answer when you type
http://localhost/test.asmx/helloworld?param=test in a browser?
Labhesh Shrimali - Bangalore - 08 Aug 2007 10:04 GMT
Webservice as below *********
[System.Web.Services.WebMethod]
public string GetTransferResult(string TransferID, string Description)
{
try
{
}
catch
{
// error handling ommitted for brevity
}
finally
{
}
return Description;
}
[WebMethod]
public string GetCategories()
{
return "LABHESHSHRIMALI";
}
VB Script Code as below ***************
' VBScript File
Dim objHttp
dim objXmlDoc
MsgBox("Starting the Calling webservice")
WSController()
MsgBox("End Calling the webservice")
Public Function getDataFromWS(methodName, dataSetName, wsParamValue,
wsParamName)
'// create the XML object
Set objXmlDoc = CreateObject("Msxml2.DOMDocument")
'Set objDictionary = CreateObject("Scripting.Dictionary")
If IsNull(objXmlDoc) Then
Msgbox("Unable to create DOM document!")
Else
'// create an XmlHttp instance
Set objHttp = CreateObject("Microsoft.XMLHTTP")
Dim objGetTransferResult
objGetTransferResult = "GetTransferResult"
Dim objDescription
objDescription = "Description"
Dim objTransferID
objTransferID = "TransferID"
'// Create the SOAP Envelope
strEnvelope = "<soap12:Envelope
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap12=http://www.w3.org/2003/05/soap-envelope> <soap12:Body>
<GetCategories xmlns=http://marksandspencer.com/ />
</soap12:Body></soap12:Envelope>"
'strEnvelope = "<soap12:Envelope
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap12=http://www.w3.org/2003/05/soap-envelope><soap12:Body><GetTransferResult
xmlns=http://marksandspencer.com/><Description>string</Description><TransferID>string<
/TransferID></GetTransferResult></soap12:Body></soap12:Envelope>"
'strEnvelope = "<soap12:Envelope
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap12=http://www.w3.org/2003/05/soap-envelope> <soap12:Body>
<GetTransferResultResponse xmlns=http://marksandspencer.com/>
<GetTransferResultResult>string</GetTransferResultResult>
</GetTransferResultResponse> </soap12:Body></soap12:Envelope>"
MsgBox(strEnvelope)
'// Set up the post
objHTTP.onreadystatechange = getRef("LoadAndProcessDocument")
'objHttp.onreadystatechange = Call abc(objHttp,objXmlDoc)
Dim szUrl
szUrl = "http://localhost:1400/wsXMLHTTP/DynaProducts.asmx/" + methodName
szUrl = szUrl + + "?TransferID=" + wsParamName + "&Description=" +
wsParamValue
Msgbox(szUrl)
If IsEmpty(wsParamValue) Then
szUrl = szUrl + "?" + wsParamName + "=" + wsParamValue
Msgbox("Param not null" + wsParamValue)
Else
Msgbox("Param null" + wsParamValue)
End If
'// send the POST to the Web service
objHttp.open "POST", szUrl, true
objHttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
'objHttp.setRequestHeader "Content-Type", "application/soap+xml;
charset=utf-8"
objHttp.send strEnvelope
End If
End Function
Public function LoadAndProcessDocument()
' a readyState of 4 means we're ready to use the data returned by XMLHTTP
if objHttp.readystate = 4 then
dim szresponse
szresponse = objHttp.responsetext
MsgBox(szresponse)
objXmlDoc.loadxml(szresponse)
if objXmlDoc.parseerror.errorcode <> 0 then
dim xmlerr
Set xmlerr = objXmlDoc.parseerror
MsgBox("you have error " + xmlerr.reason)
Else
ProcesstheRequest()
'
End If
End If
End Function
Public Function WSController()
MsgBox("I am inside WSController Function")
Dim func
func = getDataFromWS("GetCategories", "GetCategoriesDS","AAA","BBBB")
'func = getDataFromWS("GetTransferResult",
"GetTransferResultDS","AA","BB")
'func = getDataFromWS("OneArgument", "OneArgumentOnly")
MsgBox("Please wait while data is retrieved...")
'Window.setTimeout func, 1
idTimer = window.setTimeout("func", 1000, "VBScript")
' window.setTimeout func, 1, "JavaScript"
End Function
Public Function ProcesstheRequest()
'// get an XML data island with the category data
'MsgBox("I will show you Returned XML DOc" + objXmlDoc)
MsgBox(objXmlDoc.text)
End Function

Signature
Labhesh Shrimali - MCP
Bangalore - India
9886497756
> On Aug 8, 9:04 am, Labhesh Shrimali - Bangalore
> <LabheshShrimaliBangal...@discussions.microsoft.com> wrote:
[quoted text clipped - 30 lines]
> Does web service return an answer when you type
> http://localhost/test.asmx/helloworld?param=test in a browser?
Labhesh Shrimali - Bangalore - 08 Aug 2007 10:04 GMT
My Code as below:
WebService Methods: *****************************
[System.Web.Services.WebMethod]
public string GetTransferResult(string TransferID, string Description)
{
try
{
}
catch
{
// error handling ommitted for brevity
}
finally
{
}
return Description;
}
[WebMethod]
public string GetCategories()
{
return "LABHESHSHRIMALI";
}
VBScript files ********************************
' VBScript File
Dim objHttp
dim objXmlDoc
MsgBox("Starting the Calling webservice")
WSController()
MsgBox("End Calling the webservice")
Public Function getDataFromWS(methodName, dataSetName, wsParamValue,
wsParamName)
'// create the XML object
Set objXmlDoc = CreateObject("Msxml2.DOMDocument")
'Set objDictionary = CreateObject("Scripting.Dictionary")
If IsNull(objXmlDoc) Then
Msgbox("Unable to create DOM document!")
Else
'// create an XmlHttp instance
Set objHttp = CreateObject("Microsoft.XMLHTTP")
Dim objGetTransferResult
objGetTransferResult = "GetTransferResult"
Dim objDescription
objDescription = "Description"
Dim objTransferID
objTransferID = "TransferID"
'// Create the SOAP Envelope
strEnvelope = "<soap12:Envelope
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap12=http://www.w3.org/2003/05/soap-envelope> <soap12:Body>
<GetCategories xmlns=http://marksandspencer.com/ />
</soap12:Body></soap12:Envelope>"
'strEnvelope = "<soap12:Envelope
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap12=http://www.w3.org/2003/05/soap-envelope><soap12:Body><GetTransferResult
xmlns=http://marksandspencer.com/><Description>string</Description><TransferID>string<
/TransferID></GetTransferResult></soap12:Body></soap12:Envelope>"
'strEnvelope = "<soap12:Envelope
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap12=http://www.w3.org/2003/05/soap-envelope> <soap12:Body>
<GetTransferResultResponse xmlns=http://marksandspencer.com/>
<GetTransferResultResult>string</GetTransferResultResult>
</GetTransferResultResponse> </soap12:Body></soap12:Envelope>"
MsgBox(strEnvelope)
'// Set up the post
objHTTP.onreadystatechange = getRef("LoadAndProcessDocument")
'objHttp.onreadystatechange = Call abc(objHttp,objXmlDoc)
Dim szUrl
szUrl = "http://localhost:1400/wsXMLHTTP/DynaProducts.asmx/" + methodName
szUrl = szUrl + + "?TransferID=" + wsParamName + "&Description=" +
wsParamValue
Msgbox(szUrl)
If IsEmpty(wsParamValue) Then
szUrl = szUrl + "?" + wsParamName + "=" + wsParamValue
Msgbox("Param not null" + wsParamValue)
Else
Msgbox("Param null" + wsParamValue)
End If
'// send the POST to the Web service
objHttp.open "POST", szUrl, true
objHttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
'objHttp.setRequestHeader "Content-Type", "application/soap+xml;
charset=utf-8"
objHttp.send strEnvelope
End If
End Function
Public function LoadAndProcessDocument()
' a readyState of 4 means we're ready to use the data returned by XMLHTTP
if objHttp.readystate = 4 then
dim szresponse
szresponse = objHttp.responsetext
MsgBox(szresponse)
objXmlDoc.loadxml(szresponse)
if objXmlDoc.parseerror.errorcode <> 0 then
dim xmlerr
Set xmlerr = objXmlDoc.parseerror
MsgBox("you have error " + xmlerr.reason)
Else
ProcesstheRequest()
'
End If
End If
End Function
Public Function WSController()
MsgBox("I am inside WSController Function")
Dim func
func = getDataFromWS("GetCategories", "GetCategoriesDS","AAA","BBBB")
'func = getDataFromWS("GetTransferResult",
"GetTransferResultDS","AA","BB")
'func = getDataFromWS("OneArgument", "OneArgumentOnly")
MsgBox("Please wait while data is retrieved...")
'Window.setTimeout func, 1
idTimer = window.setTimeout("func", 1000, "VBScript")
' window.setTimeout func, 1, "JavaScript"
End Function
Public Function ProcesstheRequest()
'// get an XML data island with the category data
'MsgBox("I will show you Returned XML DOc" + objXmlDoc)
MsgBox(objXmlDoc.text)
End Function
Let me know if you need any other info in understanding the problem.
In webservice there are two methods:
One method works fine which does not have arguemetn. but other give an error
because that has an argument.
and i want to provide the argument to the webservice method.
Plz help me how to achive this.

Signature
Labhesh Shrimali - MCP
Bangalore - India
9886497756
> On Aug 8, 9:04 am, Labhesh Shrimali - Bangalore
> <LabheshShrimaliBangal...@discussions.microsoft.com> wrote:
[quoted text clipped - 30 lines]
> Does web service return an answer when you type
> http://localhost/test.asmx/helloworld?param=test in a browser?