You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Scott Nichol <sn...@scottnichol.com> on 2003/05/22 18:21:01 UTC

Re: client pblm

The server code wants to load demo.server.WorkService, but the class 
loader cannot find it.  You must have WorkService.class somewhere the 
class loader can find it, either in Tomcat's classpath or in 
$TOMCAT_HOME/webapps/soap/WEB-INF/classes/demo/server.

On 22 May 2003 at 6:12, Kamran Ghani wrote:

> 
> 
> Thanks fellows. i used the solution u told me and it worked fine
> I got another problem. i deployed a service 'WorkService' using 
> apache-SOAP 2.2 and tomcat 3.2. But when I try to access the service 
> through the client i get the following message.
> 
> Deploymrnt error in SOAP service 'urn:WorkService' class name 
> 'demo.server.WorkService' could not be resolved: 
> demo.server.WorkService
> What can be the cause?
> 
> 
> Help STOP SPAM with the new MSN 8  and get 2 months FREE*


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



EncodingURI is null in Response and Parameter.... Help

Posted by Parames <kp...@yahoo.com>.
Hi guys ,
Im having problem with my SOAP service where im
passing Customer id and getting address from database.
Im using java bean ,tomcat4.1.24 ans Apache soap
2.3.1.
Worked fine before connecting to database..now i
couldn't find out the solution...

I printed call,response and parameter:-
CALL in GetCusInfo...............
[Header=null] [methodName=getCustomerInfo]
[targetObjectURI=urn:CustInfoFetcher]

[encodingStyleURI=http://schemas.xmlsoap.org/soap/encoding/]
[SOAPContext=[Part
s={}]] [Params={[[name=IdToLookup] [type=class
java.lang.String] [value=2] [enco
dingStyleURI=null]]}]

RESPONSE  in GetCusInfo...............
[Header=null] [methodName=getCustomerInfo]
[targetObjectURI=urn:CustInfoFetcher]

[encodingStyleURI=http://schemas.xmlsoap.org/soap/encoding/]
[SOAPContext=[Part
s={[cid:null type: text/xml; charset=utf-8 enc:
null]}]] [return=[name=return] [
type=class samples.scicom.Customer] [value=null]
[encodingStyleURI=null]]
[Params={}]

Parameter  in GetCusInfo...............
[name=return] [type=class samples.scicom.Customer]
[value=null] [encodingStyleUR
I=null]


1)Encoding URi is null for Response and parameter
2) SQl exception ,using jDBC to MS SQL server..what
are the things to check to work fine...

------------------------------------------------------
here my Service (CustomerInfoSVC.java)

package samples.scicom;
import java.util.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import org.apache.soap.util.xml.*;
import java.io.*;
import java.sql.*;
import javax.sql.DataSource;
import javax.naming.*;



public class CustomerInfoSVC {
		 
    private Hashtable custInfoTable;
    

Connection Conn = null;
Context ctx = null;
Hashtable env = null;
Statement stmt = null;
ResultSet rs = null;

  /
    public CustomerInfoSVC() {
          }
    
        
 public Customer getCustomerInfo(String
customerId)throws   IllegalArgumentException{
  		      
           try
        {
        		 
        DBAdapter dba = new DBAdapter();
        Conn = dba.getConnection("");
        
              stmt = Conn.createStatement();
        String SQLStatement = "Select * from
CustomerProfile";  
         rs = stmt.executeQuery(SQLStatement);
        
         if (rs ==null)
        {
        		 System.out.println("In Service -rs
==null--Result set ----:"+rs);
        }
        
             
        String phone_no =rs.getString("phone");
         		 
        		 
        String name = rs.getString("name");
        String custId = rs.getString("id");
                      
        cust.setCustomerId(custId);
        cust.setPhoneNumber(name);
        cust.setName(phone_no);
        
		       
       }catch(Exception e){
            System.out.println("SQL..."+e);}
          
       return cust ;    
           
           } 
    
     
    public Customer cust;
    public String name,phone_no,custId;
}
---------------------------------------------------------
package samples.scicom;

import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.rpc.*;

public class GetCustInfo {
    String IdToLookup;
    Customer cust;
    Response resp;
    
   
     public GetCustInfo() {
      	
    }
    
    public GetCustInfo(String  IdToLookup) {
    	this.IdToLookup = IdToLookup;
    	    }
    
     
 
  public Customer callCustSVC(String IdToLookup)
throws Exception 
  {
   String encodingStyleURI =
Constants.NS_URI_SOAP_ENC;
URL url = new
URL("http://localhost:8080/soap/servlet/rpcrouter");  
                      
    
 SOAPMappingRegistry smr = new SOAPMappingRegistry();
 BeanSerializer beanSer = new BeanSerializer();
 String soapAction ="";

    // Map the types.
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new
QName("urn:xml-soap-address-demo", "address"),
                 Customer.class, beanSer, beanSer);
    
    // Build the call.
    Call call = new Call();

    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:CustInfoFetcher");
    call.setMethodName("getCustomerInfo");
    call.setEncodingStyleURI(encodingStyleURI);

    Vector params = new Vector();

    params.addElement(new Parameter("IdToLookup",
String.class,
                                    IdToLookup,
null));
    call.setParams(params);
    System.out.println("CALL in
GetCusInfo..............."+ "\n"+call);

    // Invoke the call.
    //Response resp;

    try
    {
       
      resp = call.invoke(url, soapAction);
       System.out.println("RESPONSE  in
GetCusInfo..............."+ "\n"+resp);
    }
    catch (SOAPException e)
    {
      System.err.println("Caught SOAPException (" +
                         e.getFaultCode() + "): " +
                         e.getMessage());
      //return;
    }

    // Check the response.
    if (!resp.generatedFault())
    {
      Parameter ret = resp.getReturnValue();
      cust =(Customer)ret.getValue();
      System.out.println("Parameter  in
GetCusInfo..............."+ "\n"+ret);
      
      //System.out.println("Name :"+ cust.getName());
      
    }
    else
    {
      Fault fault = resp.getFault();

      System.err.println("Generated fault: " + fault);
      
    }
    return cust;
  }
  
}
------------------------------------------------------





-------------------------------------------------------
This is my first SOAP service and Your help will  be
much appreciated..
Thanks and regards
Parames










__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com