![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2006
Location: Lisbon, Portugal
Posts: 2
Rep Power: 0
![]() |
I'm trying to program a web service with soap.
I have a client and a server! My server is implemented in java. It has to interact with other classes. I must deploy the services that server offers. I test client and server and they ran ok. When I invoke the server's services it gives me this error: Caught an exception SOAP-ENV:Client,Error parsing HTTP status line "": java.util.NoSuchElementException I don't know what it is. Does anybody know? ![]() |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt Last edited by melbolt; Jun 23rd, 2006 at 2:19 PM. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() |
can you post your code?
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jun 2006
Location: Lisbon, Portugal
Posts: 2
Rep Power: 0
![]() |
package samples.dspace;
import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class Client{
public Client(){}
public void chamada(String c){
URL url=null;
try{
url = new URL("http://localhost:8082/soap/servlet/rpcrouter");
}catch(Exception e){
e.printStackTrace();
}
Call call=new Call();
//Name of the service
call.setTargetObjectURI("urn:DSpaceTest");
//name of the method
call.setMethodName("teste");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
//Declaracao dos parametros
params.addElement(new Parameter("teste",String.class,c,null));
call.setParams(params);
System.out.println("call object: "+call);
//Fazer a chamada
Response resp=null;
try{
System.out.println("Going to call invoke(url, \"\")");
resp=call.invoke(url, "");
}catch(SOAPException e){
System.err.println("Caught an exception "+e.getFaultCode()+ "," + e.getMessage());
System.exit(-1);
}
//Devolve resposta
if(!resp.generatedFault()){
Parameter ret = resp.getReturnValue();
Object value=ret.getValue();
System.out.println(value);
}
else{
Fault fault = resp.getFault();
System.err.println("Generated fault: ");
System.out.println("Fault Code = "+fault.getFaultCode());
// System.out.println("Fault Code = "+fault.toString());
System.out.println("Fault String = "+ fault.getFaultString());
}
System.out.println("\n FINISHING...");
}
public static void main(String args[]){
Cliente cliente=new Cliente();
cliente.chamada("dora");
}
}
__________________
D.P. |
|
|
|
|
|
#5 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
It seems that the client isn't getting back a valid HTTP response from what I've been reading. Download a packet sniffer such as Ethereal or Ettercap to see what is being exchanged between them.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|