Greetings,
I am a relative newcomer to web services, in the process of writing a
very simple component of a system: my AXIS2 client code sends a String
to a .NET web service and receives a confirmation (also a String) in
return. I thought that almost nothing could be simpler, but apparently
not. I have no problems at all contacting and working with my own AXIS
services, but the .NET service is a big problem so far.
Notes:
* When running code or browsers on the target machine I'm logged in
using Remote Desktop or the equivalent; I have an ID on that machine and
also access to the Admin account;
* The web server in which the .NET service is installed has a default
page that is displayed if anything is the slightest bit amiss;
* The endpoint website is using HTTPS;
Test cases:
* Running from a remote machine, from my own id on the target machine,
or when logged in as Admin, I am unable to contact the service from
program code. When I run my AXIS2 client, I get a 302 (moved). With
soapUI, trying to create a WSDL project I get "unexpected element:
TAG_END". (My theory is that in the first case I'm getting but not
following a redirect, and in the second I'm trying to parse the default
page HTML)
* Running from a remote machine or from my own id on the target machine,
I am unable to contact the service using a URL and a browser (any
brand). I simply get the default page.
* Running from the target machine as Admin, I actually can contact the
service (run the method in question, get the WSDL) using a URL and IE.
If I use any other browser I get the default page.
Client code follows, originally lifted from a very helpful site and
modified to protect the innocent. Any suggestions most gratefully received.
Rick Strong
//
*******************************************************************************
public class TryingToConnect {
public static void main(String[] args) throws Exception {
ServiceClient client = new ServiceClient();
Options opts = new Options();
opts.setTo(new
EndpointReference("https://endpoint_website.com/target_method.asmx"));
opts.setAction("urn:echo");
client.setOptions(opts);
OMElement res = client.sendReceive(createPayLoad());
System.out.println(res);
}
public static OMElement createPayLoad() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs =
fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
// *** method
OMElement method = fac.createOMElement("target_method", omNs);
// *** param
OMElement value = fac.createOMElement("data", omNs);
// *** param value
value.setText("a_completed_data_file.txt");
method.addChild(value);
return method;
}
}
//
*******************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]