on 12-27-2005 2:07 AM
Hi,guys. I have created a Web service, and deployed to WAS.But where is the accessing URL? WAS has created several WSDLs for the serviece, but I can not find the URL in the files.
I think that the URL looks like "http://localhost:50000/XISOAPAdapter/MessageServlet?channel=:WAS2:CC_GIS_Equipment_Create_SOAPOUT&version=3.0&Sender.Service=WAS2&Interface=urn%3Azpepc%3Agis%3Aequipment%3Amaintenance%5EMI_GIS_Equipment_Create"
yeah, I can see all available web services in web service navigator. But how can I access them in my client code?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the WebService Navigator (http://<hostname>:50000/wsnavigator).
There you can see all available Web services.
Regards,
daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
my accessing code is:
public class VacationClient {
public static void main(String[] args) throws Exception {
System.out.println("SOAP call start");
VacationClient helloSOAPClient = new VacationClient();
String resultValue = helloSOAPClient.doSOAPRequest(
"VacationCheckerService", "getVacationDays",
"employed_years", 20);
}
public String doSOAPRequest(String _strURI, String _strMethodName,
String _strName, int _strValue) throws Exception {
Call call = new Call();
call.setTargetObjectURI("urn:" + _strURI);
call.setMethodName(_strMethodName);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement(new Parameter(_strName, Integer.class, new Integer(
_strValue), null));
call.setParams(params);
System.out.println("开始");
Response resp = call
.invoke(
new URL(
"http://10.136.31.121:50000/TestWeb_Config1_SoapServlet"),
"");
if (resp.generatedFault()) {
Fault fault = resp.getFault();
System.out.println("failed!");
return "failed!";
} else {
Parameter result = resp.getReturnValue();
System.out.println("sucessful!"+result.getValue().toString());
return result.getValue().toString();
}
}
}
But the URL is not correct ,and an exception is throwed:
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client; msg=Software caused connection abort: recv failed; targetException=java.net.SocketException: Software caused connection abort: recv failed]
at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:358)
at org.apache.soap.rpc.Call.invoke(Call.java:248)
at test.VacationClient.doSOAPRequest(VacationClient.java:44)
at test.VacationClient.main(VacationClient.java:18)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.