HighTechTalks DotNet Forums  

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

Dotnet General Discussions microsoft.public.dotnet.general


Discuss Using System.Net.WebClient to access Web Service. Please help. in the Dotnet General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Michael Barrido
 
Posts: n/a

Default Using System.Net.WebClient to access Web Service. Please help. - 08-04-2005 , 12:51 AM






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>



Reply With Quote
  #2  
Old   
Andy Fish
 
Posts: n/a

Default Re: Using System.Net.WebClient to access Web Service. Please help. - 08-04-2005 , 02:09 AM






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" <jmmrb (AT) hotmail (DOT) com> wrote

Quote:
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




Reply With Quote
  #3  
Old   
Michael Barrido
 
Posts: n/a

Default Re: Using System.Net.WebClient to access Web Service. Please help. - 08-04-2005 , 03:41 AM



All i get when i try to "Web Reference" is

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

"Andy Fish" <ajfish (AT) blueyonder (DOT) co.uk> wrote

Quote:
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" <jmmrb (AT) hotmail (DOT) com> wrote in message
news:eyTsMiLmFHA.3304 (AT) tk2msftngp13 (DOT) 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






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.