cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services JAR Problem

Former Member
0 Kudos

Hi All,

Im trying to use a deployable proxy in my portal component. When I do this, it is giving me a compile time error as below:

This compilation indirectly unit indirectly references the missing type javax.xml.rpc.ServiceException(typically some required class file is referencing a type outside the class path)

I have gone through this thread and I believe he was also facing the same issue, but even when I put the WebServices_lib.jar in my -> add external Jars section of my project in NWDS it is still giving me the same error.

Does anyone know how to fix this?

Thanks

S.B

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

try adding exception.jar to your project.

Regards,

Yogesh...

Former Member
0 Kudos

Hi Yogesh,

Please help me with the location of exception.jar.

Thanks,

S.B

Former Member
0 Kudos

C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.exception_2.0.0\lib

if you have installed Netweaver Development Studio on C:\

Regards,

Yogesh...

Former Member
0 Kudos

Hi Yogesh,

Thanks, the error is still there.

What Im doing is that Ive created a deployable proxy and then Im trying to call this in my portal component.

Here is the one of the classes that Im using in my portal component.


package com.xyz.proxy;

/**
 * Service Interface (generated by SAP WSDL to Java generator).
 */

public interface Service extends javax.xml.rpc.Service {

  public com.aig.proxy.YCUST getLogicalPort(String portName) throws javax.xml.rpc.ServiceException;
  public com.aig.proxy.YCUST getLogicalPort() throws javax.xml.rpc.ServiceException;
  public java.rmi.Remote getLogicalPort(String portName, Class seiClass) throws javax.xml.rpc.ServiceException;
  public java.rmi.Remote getLogicalPort(Class seiClass) throws javax.xml.rpc.ServiceException;
  public String[] getLogicalPortNames();
  public com.sap.engine.services.webservices.jaxrpc.wsdl2java.lpapi.LogicalPortType getLogicalPortConfiguration(String lpName);

}

If you see, all methids throw javax.xml.rpc.ServiceException. So when Im trying to use this in my portal component as below, it is giving me this compiletime error.


package com.xyz;

import com.xyz.eccBean;
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.enum.*;
import com.sapportals.htmlb.event.*;
import com.sapportals.htmlb.page.*;
import com.sapportals.portal.htmlb.page.*;
import com.sapportals.portal.prt.component.*;

import java.io.IOException ;
import javax.naming.InitialContext ;


import javax.rmi.PortableRemoteObject ;
import com.xyz.proxy.YCUST ;
import com.xyz.proxy.Service ;
import com.xyz.proxy.types.* ; 



public class ECEWenService extends PageProcessorComponent {

  public DynPage getPage(){
    return new ECEWenServiceDynPage();
  }

  public static class ECEWenServiceDynPage extends JSPDynPage{
  
    private eccBean eccBean = null;
  
    public void doInitialization(){
     
	  callWebServicePrxy();
    }

    public void doProcessAfterInput() throws PageException {
    }

    public void doProcessBeforeOutput() throws PageException {
      this.setJspName("ECCWebService.jsp");
    }
    
    protected void callWebServicePrxy(){
    
	InitialContext ctx = new InitialContext();
	Service obj = (Service) ctx.lookup("java:comp/env/ECCWS");
	YCUST port =  (YCUST)obj.getLogicalPort("YCUST");					 
	BAPI_CUSTOMER_GETDETAIL parameter = new BAPI_CUSTOMER_GETDETAIL();
	parameter.setCUSTOMERNO("0000009702");
	parameter.setPI_SALESORG("0001");
	BAPI_CUSTOMER_GETDETAILResponse result = new BAPI_CUSTOMER_GETDETAILResponse();
	result = port.BAPI_CUSTOMER_GETDETAIL(parameter);
	String NamePrint= result.getPE_ADDRESS().getNAME();
    }
    
  }
}

Im sure im missing some include. Please help.

Thanks,

SB

Former Member
0 Kudos

Problem resolved by adding all JARS under the two directories:

C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP-JEE\DCs\sap.com\webservices\_comp\gen\default\public\default\lib\java

C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP-JEE\DCs\sap.com\webservices_lib\_comp\gen\default\public\default\lib\java

And also add the imports:

import java.rmi.RemoteException;

import java.util.Hashtable;

import javax.naming.Context;

import javax.naming.InitialContext ;

import javax.naming.NamingException;

import javax.xml.rpc.ServiceException;

import javax.rmi.PortableRemoteObject ;