i have a very simple web servive
Imports System.Web.Services
<System.Web.Services.WebService(Namespace:="urn:Ex ample1")> _
Public Class Example1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld(ByVal name As String) As String
Return "Hello " & name
End Function
End Class
I have a VB Script with which I'm trying to send a soap message with. When
i execute i get to the input soap message message box showing me the
message, but when i click ok, it seems to hang. i have to kill the script
through taskmgr. this is on windows 2000.
Any ideas why it wouldn't return?
Dim x, h
Set x = CreateObject("MSXML2.DOMDocument")
x.loadXML "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'><s:Body><m:sayHello
xmlns:m='urn:Example1'><name
xsi:type='xsd:string'>James</name></m:sayHello></s:Body></s:Envelope>"
msgbox x.xml, , "Input SOAP Message"
Set h = CreateObject("Microsoft.XMLHTTP")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText,,"Output SOAP Message" 4 7830
Correction:
I had to change the word sayHello to Helloworld, since that is my method
name.
Dim x, h,r, s, t, u, v,z
Set x = CreateObject("MSXML2.DOMDocument")
s ="<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'"
t = " xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'"
u = " xmlns:xsd='http://www.w3.org/1999/XMLSchema'>"
v = " <s:Body><m:HelloWorld xmlns:m='urn:Example1'>"
r = " <name
xsi:type='xsd:string'>James</name></m:HelloWorld></s:Body></s:Envelope>"
z= s & t & u & v & r
x.loadXML z
msgbox x.xml, , "Input SOAP Message"
Set h = CreateObject("Microsoft.XMLHTTP")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText,,"Output SOAP Message"
"Mark" <ma*********@acordia.com> wrote in message
news:ed**************@TK2MSFTNGP14.phx.gbl... i have a very simple web servive
Imports System.Web.Services
<System.Web.Services.WebService(Namespace:="urn:Ex ample1")> _
Public Class Example1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld(ByVal name As String) As String
Return "Hello " & name
End Function
End Class I have a VB Script with which I'm trying to send a soap message with.
When i execute i get to the input soap message message box showing me the message, but when i click ok, it seems to hang. i have to kill the script through taskmgr. this is on windows 2000.
Any ideas why it wouldn't return?
Dim x, h Set x = CreateObject("MSXML2.DOMDocument") x.loadXML "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' xmlns:xsd='http://www.w3.org/1999/XMLSchema'><s:Body><m:sayHello xmlns:m='urn:Example1'><name xsi:type='xsd:string'>James</name></m:sayHello></s:Body></s:Envelope>"
msgbox x.xml, , "Input SOAP Message" Set h = CreateObject("Microsoft.XMLHTTP") h.open "POST", "http://localhost/HelloWorld/Service1.asmx" h.send (x) while h.readyState <> 4 wend msgbox h.responseText,,"Output SOAP Message"
I'm getting close.. It appears something is wrong with my soap message
itself. I'm using the
HttpWebRequest and HttpWebResponse objects to send/receive this data.
Any help would be much appreciated.
-----------------------------------------------------------------
I have a string which contains the following data.
"<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'>
<s:Body><m:HelloWorld xmlns:m='urn:Example1'>
<name
xsi:type='xsd:string'>James</name></m:HelloWorld></s:Body></s:Envelope>"
-----------------------------------------------------------------
The web service i'm sending this to is
Imports System.Web.Services
<System.Web.Services.WebService(Namespace:="urn:Ex ample1")> _
Public Class Example1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld(ByVal name As String) As String
Return "Hello " & name
End Function
End Class
-----------------------------------------------------------------
The error I'm getting is
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unable to handle request without a valid action
parameter. Please supply a valid soap action.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
Mark wrote: It appears something is wrong with my soap message itself. I'm using the HttpWebRequest and HttpWebResponse objects to send/receive this data.
Why? If you are using .NET (as HttpWebRequest suggests) then simply
create a proxy class to use the web service, .NET has a tool called
wsdl.exe to do exactly that to avoid anyone having to deal with SOAP
itself (which is complex). The wsdl.exe tool reads the WSDL file
describing the web service and generates .NET source code for a proxy
class which you can compile and then include in your .NET project to
easily access the web service transparently calling methods on the proxy
without ever dealing with SOAP.
As for your earlier message that looked like you were using VBScript,
even there MS has a toolkit named SOAP toolkit that helps you with
accessing web services without the need to construct the raw SOAP from
hand. Look on http://msdn.microsoft.com/ for SOAP toolkit, download it
and check the examples on how to build a SOAP client with script.
The error I'm getting is
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope>
Well SOAP over HTTP needs a custom HTTP header named SOAPAction which
(untested and written from memory) needs to be alike
SOAPAction: urn:Example1/HelloWorld
for your web service so if you really want to use HttpWebRequest or
Msmxl2.XMLHTTP to access a web service then you need to make sure you
set that HTTP header (not SOAP header!) before sending your request.
But as said, there are tools with both COM based application (like VB or
VBScript or JScript) and .NET to free you from thinking about that
stuff, you simply call a method and get a result in the language of your
choice and the whole SOAP creation and parsing is done by the tools
reading the WSDL description of the web service.
--
Martin Honnen http://JavaScript.FAQTs.com/
That is part of my problem and why I am lost.
I've been told by the folks that developed this web service that they are
not using WSDL.
I've used the soap toolkit in the past with VB 6.0 and it was very easy.
I was told i had to generate these "raw" soap message to send to this
service. I spoke with another person yesterday who sent data to this
service and they stated that they wrote out the xml doc line by line in code
and then sent it.
That is why i'm trying to understand how to write a soap message manually.
thank you for the suggestions.
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Mark wrote:
It appears something is wrong with my soap message itself. I'm using the HttpWebRequest and HttpWebResponse objects to send/receive this data.
Why? If you are using .NET (as HttpWebRequest suggests) then simply create a proxy class to use the web service, .NET has a tool called wsdl.exe to do exactly that to avoid anyone having to deal with SOAP itself (which is complex). The wsdl.exe tool reads the WSDL file describing the web service and generates .NET source code for a proxy class which you can compile and then include in your .NET project to easily access the web service transparently calling methods on the proxy without ever dealing with SOAP.
As for your earlier message that looked like you were using VBScript, even there MS has a toolkit named SOAP toolkit that helps you with accessing web services without the need to construct the raw SOAP from hand. Look on http://msdn.microsoft.com/ for SOAP toolkit, download it and check the examples on how to build a SOAP client with script. The error I'm getting is
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope>
Well SOAP over HTTP needs a custom HTTP header named SOAPAction which (untested and written from memory) needs to be alike
SOAPAction: urn:Example1/HelloWorld
for your web service so if you really want to use HttpWebRequest or Msmxl2.XMLHTTP to access a web service then you need to make sure you set that HTTP header (not SOAP header!) before sending your request.
But as said, there are tools with both COM based application (like VB or VBScript or JScript) and .NET to free you from thinking about that stuff, you simply call a method and get a result in the language of your choice and the whole SOAP creation and parsing is done by the tools reading the WSDL description of the web service. --
Martin Honnen http://JavaScript.FAQTs.com/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: mark kurten |
last post by:
I have a soap message that looks like this.
s = s & " <soap:Envelope
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"
s = s & " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
s =...
|
by: Paul Hale |
last post by:
I have a vb.net web service and client that are both working fine.
If someone wanted to consume our web service using .NET, no problem.
Im a little confused on how non .NET clients would use the...
|
by: Sydney |
last post by:
Hi,
I am trying to construct a WSE 2.0 security SOAP request in VBScript on an
HTML page to send off to a webservice. I think I've almost got it but I'm
having an issue generating the nonce...
|
by: tshad |
last post by:
We have a web service that is not sending a field in the Soap Envelope.
For example, when we add a web reference, we get something like:
***************************************************...
|
by: =?Utf-8?B?am1ncm8=?= |
last post by:
I created a web service in visual studio 2003, tested it with a sample.xml
file from a vendor we are using, and it worked exactly like it should. I
deployed it to our server, created a project...
|
by: Joshua Beall |
last post by:
Hi All,
I've got the following PHP code:
$service = new SoapClient("http://www.webservicex.net/length.asmx?
wsdl");
$result = $service->ChangeLengthUnit(10,"Inches","Centimeters");...
|
by: ZAAN |
last post by:
Hi,
I'm developing an application in PHP5, which interacts with another
system written in Delphi (of another company). I've prepared the Web
Service - WSDL, Client and Server (only stub) side....
|
by: talk2jyotish |
last post by:
I have to send a zip file whose name is MeFAttachment.zip as an attachment in SOAP 1.1 packet.
But I get an error while submitting.
Here is the error description
Server Error 415
IDP...
|
by: vigneshrao |
last post by:
Hi,
I have been working on a script that loops through multiple records and sends data (one record per call) to a WS.
I am supposed to make a new call for each record before sending the data....
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |