Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Using SOAP XML files

Reply
Thread Tools

Using SOAP XML files

 
 
shaselsc@gmail.com
Guest
Posts: n/a
 
      06-12-2007
I'm new to SOAP and Web Services in general. I've been given the task
of implementing someone else's web services in an ASP.NET 2.0 project.
What I've been given are two .xml files and several .xsd files. They
are used to query information from their database. The queries are
sent in SOAP format and returned in the same as far as I know. I'm
quite confused on where to start to learn how to call these queries.
Should I be learning more about XML, SOAP, or web services to find out
how to send these queries?

Thanks in advance.

 
Reply With Quote
 
 
 
 
shaselsc@gmail.com
Guest
Posts: n/a
 
      06-12-2007
Here is an example of what is in one of the xml files. I edited some
of the file in case it left their web services open to anyone

<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Generated by the Oracle JDeveloper 10g Web Services WSDL
Generator
-->
- <!-- Date Created: Tue Jun 21 15:14:37 EDT 2005
-->
- <definitions name="OPSQueryWebService" targetNamespace="url/
filename.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlnssd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://
schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="url/filename.wsdl"
xmlns:ns1="url/filename.xsd">
- <types>
<schema targetNamespace="url/filename.xsd" xmlns="http://www.w3.org/
2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
encoding/" />
</types>
- <message name="processquery0Request">
<part name="xquery" element="xsd:any" />
</message>
- <message name="processquery0Response">
<part name="return" element="xsd:any" />
</message>
- <portType name="OPSQueryWebServicePortType">
- <operation name="processquery">
<input name="processquery0Request"
message="tnsrocessquery0Request" />
<output name="processquery0Response"
message="tnsrocessquery0Response" />
</operation>
</portType>
- <binding name="OPSQueryWebServiceBinding"
type="tns:OPSQueryWebServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/
http" />
- <operation name="processquery">
<soapperation soapAction="" style="rpc" />
- <input name="processquery0Request">
<soap:body use="literal" namespace="OPSQueryWebService" />
</input>
- <output name="processquery0Response">
<soap:body use="literal" namespace="OPSQueryWebService" />
</output>
</operation>
</binding>
- <service name="OPSQueryWebService">
- <port name="OPSQueryWebServicePort"
binding="tns:OPSQueryWebServiceBinding">
<soap:address location="Edited for security purposes" />
</port>
</service>
</definitions>

 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      06-12-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> I'm new to SOAP and Web Services in general. I've been given the task
> of implementing someone else's web services in an ASP.NET 2.0 project.
> What I've been given are two .xml files and several .xsd files. They
> are used to query information from their database. The queries are
> sent in SOAP format and returned in the same as far as I know. I'm
> quite confused on where to start to learn how to call these queries.
> Should I be learning more about XML, SOAP, or web services to find out
> how to send these queries?


All of the above.

Web Services uses SOAP, which is an XML-based language.

Are you being asked to create the service, or simply to consume it? Did you
receive a .wsdl file as well? It's what describes the web service.
--
John Saunders [MVP]


 
Reply With Quote
 
shaselsc@gmail.com
Guest
Posts: n/a
 
      06-12-2007
I did not receive any .wsdl files. I'm assuming I'm only here to
consume it since they created all the web services on their end. I'm
just not sure how I consume something like this.

 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      06-12-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Here is an example of what is in one of the xml files. I edited some
> of the file in case it left their web services open to anyone
>
> <?xml version="1.0" encoding="UTF-8" ?>
> - <!-- Generated by the Oracle JDeveloper 10g Web Services WSDL
> Generator
> -->
> - <!-- Date Created: Tue Jun 21 15:14:37 EDT 2005
> -->
> - <definitions name="OPSQueryWebService" targetNamespace="url/
> filename.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlnssd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://
> schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="url/filename.wsdl"
> xmlns:ns1="url/filename.xsd">
> - <types>
> <schema targetNamespace="url/filename.xsd" xmlns="http://www.w3.org/
> 2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/
> encoding/" />
> </types>
> - <message name="processquery0Request">
> <part name="xquery" element="xsd:any" />
> </message>
> - <message name="processquery0Response">
> <part name="return" element="xsd:any" />
> </message>
> - <portType name="OPSQueryWebServicePortType">
> - <operation name="processquery">
> <input name="processquery0Request"
> message="tnsrocessquery0Request" />
> <output name="processquery0Response"
> message="tnsrocessquery0Response" />
> </operation>
> </portType>
> - <binding name="OPSQueryWebServiceBinding"
> type="tns:OPSQueryWebServicePortType">
> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/
> http" />
> - <operation name="processquery">
> <soapperation soapAction="" style="rpc" />
> - <input name="processquery0Request">
> <soap:body use="literal" namespace="OPSQueryWebService" />
> </input>
> - <output name="processquery0Response">
> <soap:body use="literal" namespace="OPSQueryWebService" />
> </output>
> </operation>
> </binding>
> - <service name="OPSQueryWebService">
> - <port name="OPSQueryWebServicePort"
> binding="tns:OPSQueryWebServiceBinding">
> <soap:address location="Edited for security purposes" />
> </port>
> </service>
> </definitions>


Good. That's a WSDL file - it's the standard format file for defining how to
use a web service.

You use a WSDL file by creating the project that will consume the service,
then using Add Web Reference. Specify the path to the WSDL file (I know they
talk about URLs, but you can specify the path or browse to it). This will
create a set of proxy classes that you can use in your application to
reference the service.
--
John Saunders [MVP]


 
Reply With Quote
 
shaselsc@gmail.com
Guest
Posts: n/a
 
      06-12-2007
Should I do the same for the .xsd files? They contain various xsd
schemas.

 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      06-12-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Should I do the same for the .xsd files? They contain various xsd
> schemas.


No the WSDL file is what is consumed.

I have to say that when I tried consuming this file, it didn't work. It was
only a quick try, so maybe if I had more time, I could get it to work
(probably won't be today).

I'm concerned about how this WSDL is written. I think the <part
element="xsd:any"/> is incorrect. "element' is meant to be the name of an
element, and xsd:any is a type name.
--
John Saunders [MVP]


 
Reply With Quote
 
shaselsc@gmail.com
Guest
Posts: n/a
 
      06-12-2007
I actually tried adding this as a reference and it didn't work. I
tried Add Web Reference and then typed in the path and clicked once on
the file, but the "Add Reference" button was still greyed out, not
allowing me to get access to the file. Is there something I'm not
doing?

Thanks for all the help so far John.

 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      06-13-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I actually tried adding this as a reference and it didn't work. I
> tried Add Web Reference and then typed in the path and clicked once on
> the file, but the "Add Reference" button was still greyed out, not
> allowing me to get access to the file. Is there something I'm not
> doing?


Yes, but I don't know what that would be!

Make sure you've entered the full path to the file. Also, if that doesn't
work, try opening the file with Notepad's File->Open command, pasting in the
same file path. Finally, look for any other user interface elements you need
to fill in. For instance, are there other text boxes that need you to input
something valid?

Finally, which version of Visual Studio are you using, which language, etc.
--
John Saunders [MVP]


 
Reply With Quote
 
shaselsc@gmail.com
Guest
Posts: n/a
 
      06-13-2007
I found out how I was supposed to handle these services. It turns out
that the services are going to be handled elsewhere and I'm just
supposed to manually create an xml file and send it in a specific
format to their server. At least that's how the previous programmers
were handling it. I'm not sure if this is the best way to handle it or
not, but it seems the web services are all on their end and they were
just giving us the way to format the xml file.

To answer your questions, I am using Visual Studio 2005, C#, and
ASP.NET 2.0.

 
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
soap using remoting vs soap using web services B. Deepak ASP .Net Web Services 2 06-21-2006 07:14 AM
SOAP XML Generation from a SOAP Object (Soap4r 1.5.4) Dan Fitzpatrick Ruby 1 07-16-2005 01:01 PM
Problem of using apache soap to consume WSE 2.0 soap attachment Mullin Yu ASP .Net Web Services 0 10-08-2003 08:09 AM
To SOAP or Not To SOAP? mooseshoes XML 3 09-21-2003 04:38 PM
SOAP Client creation in ASP.NET using MS SOAP Toolkit Sham Ramakrishnan ASP .Net 2 07-01-2003 11:29 AM



Advertisments