By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,677 Members | 1,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,677 IT Pros & Developers. It's quick & easy.

HTTP Request - SOAP

P: n/a
A while ago I asked about how to use the HTTPRequest
object for sending a soap request. Somebody responded
with the code that I needed, but I recently lost it and I
really need it back now. Can anybody help me here? I
really this code for my app.

Thanks.
Nov 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Hi Jason,

Go to Google.
Click on Groups.
Click on Advanced.
Put your name in the Author box.

This will bring up all the threads that you posted to.

Regards,
Fergus

Nov 20 '05 #2

P: n/a
* "Jason Carter" <ja**********@agedwards.com> scripsit:
A while ago I asked about how to use the HTTPRequest
object for sending a soap request. Somebody responded
with the code that I needed, but I recently lost it and I
really need it back now. Can anybody help me here? I
really this code for my app.


<http://www.google.de/advanced_group_search>

This group is microsoft.public.dotnet.languages.vb.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

P: n/a
Hi Jason, Herfried,

Lol. That's if you like German. ;-))

Here's the uk one with the group name set up.

http://www.google.co.uk/advanced_gro..._ugroup=*langu
ages.vb.

Regards,
Fergus
Nov 20 '05 #4

P: n/a
Errata:
<http://www.google.de/advanced_group_search>


Should read "google.com" instead of "google.de".

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

P: n/a
Hi Jason,

You may try to search
"Jason Carter" HTTPRequest
in groups.google.com

http://groups.google.com/groups?q=%2...st&hl=zh-CN&lr
=&ie=UTF-8&oe=UTF-8&selm=OU1g%237pVDHA.2032%40TK2MSFTNGP11.phx.gbl&r num=1

Is the link what you are seeking?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Jason Carter" <ja**********@agedwards.com>
Sender: "Jason Carter" <ja**********@agedwards.com>
Subject: HTTP Request - SOAP
Date: Wed, 15 Oct 2003 08:15:42 -0700
Lines: 7
Message-ID: <01****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOTLzLRibtM7l3VQgO/vj50NlIo5w==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146916
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

A while ago I asked about how to use the HTTPRequest
object for sending a soap request. Somebody responded
with the code that I needed, but I recently lost it and I
really need it back now. Can anybody help me here? I
really this code for my app.

Thanks.


Nov 20 '05 #6

P: n/a
alright...i think he's learned a nifty recovery tool on google. i usually
don't just blurt out code but i happen to have it just sitting around at
present.

merry christmas.

hth,

steve

' these are particluar to my app...not to making soap requests in general.

Private Const shopCode As String = "XYZ"
Private Const appId As String = "SOME_GENERATED_PUBLIC_KEY"
Private Const syncServer As String = "http://somecompany.com/websvc.php"
' wow...i thought people just used asp in the real world!

' this is as basic as it gets
' the method is getData(shopcode, appid)
' this is how you'd wrap up the request in soap

Function sendWebRequest() As String
Dim webRequest As HttpWebRequest =
CType(webRequest.Create(syncServer), HttpWebRequest)
Dim webResponse As HttpWebResponse
Dim soapEnvelope As String
RaiseEvent CurrentProgress("Creating remote data request", 5)
soapEnvelope &= "<SOAP:Envelope>" & vbCrLf
soapEnvelope &= " <SOAP:Body>" & vbCrLf
soapEnvelope &= " <getData>" & vbCrLf
soapEnvelope &= " <parameters>" & vbCrLf
soapEnvelope &= " <shopcode xsi:type=""xsd:string"">" &
shopCode & "</shopcode>" & vbCrLf
soapEnvelope &= " <appid xsi:type=""xsd:string"">" & appId
& "</appid>" & vbCrLf
soapEnvelope &= " </parameters>" & vbCrLf
soapEnvelope &= " </getData>" & vbCrLf
soapEnvelope &= " </SOAP:Body>" & vbCrLf
soapEnvelope &= "</SOAP:Envelope>" & vbCrLf
With webRequest
.ContentType = "text/xml"
.Headers.Add("SOAPMethodName", "getData")
.ContentLength = soapEnvelope.Length
.Method = "POST"
.Timeout = 60 * 1000 ' milliseconds to seconds
Dim streamWriter As New StreamWriter(.GetRequestStream())
streamWriter.Write(soapEnvelope)
streamWriter.Close()
webResponse = CType(.GetResponse(), HttpWebResponse)
End With
Dim stream As Stream = webResponse.GetResponseStream
Dim streamReader As New StreamReader(stream)
Dim xmlStream As String = streamReader.ReadToEnd
streamReader.Close()
stream.Close()
Return xmlStream
End Function

"Jason Carter" <ja**********@agedwards.com> wrote in message
news:01****************************@phx.gbl...
A while ago I asked about how to use the HTTPRequest
object for sending a soap request. Somebody responded
with the code that I needed, but I recently lost it and I
really need it back now. Can anybody help me here? I
really this code for my app.

Thanks.

Nov 20 '05 #7

P: n/a
That is an awesome google trick. Thanks guys. And thanks for the
alternative HTTP request code too.

Jason Carter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #8

P: n/a
Peter,

I can't seem to get your example to work. I am getting an error on the
Dim streamwriter as new StreamWriter(.GetRequestStream())

Error: An unhandled exception of type
'System.Net.ProtocolViolationException' occurred in system.dll

Additonal information: Cannot send a cont-body with this verb-type.

Jason Carter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #9

P: n/a
it's steve...i need to see your modified version of the example before i can
say anything.
"Jason Carter" <ja**********@agedwards.com> wrote in message
news:e5**************@tk2msftngp13.phx.gbl...
Peter,

I can't seem to get your example to work. I am getting an error on the
Dim streamwriter as new StreamWriter(.GetRequestStream())

Error: An unhandled exception of type
'System.Net.ProtocolViolationException' occurred in system.dll

Additonal information: Cannot send a cont-body with this verb-type.

Jason Carter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #10

P: n/a
Nevermind guys, I got it fixed. I accidently forgot to set the method
property to "POST". Now it works.

Jason Carter

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.