Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Web Development Languages (http://www.programmingforums.org/forum40.html)
-   -   Caught an exception SOAP-ENV:Client,Error parsing HTTP status line "": java (http://www.programmingforums.org/showthread.php?t=10505)

melisand Jun 23rd, 2006 1:53 PM

Caught an exception SOAP-ENV:Client,Error parsing HTTP status line "": java
 
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? :confused:

melbolt Jun 23rd, 2006 2:56 PM

http://tns-www.lcs.mit.edu/manuals/j...Exception.html

Pizentios Jun 23rd, 2006 3:03 PM

can you post your code?

melisand Jun 23rd, 2006 3:08 PM

:

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");
        }
}


Dameon Jun 23rd, 2006 4:28 PM

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.


All times are GMT -5. The time now is 8:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC