Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > a differnt way to consuming web services?

Reply
Thread Tools

a differnt way to consuming web services?

 
 
Jo
Guest
Posts: n/a
 
      04-26-2006
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

 
Reply With Quote
 
 
 
 
Jo
Guest
Posts: n/a
 
      04-26-2006
I know the web service is coded in java
Would this complicate thing more?


Thanks

jo

 
Reply With Quote
 
 
 
 
Josh Twist
Guest
Posts: n/a
 
      04-26-2006
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/

 
Reply With Quote
 
Jo
Guest
Posts: n/a
 
      04-26-2006
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

 
Reply With Quote
 
Josh Twist
Guest
Posts: n/a
 
      04-26-2006
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.

 
Reply With Quote
 
Jo
Guest
Posts: n/a
 
      04-26-2006
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?

 
Reply With Quote
 
Josh Twist
Guest
Posts: n/a
 
      04-26-2006
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">
<wsdlart name="parameters" element="tns:HelloWorld" />
</wsdl:message>
<wsdl:message name="HelloWorldSoapOut">
<wsdlart name="parameters" element="tns:HelloWorldResponse" />
</wsdl:message>
<wsdlortType name="WebServiceSoap">
<wsdlperation name="HelloWorld">
<wsdl:input message="tns:HelloWorldSoapIn" />
<wsdlutput message="tns:HelloWorldSoapOut" />
</wsdlperation>
</wsdlortType>
<wsdl:binding name="WebServiceSoap" type="tns:WebServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdlperation name="HelloWorld">
<soapperation soapAction="http://tempuri.org/HelloWorld"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:binding name="WebServiceSoap12" type="tns:WebServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdlperation name="HelloWorld">
<soap12peration soapAction="http://tempuri.org/HelloWorld"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdlutput>
<soap12:body use="literal" />
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="WebService">
<wsdlort name="WebServiceSoap" binding="tns:WebServiceSoap">
<soap:address
location="http://localhost:2910/AspNet/WebService.asmx" />
</wsdlort>
<wsdlort name="WebServiceSoap12" binding="tns:WebServiceSoap12">
<soap12:address
location="http://localhost:2910/AspNet/WebService.asmx" />
</wsdlort>
</wsdl:service>
</wsdl:definitions>

 
Reply With Quote
 
Jo
Guest
Posts: n/a
 
      04-26-2006
Yes. it loks similar to that, a bit shorter,

there is some interesting elements:
.....
....
<wsdl:message name="message_Name">
<wsdlart name="User" type="xsd:string />
....
<wsdlortType name="port...">
<wsdlperation 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

 
Reply With Quote
 
Josh Twist
Guest
Posts: n/a
 
      04-26-2006
And you pointed wsdl.exe at this .wsdl document?

 
Reply With Quote
 
Josh Twist
Guest
Posts: n/a
 
      04-26-2006
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Differnt Google windows rchhima07@gmail.com Computer Support 5 02-12-2009 11:38 PM
Concatenating Date and Time from two differnt fields Tamer Ibrahim ASP .Net 1 01-17-2008 12:54 PM
mail in/out stored in differnt folders according to sender/recipient name? meerkat Computer Support 3 03-13-2007 10:22 AM
How to allow access to HD that was used with a differnt computer =?Utf-8?B?QWxwaGFRdXAybml0ZQ==?= ASP .Net 1 11-06-2006 09:22 AM
Hosting files at two differnt places Galsaba HTML 6 04-17-2004 11:46 AM



Advertisments