Skip to Content

WebDynpro with Webservice

Hello,

I have created a WebDynpro project with a webservise model.

After the deploy, when I run it, the system returns the following error:

Processing HTTP request to servlet [dispatcher] finished with error.

The error is: java.lang.NoSuchMethodError: com.sap.engine.services.webservices.jaxrpc.wsdl2java.BaseGeneratedStub._initParameter(Lcom/sap/engine/services/webservices/jaxrpc/wsdl2java/ServiceParam;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;)V

Exception id: [000F202B654C006D000001580000161B000456B0AEB73C43]

________________________________________________________________

The error encurred into the View's doInit method, at the following point showed between the "Error point" bold comment:

public void wdDoInit()

{

//@@begin wdDoInit()

InitialContext ctx ;

Object obj;

DestinationService dstService;

Destination destination;

HTTPDestination httpDestination ;

HttpURLConnection httpurlconnection = null;

Properties destprop = null;

String serverName = "";

// Give your web service name

String serviceURL = "/WS_ExampleStockQuote/Config1?style=document";

String prefixURL = "http://";

try

{

ctx = new InitialContext();

obj = ctx.lookup(DestinationService.JNDI_KEY);

dstService = (DestinationService) obj;

// ApplicationServer is HTTP destination name which i added through visual Admin

destination = dstService.getDestination("HTTP","WS_ExampleStockQuote");

destprop = destination.getDestinationProperties();

httpDestination = (HTTPDestination) destination;

serverName = httpDestination.getUrl();

prefixURL = prefixURL + serverName;

}

catch(Exception ex)

{

manager.reportException(ex.getMessage(), false);

}

serviceURL = prefixURL + serviceURL;

// $$begin Service Controller(831926490)

// Error point - Begin

Request_WS_ExampleStockQuoteViDocument_getLista addRequest= new Request_WS_ExampleStockQuoteViDocument_getLista();

// Error point - End

addRequest._setEndPoint(serviceURL);

wdContext.nodeRequest_WS_ExampleStockQuoteViDocument_getLista().bind(addRequest);

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentRequest_WS_ExampleStockQuoteViDocument_getListaElement().modelObject().execute();

wdContext.nodeResponse().invalidate();

Vector v1 = wdContext.nodeResponse().currentResponseElement().getResult();

wdContext.currentContextElement().setS(v1.get(0).toString());

} catch(Exception ce) {

manager.reportException(ce.getMessage(), false);

}

wdContext.currentContextElement().setS(serviceURL);

//@@end

}

________________________________________________________________________

Does anyone know the matter?

Thanks and best regards,

Matteo

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Sep 13, 2008 at 06:27 PM

    Check if the Web service has been deployed propoerly. You may check out the working of the Webservice in wsnavigator.

    Bala

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 13, 2008 at 09:59 PM

    Hi Matteo,

    First, can you check whether you able to access your web service url in browser?

    or

    you can test your webservice from the NWDI Web service perspective, here you can test your web service is correctly functioning or not before using in your Web Dynpro application.

    This document clearly explains How to test the web service url and what is the correct procedure to consume the web service in SAP portal.

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b07992b3-b5af-2a10-9886-affcbeccc4c9

    http://help.sap.com/saphelp_nw70/helpdata/en/f4/1a1041a0f6f16fe10000000a1550b0/content.htm

    Thanks

    Krishna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 13, 2008 at 11:40 PM

    Hi Matteo,

    Instead the way we do that in all another kind of enterprise java application, webservices aren't able to uderstand java.util.Vector, java.util.Array, Collections, etc... they only recognize Complex and Simple Types in WSDL, it means simple objects or simple arrays of objects.

    Check too the parameters at your method signature, they should be the same at the server side.

    Try to verify if at the WebDynPro side the objects that you're manipulating from the server side has the same version (some kind of reflection problem).

    Your application problably is crashing up at this point.

    Vector v1 = wdContext.nodeResponse().currentResponseElement().getResult();

    exactly when you're trying to get back a vector from your WebService Model.

    Even if you test it at your WebServices Navigator, it shows that you have there a fulfiled java.util.Vector object...but to be able to recover data at WebDynPro side, try to make a java.lang.Array of the VO or Object that you're trying to recover.

    It must be something like

    MyOwnVO[] vo = wdContext.nodeResponse().currentResponseElement().getResult();

    At this point your application must not throw an exception about compilation of your WebDynPro application.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 15, 2008 at 04:36 AM

    Hi Matteo,

    First check whether ur webservice is working or not.U can check it by going to the index page of the portal and clicking the link webservices navigator if it is a "Webservice that is written by u and deployed on the J2EE Engine",

    If it is an "External Webservice " u can check it in the Portal perspective ->Window -> open view -> Enterprise poratl webservice checker . A view will be opened at the bottom of the screen.In that give the specified URl for the webservice and u can check it there.

    If the final result is that "Web Service is Working" u can concentrate on ur settings and programming logic.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 16, 2008 at 01:32 PM

    Hello,

    I have tested the webservice in the NWDI Web service perspective and it works fine.

    When I run the WebDynpro application, the system returns the error I have explaned in the previous post.

    The point of error is exactly between the "Error point" bold comment.

    Thanks,

    best regards.

    Matteo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 13, 2008 at 12:36 PM

    Hi Matteo,

    Instead the way we do that in all another kind of enterprise java application, webservices aren't able to uderstand java.util.Vector, java.util.Array, Collections, etc... they only recognize Complex and Simple Types in WSDL, it means simple objects or simple arrays of objects.

    Check too the parameters at your method signature, they should be the same at the server side.

    Try to verify if at the WebDynPro side the objects that you're manipulating from the server side has the same version (some kind of reflection problem).

    Your application problably is crashing up at this point.

    Vector v1 = wdContext.nodeResponse().currentResponseElement().getResult();

    exactly when you're trying to get back a vector from your WebService Model.

    Even if you test it at your WebServices Navigator, it shows that you have there a fulfiled java.util.Vector object...but to be able to recover data at WebDynPro side, try to make a java.lang.Array of the VO or Object that you're trying to recover.

    It must be something like

    MyOwnVO[] vo = wdContext.nodeResponse().currentResponseElement().getResult();

    At this point your application must not throw an exception about compilation of your WebDynPro application.

    Add comment
    10|10000 characters needed characters exceeded