cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy a Web DynPro Application which consumes WebService

Former Member
0 Kudos

Hi all,

I have a Web Service Deployed in Different Machine. This WebService accepts 2 string1,string2 parameters and returns back a String.

I am unable to Deploy Web DynPro Application because I am facing errors like

1. In the RunTime the fields are non editable (string1,string2).

Any Suggestions / Hints are welcome

-Naren

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Naren,

In the Execution Method,Please do add the Following

wdContext.current<Bapi Node>Element().modelObject()._setUser("");

wdContext.currentt<Bapi Node>Element().modelObject()._setPassword("");

Mention the user id ,password(Which u have used to deploy the webservice).

Regards

Nandha.

Message was edited by:

Armin Reichert

former_member751941
Active Contributor
0 Kudos

Hi Narendra,

If fields (srting1,string2) are under Node (0..n or 0..1)

then you have to initialize your node in side "public void wdDoInit()" Method.

For 0..n node use code inside wdDoInit.

wdContext.node<node_name>().addElement(wdContext.create<node_name>Element());

For 0..1 node use code inside wdDoInit.

wdContext.node<node_name>().bind(wdContext.create<node_name>Element());

Other wise you can make the node cardinality to 1..1 or 1..n

Regards,

Mithu

former_member186016
Active Contributor
0 Kudos

The fields taking input for string1 and string2 are be binded to some context attribute which are not initialized.

Initialize them.

Regards,

Ashwani Kr Sharma

Former Member
0 Kudos

When I tried to Add the element in th wdDoInit(), I got the below exception at runtime

The initial exception that caused the request to fail, was:

com.sap.tc.webdynpro.progmodel.context.ContextException: Node(Aug1NewComp.Request_TestMethod): must not add elements to a Node of cardinality 0..1 or 1..1

-Naren

arun_srinivasan
Contributor
0 Kudos

hi

Can the cardinality to 0:n and use this code

public void wdDoInit()

{

//@@begin wdDoInit()

IPrivateView2.IVnElement ele=wdContext.nodeVn().createVnElement();

wdContext.nodeVn().addElement(ele);

//@@end

}

Note: 0:1 and 1:1 will contain maximum of 1 element only

Hope this helps,

Regards,

Arun

Former Member
0 Kudos

type mismatch: cannot convert from IPublicAug1NewComp.IRequest_TestMethodElement to IPrivateAug1NewView.ITestMethodResponseElement

For the following code

IPrivateAug1NewView.ITestMethodResponseElement element = wdContext.nodeRequest_TestMethod().createRequest_TestMethodElement(new Request_TestMethod(model));

wdContext.nodeRequest_TestMethod().addElement(element);

former_member751941
Active Contributor
0 Kudos

Hi Narendra,

Node Cardinality 0..1/1..1 will contain only one element.

Cardinality 1..1 means element is already created by the system.

Don’t create any element for this. inside wdDoInit.

For 0..1. you have to create one element using.

wdContext.node<node_name>().bind(wdContext.create<node_name>Element());

Regards,

Mithu

Former Member
0 Kudos

First , I would really appreciate the time and effort for resloving my issue , But for my bad luck i am still stuck

Let me put down the steps I followed for developing this web dynpro

1) Created a Web dynpro project

2) Created an Application under it, and a component and a view is been associated to it

3) From the data modeler, created a new model, which basically inherits a Adaptive web service

4) From the controller I used apply template, which created a data link to the Controller and model

5) Created a datalink from View to Component controller and mapped the associated fields

6) In the Action tab created a new action "xx"

7) In the Layout of view created a Group UI component and associated all the fields from the context to the Group

😎 Created a button to invoke the action.

9) Under the implementation tab, I called the execute controller's execute method

10) Controller class is fully generated by web dynpro , as I have given apply template (Binding in wdDoInit(), calling

modelObject().execute() method is generated by itself)

11) Once after building, deploying and running I got the screen with non editable fields and on clicking the button I

I got the exception as mentioned below

Exception on execution of web service with WSDL URL 'http://iwdfvm2225:50000/WsTest/Config1?wsdl' with operation 'TestMethod' in interface 'WsTestVi_Document'

12) But Web service works fine and returns proper value, when tested directly.

-Naren

Former Member
0 Kudos

Hi narendra,

Please send the stack trace from the server log file..then only we can find out the exact problem.

regards

Sumit