Cant connect...
[email protected] Wed, 26 May 2004 14:53:21 +0100 (WEST)
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <[email protected]> |
I'm trying to acess this site:
http://www.iilab.com:81/mapsservice/mapsservice.asmx?op=GenerateMap
with the following input:
startWayName: Avenida das Igrejas
startDoorNumber: 2
endWayName: Avenida Almirante Reis
endDoorNumber: 6
costID: 1
my java code is:
public void commandAction(Command c, Displayable d) {
try {
// build request string
String symbol = symbolField.getString();
SoapObject rpc = new SoapObject("http://www.ydreams.
com/MapsService/GenerateMap","GenerateMap");
rpc.addProperty("startWayName","avenida das Igrejas");
rpc.addProperty("startDoorNumber",new Integer(Integer.parseInt("2"))
);
rpc.addProperty("endWayName","avenida almirante reis");
rpc.addProperty("endDoorNumber",new Integer(Integer.parseInt("6")));
rpc.addProperty("costID",new Integer(Integer.parseInt("1")));
/*
SoapObject rpc = new SoapObject("http://tempuri.org/","Add");
rpc.addProperty("param1",new Integer(Integer.parseInt("12")));
rpc.addProperty("param2",new Integer(Integer.parseInt("24")));
*/
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
System.out.println(envelope.bodyOut.toString());
resultItem.setLabel(symbol);
HttpTransport ht = new HttpTransport("http://www.iilab.com:
81/mapsservice/mapsservice.asmx");
// HttpTransport ht = new HttpTransport("http://localhost:81/NewFile.
asmx");
ht.debug = true;
try {
System.out.println("trying to connect");
ht.call("http://www.ydreams.com/MapsService/GenerateMap",
envelope);
//ht.call("http://tempuri.org/Add",envelope);
System.out.println(envelope.bodyIn.toString());
System.out.println(envelope.toString());
System.err.println (ht.requestDump);
System.err.println (ht.responseDump);
}
catch (Exception e) {
e.printStackTrace();
System.err.println (ht.requestDump);
System.err.println (ht.responseDump);
}
resultItem.setText("" + envelope.getResult());
}
catch (Exception e) {
e.printStackTrace();
resultItem.setLabel("Error:");
resultItem.setText(e.toString());
}
}
BUT I GOT this error:
ault{faultcode=soap:Client; faultstring=Server was unable to read request. -->
There is an error in XML document (1, 233). --> <GenerateMap xmlns='http:
//www.ydreams.com/MapsService/GenerateMap'> was not expected.; detail=null; }
Can anyone help me???