Evan McCarthy

Greenhorn
+ Follow
since Feb 01, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Evan McCarthy

You should try http://ajax.syr.edu/causp/kt/ktWebservice.asmx



I have tried that, but I get the same error.

You should also pay attention to compatibility issues for accessing .Net web services from Java. In particular specify a value for soapAction.



This is all very new to me...could you elaborate a little? Thanks!

Evan
19 years ago

you should use some tool to geanerate webservice proxy class from WSDL file such as



I was using the ColdFusion webservice proxy generator in Dreamweaver, but I get problems whenever a need to pass an array as a argument. I'm guessing that coldFusion arrays and the webservice's notion of arrays don't match up exactly.

I'll have to look into these other tools. Thanks for the advice.
19 years ago

are u able to get any browser when you type http://ajax.syr.edu/causp/kt/ktWebservice.asmx?wsdl in browser ?



Yes. When I go there, I get the xml. If I go to http://ajax.syr.edu/causp/kt/ktWebservice.asmx (without the ?wsdl), I get an API description.
19 years ago
I'm trying to create a web service client in Java. I've gotten this far:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

import java.net.*;

public class WebServiceClient {

public void connect() throws Exception
{
Service service = new Service();
Call call = (Call)service.createCall();

String endpoint = "http://ajax.syr.edu/causp/kt/ktWebservice.asmx?wsdl";
call.setTargetEndpointAddress(new URL(endpoint));
call.setOperationName(new QName("Login"));

String username = "bond";
String password = "bond";
boolean guestMode = false;

System.out.println("username: " + username + "\tpassword: " + password);
Integer SID = (Integer)call.invoke(new Object [] {new String(username), new String(password), new Boolean(guestMode)});
System.out.println("username: " + username + "\tpassword: " + password);

System.out.println("Got result : " + SID);

}

public static void main(String [] args)
{

WebServiceClient w = new WebServiceClient();

try
{
w.connect();
}

catch(Exception e)
{
System.out.println("An error has occurred.");
e.printStackTrace();
}

System.out.println("Done");

}
}


I code compiles, but when I run it, I get:
AxisFault
faultcode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.SocketException: Software caused connection abort: connect
faultActor:
faultNode:
faultDetail:
<http://xml.apache.org/axis/}stackTrace: java.net.SocketException: Software caused connection abort: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImp.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImplet.java:171)
...
...
...

Can anyone decipher this for me? Or maybe give me an easier way to create a web services client? Thanks!

Evan
19 years ago