cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in webservice consuming

Former Member
0 Kudos

Hello Everybody,

I am facing a problem. I have a xMII transaction and exposed as webservice. In java Web Dynpro I have consumed it in two ways.

1. Import Adaptive Web Service Model

2. Import Web Service Model - DEPRECATED

The model which I have created using 2nd one is working properly but the 1st one is not working.

One more query:

When I create the model using 2nd option then with the model it creates a Logical port but the other way it doesn't.

Please help me out.

Thanks and regards,

Pradip

Accepted Solutions (1)

Accepted Solutions (1)

Pramanan
Active Participant
0 Kudos

Hi,

I think this problem is due to accesssing the webservice in a lower version (2004) to the 2004s.so that it is properly working when you import it as depricated.To use it as a Adaptive webservice model you should give the user name and password.

Use the following sample code in the method created in cusotm controller

public void executeRequest_ConcatViDocument_concatmethod( )

{

//@@begin executeRequest_ConcatViDocument_concatmethod()

//$$begin Relate Context Attributes(-1470403384)

wdContext.currentRequest_ConcatViDocument_concatmethodElement().modelObject()._setUser("<username to access webserive in server>");

wdContext.currentRequest_ConcatViDocument_concatmethodElement().modelObject()._setPassword("pwd");

IPrivateConcustm.IConcatinElement concatinElement = wdContext.currentConcatinElement();

IPrivateConcustm.IRequest_ConcatViDocument_concatmethodElement request_ConcatViDocument_concatmethodElement = wdContext.currentRequest_ConcatViDocument_concatmethodElement();

// if ((concatinElement != null) && (request_ConcatViDocument_concatmethodElement != null)) {

request_ConcatViDocument_concatmethodElement.setString1(wdContext.currentConcatinElement().getFststr());

request_ConcatViDocument_concatmethodElement.setString2(wdContext.currentConcatinElement().getSndstr());

// }

//$$end

//$$begin Service Controller(-667725164)

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try

{

wdContext.currentRequest_ConcatViDocument_concatmethodElement().modelObject().execute();

wdContext.nodeRequest_ConcatViDocument_concatmethod_Response().invalidate();

}

catch(Exception e)

{

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

}

//$$end

//$$begin Relate Context Attributes(1565609543)

IPrivateConcustm.IConcatoutElement concatoutElement = wdContext.currentConcatoutElement();

IPrivateConcustm.IRequest_ConcatViDocument_concatmethod_ResponseElement request_ConcatViDocument_concatmethod_ResponseElement = wdContext.currentRequest_ConcatViDocument_concatmethod_ResponseElement();

// if ((concatoutElement != null) && (request_ConcatViDocument_concatmethod_ResponseElement != null)) {

// request_ConcatViDocument_concatmethod_ResponseElement.setResult(concatoutElement.getConstr());

// }

String ccnt=wdContext.currentRequest_ConcatViDocument_concatmethod_ResponseElement().getResult();

wdContext.currentConcatoutElement().setConstr(ccnt);

//$$end

//@@end

}

Former Member
0 Kudos

Hello Ramanan,

There are no methods like _setUser(String), _setPassword(String) in the model object. I think that's specific to your web service. Do you have any generic solution ?

Can anybody with xMII knowledge throw some light on this ?

Regards,

Pradip

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

This problem is resolved and you can get the detail

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40e92be5-5468-2b10-3f87-99ef5731...

Thanks to all of you.