You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by mi...@nutechs.com on 2003/06/11 20:47:32 UTC
Beginner question
Hi,
I have experience with Java and XML, but am very new to AXIS and WSDL.
I've been trying to invoke the DailyDilbert web service and get a
response, with no success. I'm getting the following Exception when I run
my Java code:
SoapException:Server did not recognize the value of HTTP Header
SOAPAction: .
I've included my code below. If anyone would be willing to tell me what
I'm doing wrong, I'd really appreciate it.
I'm using axis-1_1RC2 and xerces-1_4_4
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class TestClient3
{
public static void main(String [] args) {
try {
String endpoint =
"http://www.esynaps.com/WebServices/DailyDiblert.asmx?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://tempuri.org/",
"DailyDilbertImagePath") );
String ret = (String) call.invoke(new Object[] { "" });
System.out.println("Got: '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
Thanks,
Michael Sobczak
NuTechs, Inc.
6785 Telegraph Road, Suite 350
Bloomfield Hills, MI 48301
pager: (248) 316-6524
RE: Beginner question
Posted by Vlad Umansky <vu...@adjoin.com>.
Since you are calling a MS service, it probably requires SOAPAction
field to be set.
Look in the WSDL file what the value should be and set it through
call.
<file:///C:\axis-1_1beta\docs\apiDocs\javax\xml\rpc\Call.html#setPropert
y(java.lang.String, java.lang.Object)> setProperty
(Call.SOAPACTION_URI_PROPERTY , java.lang.Object value)
<file:///C:\axis-1_1beta\docs\apiDocs\javax\xml\rpc\Call.html#setPropert
y(java.lang.String, java.lang.Object)>
<file:///C:\axis-1_1beta\docs\apiDocs\javax\xml\rpc\Call.html#setPropert
y(java.lang.String, java.lang.Object)> -----Original Message-----
From: michael_sobczak@nutechs.com [mailto:michael_sobczak@nutechs.com]
Sent: Wednesday, June 11, 2003 2:48 PM
To: axis-user@ws.apache.org
Subject: Beginner question
<file:///C:\axis-1_1beta\docs\apiDocs\javax\xml\rpc\Call.html#setPropert
y(java.lang.String, java.lang.Object)>
<file:///C:\axis-1_1beta\docs\apiDocs\javax\xml\rpc\Call.html#setPropert
y(java.lang.String, java.lang.Object)>
Hi,
I have experience with Java and XML, but am very new to AXIS and WSDL.
I've been trying to invoke the DailyDilbert web service and get a
response, with no success. I'm getting the following Exception when I
run my Java code:
SoapException:Server did not recognize the value of HTTP Header
SOAPAction: .
I've included my code below. If anyone would be willing to tell me what
I'm doing wrong, I'd really appreciate it.
I'm using axis-1_1RC2 and xerces-1_4_4
<file:///C:\axis-1_1beta\docs\apiDocs\javax\xml\rpc\Call.html#setPropert
y(java.lang.String, java.lang.Object)>
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class TestClient3
{
public static void main(String [] args) {
try {
String endpoint =
"http://www.esynaps.com/WebServices/DailyDiblert.asmx?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://tempuri.org/",
"DailyDilbertImagePath") );
String ret = (String) call.invoke(new Object[] { "" });
System.out.println("Got: '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
Thanks,
Michael Sobczak
NuTechs, Inc.
6785 Telegraph Road, Suite 350
Bloomfield Hills, MI 48301
pager: (248) 316-6524