| | |
SOAP Request/Response Issue
Please support our RSS, Web Services and SOAP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi,
First thing is first, I wasnt sure whether to put this in this section or in the VB.NET section as it has aspects of both but I decided the issue was probably more relevent to this section so here it is.
Secondly this question may seem trivial (any question is trivial if you know the answer I guess) so please bear with me as I am new to XML and hadn't even heard of SOAP until yesterday and this is pretty much the issue here I think.
OK down to business, I have to send a SOAP request to consume a webserve and get a response back. I am using System.Net.HttpWebRequest and System.Net.HttpWebResponse classes to send/recieve the SOAP objects.
The issue is that I can not seem to get it to return anything. When I run the console app in debug mode it gets to the objHTTPReq.GetResponse() method and then stalls.
It is not causing an Exception as I have a try/catch arround the block (see the code below). I have been working away at this for almost 5 hours now and getting nowhere. Another thing that could be causing the issue is that I may not be calling a service that is working (I asked my friend Google for a list of public services and picked a simple one to test the console app).
The bottom line is that I know that little about this that I could just be using the wrong URL and/or entering the wrong parameters in the wrong order etc etc.
Any help would be appreciated.
The code is shown below:
The info on the service I am tring to communicate with is below:
Any help would be hugely appreciated.
Cheers,
CJL.
First thing is first, I wasnt sure whether to put this in this section or in the VB.NET section as it has aspects of both but I decided the issue was probably more relevent to this section so here it is.
Secondly this question may seem trivial (any question is trivial if you know the answer I guess) so please bear with me as I am new to XML and hadn't even heard of SOAP until yesterday and this is pretty much the issue here I think.
OK down to business, I have to send a SOAP request to consume a webserve and get a response back. I am using System.Net.HttpWebRequest and System.Net.HttpWebResponse classes to send/recieve the SOAP objects.
The issue is that I can not seem to get it to return anything. When I run the console app in debug mode it gets to the objHTTPReq.GetResponse() method and then stalls.
It is not causing an Exception as I have a try/catch arround the block (see the code below). I have been working away at this for almost 5 hours now and getting nowhere. Another thing that could be causing the issue is that I may not be calling a service that is working (I asked my friend Google for a list of public services and picked a simple one to test the console app).
The bottom line is that I know that little about this that I could just be using the wrong URL and/or entering the wrong parameters in the wrong order etc etc.
Any help would be appreciated.
The code is shown below:
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
Public Function xxxxxxxxx() Dim soapMessage As String Dim objHTTPReq As System.Net.HttpWebRequest Dim objHTTPRes As System.Net.HttpWebResponse Try objHTTPReq = CType(System.Net.WebRequest.CreateDefault(New System.Uri("http://euro2008.dataaccess.eu/footballpoolwebservice.wso")), HttpWebRequest) objHTTPReq.ContentType = "text/xml;charset=""utf-8""" objHTTPReq.Method = "POST" objHTTPReq.Accept = "text/xml" ' CREDENTIALS TO BE ARANGED objHTTPReq.Credentials = (New NetworkCredential("username", "password", "domain")) 'SOAPAction header objHTTPReq.Headers.Add("SOAPAction", """http://euro2008.dataaccess.eu/footballpoolwebservice/AllPlayerNames""") soapMessage = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><AllPlayerNames xmlns='http://euro2008.dataaccess.eu'></AllPlayerNames></soap:Body></soap:Envelope>" 'Send the XML Request Dim objStream As System.IO.StreamWriter objStream = New StreamWriter(objHTTPReq.GetRequestStream(), Encoding.UTF8) objStream.Write(soapMessage) objHTTPRes = objHTTPReq.GetResponse() ''''And you can display or process the XML Dim objXML As New System.Xml.XmlDocument() objXML.Load(objHTTPRes.GetResponseStream()) Return objXML Catch ex As Exception Console.WriteLine(ex.Message) End Try End Function
The info on the service I am tring to communicate with is below:
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
Service Name: AllPlayerNames Reqest: POST /footballpoolwebservice.wso HTTP/1.1 Host: euro2008.dataaccess.eu Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <AllPlayerNames xmlns="http://euro2008.dataaccess.eu"> </AllPlayerNames> </soap:Body> </soap:Envelope> Response: HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <AllPlayerNamesResponse xmlns="http://euro2008.dataaccess.eu"> <AllPlayerNamesResult> <string>string</string> <string>string</string> </AllPlayerNamesResult> </AllPlayerNamesResponse> </soap:Body> </soap:Envelope>
Any help would be hugely appreciated.
Cheers,
CJL.
•
•
Join Date: Jun 2008
Posts: 2
Reputation:
Solved Threads: 0
Sorry to have bothered you I figured it out and the problem was irritatingly simple.
I had forgotten the line:
This meant there were no streams available to get the response.
I had forgotten the line:
RSS, Web Services and SOAP Syntax (Toggle Plain Text)
objStream.close()
This meant there were no streams available to get the response.
![]() |
Similar Threads
- php Soap Issue Help Please (PHP)
- Problem receiving result from Microsoft Soap toolkit server service using Nusoap clie (RSS, Web Services and SOAP)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: pls Help!! how to search for string in a file with C# and Web Services??
- Next Thread: right XML request for WSDL
| Thread Tools | Search this Thread |
.htaccess 301 accept access alltop api authentication binarysecuritytoken blog card collaboration credit data development ebay email evernote flash google government highrise htaccess intel internet legal live netbeans patent paypal php podcast proxy redirect rss rssfeeds searchmonkey server service soap software swappingxmlfromflash swappingxmlnodes url web webservices webservicesecurity wiki wikipedia xerces xml xslt y!os yahoo ydn





