All right then, now we have confirmed that your service(s) are deployed
and we can focus on the client piece.
Let's start with a simple client and get that to
work. Later you can add to it. Also, later on I'll walk you
through how to set up TCPmon. Remember, until you have gone through
this a few times eliminate what you don't
know so you can focus on one thing at a
time.
Here is a simple client for you to try:
package com.sample.www.directsample;
import org.apache.axis.client.Call;
import
org.apache.axis.client.Service;
import
org.apache.axis.encoding.XMLType;
import
javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import java.net.*;
public class
ReportHandlerClient
{
public static void main(
String[] args ) throws Exception
{
// URL of the web service
String url = ""http://127.0.0.1:7001/axis/services/">http://127.0.0.1:7001/axis/services/ReportHandlerServicePort
";
/* Create an instance of
the Call Object */
Service service = new
Service();
Call call = (Call)
service.createCall();
call.setTargetEndpointAddress( new URL( url ));
System.out.println();
System.out.println( "Connecting to: " + url
);
System.out.println();
// Set parameter
definitions in the call
object
// Fill this in after you're
sure that you can locate and connect to the service.
// Set the definition of
the return type
// Fill this in after you're
sure that you can locate and connect to the service.
// Name of the method to
invoke
// Fill this in after you're
sure that you can locate and connect to the service
}
}
}
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
June 15, 2004 1:32 PM
To: [EMAIL PROTECTED]
Subject: Re:
Namespaces & Clients
I am dealing with the
ReportHandlerServicePort for now and only run a very
simply
example through addReport.
And now... Some Services
AdminService
(wsdl)
AdminService
Version
(wsdl)
getVersion
SampleDirectService
(wsdl)
addReport
ReportHandlerServicePort
(wsdl)
addReport
addReports
rmReport
rmReports
In
a message dated 6/15/2004 1:30:41 PM Eastern Standard
Time,
[EMAIL PROTECTED] writes:
Okay, then please post a copy
of the services list. So, we can see what we
are up
against...
-----Original Message-----
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
June 15, 2004 1:27 PM
To: [EMAIL PROTECTED]
Subject: Re:
Namespaces & Clients
I was able to figure out why
that was happening. It was a fault on my end,
nothing major.
Hopefully you can help me with the other issue.
James
In a
message dated 6/15/2004 1:23:24 PM Eastern Standard
Time,
[EMAIL PROTECTED] writes:
So, when you click on the
"View" html tag you get a page back with the list
of your web
services. However, when you go to
http://localhost:8080/axis/services you
don't?
That is very bizarre...
Try typing http://127.0.0.1:8080/axis/happyaxis.jsp and
confirm that you
have installed AXIS correctly and that it is
running.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
June 15, 2004 12:57 PM
To: [EMAIL PROTECTED]
Subject:
Re: Namespaces & Clients
When I go to the address you
listed I do not see a page, however if I go
through http://localhost:8080/axis I can click on Services and
see my service
deployed (And access it's WSDL). Does this mean I
have some work to do yet?
Also, what settings on TCPMon would
work for my purposes. I don't need to
anything complicated, just
some ports that will get my sample working.
Thanks for your
continued help,
James
In a message dated 6/15/2004 12:23:32
PM Eastern Standard Time,
[EMAIL PROTECTED] writes:
Well,
lets take things one step at a time.
If you type http://localhost:8080/axis/services into a web
browser then you
should see your service(s) deployed.
Please
post that for me, so I can verify that you have actually deployed
the
services correctly. If that fails then there is no
sense in going on to
your client because there is nothing for the
client to communicate with.
In addition, are you running
TCPmon now? If so, TCPMon and TomCat cannot
listen on the
same port on the same workstation. You will have to modify one
or
the other to listen on a different port.
-----Original
Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
June 15, 2004 12:04 PM
To: [EMAIL PROTECTED]
Subject:
Re: Namespaces & Clients
I wanted to avoid posting
the code because it is lengthy and generally deals
with more than
one file but here it is. Thanks for your help. I think when I
run
the client it's attempting to access the net because of the
namespace I
chose way back in the WSDL.
If anybody's would be
able to tell me if my reasoning is correct (Or help me
avoid
having to do the entire java WSDL2Java over for nothing). I want to
be
able to run this on the localhost and use TCPMon to see what's
going on. If
you guys could give me a heads up on what needs to
be adjusted to accomplish
that, that would be
wonderful!
package com.sample.www.directsample;
import
java.net.MalformedURLException;
import java.net.URL;
import
java.rmi.RemoteException;
import java.util.List;
import
javax.xml.namespace.QName;
import
javax.xml.rpc.Service;
import
javax.xml.rpc.ServiceException;
import
javax.xml.rpc.ServiceFactory;
import
javax.xml.rpc.handler.HandlerInfo;
import
com.sample.www.directsample.LoggingHandler;
import
com.sample.www.directsample._report;
import
com.sample.www.directsample._response;
public class
ReportHandlerClient
{
static String router = "http://localhost:8080/axis/directsample";
static
String service = "directsampleService.wsdl";
public static
void main(String[] args)
{
try
{
ServiceFactory sf
= ServiceFactory.newInstance();
URL u = new URL(router + "/"
+ service);
String url=""http://localhost:8080/axis/services/ReportHandlerService"
target=_blank>http://localhost:8080/axis/services/ReportHandlerService";
QName
serviceName = new
QName("http://www.sample.com/directsample","ReportHandlerService");
Service
s = sf.createService(u,serviceName);
QName portName =
new
QName("http://www.sample.com/directsample","ReportHandlerServicePort");
List
handlerChain =
s.getHandlerRegistry().getHandlerChain(portName);
HandlerInfo hi =
new
HandlerInfo(LoggingHandler.class,null,null);
handlerChain.add(hi);
ReportHandler
h =(ReportHandler)
s.getPort(portName,ReportHandler.class);
_report rpt = new
_report();
rpt.setAccount("1234567");
rpt.setXmlData("Really Really
Long string of GOOD STUFF!");
try {
_response rsp
= h.addReport(rpt);
boolean value =
rsp.isSuccess();
}
catch(Exception
e)
{
e.printStackTrace(
);
}
}
catch (ServiceException
se)
{
se.printStackTrace();
}
catch
(MalformedURLException
mue)
{
mue.printStackTrace();
}
}
}
In a
message dated 6/15/2004 11:49:49 AM Eastern Standard
Time,
[EMAIL PROTECTED] writes:
You are going to have to
post the client code. Without the code it is
impossible to tell
you where you are going wrong...
-----Original
Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
June 15, 2004 11:44 AM
To: [EMAIL PROTECTED]
Subject:
Namespaces & Clients
I have successfully deployed a
web service with Axis. I have written a
client which successfully
produces the SOAPEnvelope. Directly under the Envelope's
output
is a 404 HTTP Error listing. It also then echo's the root of the
web
page I used as the namespace.
If I want to run this service
on the local host for now, what do I have to
change to get the
Client to execute successfully?
Thanks for all your generous
support,
James
Crosson
[EMAIL PROTECTED]