Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2006

Tip: Looking for answers? Try searching our database.

a differnt way to consuming web services?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jo - 26 Apr 2006 09:43 GMT
hi there:

Is there any different way to consume Web services besides using "Add a
web reference" or creating a proxy with wsdl.exe?

I need to pass a username and password to a particular web service and
I would love some guidance

Thanks in advance for your help

jo
Jo - 26 Apr 2006 09:57 GMT
I know the web service is coded in java
Would this complicate thing more?

Thanks

jo
Josh Twist - 26 Apr 2006 13:22 GMT
You could just use HttpWebRequest and manually build the request stream
and headers (web services use HTTP just like web pages) - but wsdl.exe
usually makes this job a lot easier!

Have you tried using Add Web Reference / wsdl.exe - have you tried this
and it doesn't work? How do you need to pass the credentials?

Josh
http://www.thejoyofcode.com/
Jo - 26 Apr 2006 13:48 GMT
hi josh: thansk for answering.
I have tryed wsdl.exe and add web reference and i get the error:

- the HTML document does not contain Web Service discovery information

I have no idea how to pass the credentials.

I have tryed and succesfully consumend web services from within my
organization and outside but i never came across this :(

I need to pass tree parameters when connecting: username, password, and
some sort of sequence number

Thanks in advance

Jo
Josh Twist - 26 Apr 2006 13:56 GMT
You need to point add web reference to a valid WSDL file (an xml
document that describes the web service). It sounds like you've pointed
it at an HTML page.

The fact it's a java web service shouldn't make too much difference -
the whole point of web services is that they're interoperable.

Have you asked the guys who operate the service for the location of
their WSDL. If it doesn't have a WSDL then it's not really a web
service.

Let me know what happens next.

Josh
http://www.thejoyofcode.com.
Jo - 26 Apr 2006 14:06 GMT
hi:

yes i though the same, they have a web service what s more in their
documentation you can read the wsdl fille. in the file you can see
where the document is, i went there and tryed the wsdl.exe in something
similar to this http://host.com/some_folder/file.wsdl
and i still get the same error

I though that maybe in java the wsdl was put togheter in a  different
way?
what are yr thoughts?
Josh Twist - 26 Apr 2006 14:18 GMT
Nope - wsdl is an industry standard, not an MS thing.

What does the .wsdl file look like inside - does it look anything like
this (WSDL from simple HelloWorld service)?

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://tempuri.org/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://tempuri.org/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
 <wsdl:types>
   <s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
     <s:element name="HelloWorld">
       <s:complexType />
     </s:element>
     <s:element name="HelloWorldResponse">
       <s:complexType>
         <s:sequence>
           <s:element minOccurs="0" maxOccurs="1"
name="HelloWorldResult" type="s:string" />
         </s:sequence>
       </s:complexType>
     </s:element>
   </s:schema>
 </wsdl:types>
 <wsdl:message name="HelloWorldSoapIn">
   <wsdl:part name="parameters" element="tns:HelloWorld" />
 </wsdl:message>
 <wsdl:message name="HelloWorldSoapOut">
   <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
 </wsdl:message>
 <wsdl:portType name="WebServiceSoap">
   <wsdl:operation name="HelloWorld">
     <wsdl:input message="tns:HelloWorldSoapIn" />
     <wsdl:output message="tns:HelloWorldSoapOut" />
   </wsdl:operation>
 </wsdl:portType>
 <wsdl:binding name="WebServiceSoap" type="tns:WebServiceSoap">
   <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
   <wsdl:operation name="HelloWorld">
     <soap:operation soapAction="http://tempuri.org/HelloWorld"
style="document" />
     <wsdl:input>
       <soap:body use="literal" />
     </wsdl:input>
     <wsdl:output>
       <soap:body use="literal" />
     </wsdl:output>
   </wsdl:operation>
 </wsdl:binding>
 <wsdl:binding name="WebServiceSoap12" type="tns:WebServiceSoap">
   <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
   <wsdl:operation name="HelloWorld">
     <soap12:operation soapAction="http://tempuri.org/HelloWorld"
style="document" />
     <wsdl:input>
       <soap12:body use="literal" />
     </wsdl:input>
     <wsdl:output>
       <soap12:body use="literal" />
     </wsdl:output>
   </wsdl:operation>
 </wsdl:binding>
 <wsdl:service name="WebService">
   <wsdl:port name="WebServiceSoap" binding="tns:WebServiceSoap">
     <soap:address
location="http://localhost:2910/AspNet/WebService.asmx" />
   </wsdl:port>
   <wsdl:port name="WebServiceSoap12" binding="tns:WebServiceSoap12">
     <soap12:address
location="http://localhost:2910/AspNet/WebService.asmx" />
   </wsdl:port>
 </wsdl:service>
</wsdl:definitions>
Jo - 26 Apr 2006 14:34 GMT
Yes. it loks similar to that, a bit shorter,

there is some interesting elements:
....
...
<wsdl:message name="message_Name">
  <wsdl:part name="User" type="xsd:string />
  ....
<wsdl:portType name="port...">
<wsdl:operation name="operation_namel" parameterOrder="User ....">
....

The part where it says user, after that there is other parametrs i
should be passing so I guess thats where i have to add them but i have
no idea how
Josh Twist - 26 Apr 2006 14:41 GMT
And you pointed wsdl.exe at this .wsdl document?
Josh Twist - 26 Apr 2006 14:43 GMT
oops - hit enter too soon.

You shouldn't have to add anything to the WSDL. It describes the
interface of the web service you're using so it's up to the operator of
the web service to provide an accurate WSDL. Which, from what you've
said, it sounds like they have done.

As I asked earlier - are you sure you pointed wsdl.exe at that
document? Otherwise we probably can't help much more without seeing the
WSDL itself. Sorry.

Josh
http://www.thejoyofcode.com/
Jo - 26 Apr 2006 14:49 GMT
hi josh;

yes, i pointed wsdl.exe to the http://..../file.wsdl :(
and i get the error mentioned above,

the html document does not contain web service discovery information

I ll ask to see if i can put the wsdl doc here

Thanks

Jo
Josh Twist - 26 Apr 2006 14:56 GMT
OK Jo - all sounds very odd.

If you can post the WSDL - a link would be best.

J
Jo - 27 Apr 2006 10:19 GMT
ok, I m affraid i cnat put the wsdl file here, :(
But I asked and they said that if i want to create a proxy class i have
to generate it from this wsdl file that is in their doc.

SO do you know how to do that?

Should i create a web service myself and use that file as a wsdl l file
compile and put it somewhere so i can use it to create my proxy??

Any ideas, welcome

Jo

> OK Jo - all sounds very odd.
>
> If you can post the WSDL - a link would be best.
>
> J
Josh Twist - 27 Apr 2006 15:56 GMT
Nope - just save the WSDL in their doc somewhere and point wsdl.exe at
it.

Josh
http://www.thejoyofcode.com/
Jo - 28 Apr 2006 09:33 GMT
HI josh:

tryed that but it doesnt work,  It gives me several different
formatting errors, this is their fault
If at the end I find out a technical solution I ll post it here.
Thanks for your help

Jo

> Nope - just save the WSDL in their doc somewhere and point wsdl.exe at
> it.
>
> Josh
> http://www.thejoyofcode.com/

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.