New to SOAP

T

Thomas Nelson

I'm trying to participate in a bidding agent competition (see
http://www.biddingagentcompetition.com/ if you're curious). The basic
idea is to write a program that will periodically upload new bids on
items and ask for reports on how it's doing. The API is an XML-based
web service that uses the Simple Object Access (SOAP) protocol. I've
never tried to use SOAP before, and one reference recommended Apache
Axis. I'm pretty familiar with Java, so this seems like a good idea.
But I'm not sure what to do with this .wsdl file I've been given. The
instructions say:
"""
To set up the MSN adCenter API so you can begin programming:

Obtain the adcenterapi.wsdl file.

Open a project in your development environment.

Add the MSN AdCenterAPI URL as the new web reference.

Instantiate the AdCenterAPI class:

AdCenterAPI pAPI = new AdCenterAPI();
m_api.Credentials = System.Net.CredentialCache.DefaultCredentials;

Create APIUserAuthHeader to authenticate against the web server as
shown in the following code sample:

ApiUserAuthHeader pAuth = new ApiUserAuthHeader ();
pAuth.UserName = "APIUser2703241601"; //this is just an example
pAuth.Password = "password"; //this is just an example
pAuth.UserAccessKey = "1YEKTSET23"; //this is just an example
pAPI.ApiUserAuthHeaderValue = pAuth;
"""
Now, unless I'm confused, Axis is not a development environment. A
development environment is something like NetBeans or JCreator. Where
does Axis come into play in this? Perhaps it's on the server side, and
I don't need to worry about it? What does it mean to add a URL as a
web reference? Maybe this means javac needs to be able to find the xml
file to compile the code properly?

If anyone can point me in the right direction with these things, I'd be
very grateful. Thanks,
THN
 
J

jwagenleitner

Thomas said:
I'm trying to participate in a bidding agent competition (see
http://www.biddingagentcompetition.com/ if you're curious). The basic
idea is to write a program that will periodically upload new bids on
items and ask for reports on how it's doing. The API is an XML-based
web service that uses the Simple Object Access (SOAP) protocol. I've
never tried to use SOAP before, and one reference recommended Apache
Axis. I'm pretty familiar with Java, so this seems like a good idea.
But I'm not sure what to do with this .wsdl file I've been given. The
instructions say:
"""
To set up the MSN adCenter API so you can begin programming:

Obtain the adcenterapi.wsdl file.

Open a project in your development environment.

Add the MSN AdCenterAPI URL as the new web reference.

Instantiate the AdCenterAPI class:

AdCenterAPI pAPI = new AdCenterAPI();
m_api.Credentials = System.Net.CredentialCache.DefaultCredentials;

Create APIUserAuthHeader to authenticate against the web server as
shown in the following code sample:

ApiUserAuthHeader pAuth = new ApiUserAuthHeader ();
pAuth.UserName = "APIUser2703241601"; //this is just an example
pAuth.Password = "password"; //this is just an example
pAuth.UserAccessKey = "1YEKTSET23"; //this is just an example
pAPI.ApiUserAuthHeaderValue = pAuth;
"""
Now, unless I'm confused, Axis is not a development environment. A
development environment is something like NetBeans or JCreator. Where
does Axis come into play in this? Perhaps it's on the server side, and
I don't need to worry about it? What does it mean to add a URL as a
web reference? Maybe this means javac needs to be able to find the xml
file to compile the code properly?

If anyone can point me in the right direction with these things, I'd be
very grateful. Thanks,
THN

The code you posted is for .NET and the development environment they
were referring to was probably Visual Studio. If you still decide to
use Java for this Apache Axis would be an excellent choice. Read
through the examples on the Axis website and those included in the
distribution. Axis can take the WSDL file you have and create a lot of
the code for you using the WSDL2Java tool that comes with Axis.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top