473,574 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sending soap over http

i have a very simple web servive

Imports System.Web.Serv ices

<System.Web.Ser vices.WebServic e(Namespace:="u rn:Example1")> _

Public Class Example1

Inherits System.Web.Serv ices.WebService


<WebMethod()> _

Public Function HelloWorld(ByVa l 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("M SXML2.DOMDocume nt")
x.loadXML "<s:Envelop e 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:B ody><m:sayHello
xmlns:m='urn:Ex ample1'><name
xsi:type='xsd:s tring'>James</name></m:sayHello></s:Body></s:Envelope>"

msgbox x.xml, , "Input SOAP Message"
Set h = CreateObject("M icrosoft.XMLHTT P")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText, ,"Output SOAP Message"

Nov 12 '05 #1
4 7871
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("M SXML2.DOMDocume nt")

s ="<s:Envelop e 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:Hell oWorld xmlns:m='urn:Ex ample1'>"
r = " <name
xsi:type='xsd:s tring'>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("M icrosoft.XMLHTT P")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText, ,"Output SOAP Message"
"Mark" <ma*********@ac ordia.com> wrote in message
news:ed******** ******@TK2MSFTN GP14.phx.gbl...
i have a very simple web servive

Imports System.Web.Serv ices

<System.Web.Ser vices.WebServic e(Namespace:="u rn:Example1")> _

Public Class Example1

Inherits System.Web.Serv ices.WebService


<WebMethod()> _

Public Function HelloWorld(ByVa l 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("M SXML2.DOMDocume nt")
x.loadXML "<s:Envelop e 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:B ody><m:sayHello
xmlns:m='urn:Ex ample1'><name
xsi:type='xsd:s tring'>James</name></m:sayHello></s:Body></s:Envelope>"

msgbox x.xml, , "Input SOAP Message"
Set h = CreateObject("M icrosoft.XMLHTT P")
h.open "POST", "http://localhost/HelloWorld/Service1.asmx"
h.send (x)
while h.readyState <> 4
wend
msgbox h.responseText, ,"Output SOAP Message"

Nov 12 '05 #2
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:Envelop e 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:Hell oWorld xmlns:m='urn:Ex ample1'>
<name
xsi:type='xsd:s tring'>James</name></m:HelloWorld></s:Body></s:Envelope>"

-----------------------------------------------------------------
The web service i'm sending this to is

Imports System.Web.Serv ices

<System.Web.Ser vices.WebServic e(Namespace:="u rn:Example1")> _

Public Class Example1

Inherits System.Web.Serv ices.WebService

<WebMethod()> _

Public Function HelloWorld(ByVa l 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:Envelop e xmlns:soap="htt p://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>Un able to handle request without a valid action
parameter. Please supply a valid soap action.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
Nov 12 '05 #3


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:Envelop e xmlns:soap="htt p://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>Un able 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/
Nov 12 '05 #4
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*******@yaho o.de> wrote in message
news:ud******** ******@TK2MSFTN GP09.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:Envelop e xmlns:soap="htt p://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>Un able 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/

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7040
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 = s & " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" s = s & " <soap:operation soapAction='urn:Example1/HelloWorld' style='document' />" s = s & "...
2
15430
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 web service though. Question 1: Does Java etc have some kind of SOAP tool kit developers could use to access our web service? Question 2: .NET...
3
7710
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 value for the UserName token. Is it possilbe at all to do this from VBScript (or jscript?)? I know I will be limited with what I can do with the SOAP...
1
1756
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: *************************************************** public class EmployeeTaxServiceService : System.Web.Services.Protocols.SoapHttpClientProtocol { public EmployeeTaxServiceService() { this.Url =...
1
4792
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 using the webservice with the sample.xml file, and again it worked. Now the vendor is calling the web service from their application and receiving...
3
6388
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"); var_dump($result);
3
5713
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. Company responsible for Delphi part hasn't preapred "real" soap server, but instead of that they have made an application, which listens for SOAP...
2
9486
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 Rule &apos;Invalid HTTP Message&apos; aborted processing. Invalid mime format System Name: ccgows012
0
2231
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. The problem I have is the first record gets processed fine where as the second record always; reason being the EAI expects it to be a seperate call...
0
7808
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7822
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...
0
8101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6456
agi2029
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...
0
5302
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...
0
3742
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...
0
3754
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2249
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1062
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.