473,473 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using System.Net.WebClient to access Web Service. Please help.

Greetings! I have a project that needs to access a web service. My problem
is this web service is provided via
CGI. I cannot do a "Web Reference" to it to add in my dotnet project. I'm
planning to use instead the System.Net.WebClient
to HTTP POST to this Web Service so I can retrieve any return values from
it. The code bellow is what the CGI web service expect to receive from my
end. How do I "HTTP POST" this to http://localhost/sb/myServer.cgi using
System.Net.WebClient? Please help. Thanks in advance! :-)

SOAP::Transport::HTTP::Client::send_receive: POST
http://localhost/sb/myServer.cgi
Accept: text/xml
Accept: multipart/*
Content-Length: 447
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:myWS#createsessioncmd"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAPENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAPENV:
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<namesp1:createsessioncmd xmlns:namesp1="urn:myWS"/>
</SOAP-ENV:Body>
</SOAPENV:
Envelope>
Nov 23 '05 #1
2 3687
surely the whole point of web services is that you can access them
regardless of the technology provided to provide them? providing the service
implements SOAP there should be nothing to stop you adding a web reference

"Michael Barrido" <jm***@hotmail.com> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Greetings! I have a project that needs to access a web service. My problem
is this web service is provided via
CGI. I cannot do a "Web Reference" to it to add in my dotnet project. I'm
planning to use instead the System.Net.WebClient
to HTTP POST to this Web Service so I can retrieve any return values from
it. The code bellow is what the CGI web service expect to receive from my
end. How do I "HTTP POST" this to http://localhost/sb/myServer.cgi using
System.Net.WebClient? Please help. Thanks in advance! :-)

SOAP::Transport::HTTP::Client::send_receive: POST
http://localhost/sb/myServer.cgi
Accept: text/xml
Accept: multipart/*
Content-Length: 447
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:myWS#createsessioncmd"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAPENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAPENV:
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<namesp1:createsessioncmd xmlns:namesp1="urn:myWS"/>
</SOAP-ENV:Body>
</SOAPENV:
Envelope>

Nov 23 '05 #2
All i get when i try to "Web Reference" is

"The request failed with HTTP status 411: Length Required." :-(

"Andy Fish" <aj****@blueyonder.co.uk> wrote in message
news:uU*************@TK2MSFTNGP09.phx.gbl...
surely the whole point of web services is that you can access them
regardless of the technology provided to provide them? providing the
service implements SOAP there should be nothing to stop you adding a web
reference

"Michael Barrido" <jm***@hotmail.com> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
Greetings! I have a project that needs to access a web service. My
problem is this web service is provided via
CGI. I cannot do a "Web Reference" to it to add in my dotnet project. I'm
planning to use instead the System.Net.WebClient
to HTTP POST to this Web Service so I can retrieve any return values from
it. The code bellow is what the CGI web service expect to receive from my
end. How do I "HTTP POST" this to http://localhost/sb/myServer.cgi using
System.Net.WebClient? Please help. Thanks in advance! :-)

SOAP::Transport::HTTP::Client::send_receive: POST
http://localhost/sb/myServer.cgi
Accept: text/xml
Accept: multipart/*
Content-Length: 447
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:myWS#createsessioncmd"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAPENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAPENV:
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<namesp1:createsessioncmd xmlns:namesp1="urn:myWS"/>
</SOAP-ENV:Body>
</SOAPENV:
Envelope>


Nov 23 '05 #3

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

Similar topics

2
by: Michael Barrido | last post by:
Greetings! I have a project that needs to access a web service. My problem is this web service is provided via CGI. I cannot do a "Web Reference" to it to add in my dotnet project. I'm planning to...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
0
by: natzol | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
2
by: Jeff | last post by:
ASP.NET 2.0 I'm working on a asp.net 2.0 website which needs to access a database on another server via an request. This database is placed on another server which is not based on ASP.NET, but...
1
by: =?Utf-8?B?Z2FsbGFu?= | last post by:
We have an application that is running fine on several of our customer’s servers. However, one of our customers is having a problem running the application. The application works on one of his...
3
by: Nathan | last post by:
Have a strange problem. Creating a windows service running under the Local Sytem account. I have a Webclient that downloads a file from the internet. The code works fine if executed from a windows...
3
by: =?Utf-8?B?dmFzaW1v?= | last post by:
Have the following code: wkLocalPath = "C:\A\1.jpg" wkServerPath = "http://servername/dirname/1.jpg" wcClient.Credentials = New NetworkCredential("UID", "PW") wcClient.UploadFile(wkServerPath,...
3
by: smarttechie | last post by:
hi all i want to access gmail programatically using c#. i will just enter my email id & password. if the email id & password is true then the server will give me a response. pls help me thanks in...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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,...
0
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.