cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Executing Model using WSDL imported from the Service Registry

Former Member
0 Kudos

Hi All,

I have imported the following WSDL from the HU2 System in my WebDynpro project.

http://erp.esworkplace.sap.com/sap/bc/srt/xip/sap/ecc_customeraddressbasicdataqr/version2?sap-client...

when iam trying to import the WSDL without creating logical destinations in my webDynpro application, it is showing the following exception. Iam working in CE 7.1 Ehp1

com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized. The requested URL was:"http://erp.esworkplace.sap.com/sap/bc/srt/xip/sap/ecc_customeraddressbasicdataqr/version2?sap-client=800&wsdl=1.1&mode=sap_wsdl"

i set the invocation parameters to the model using the below code.

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "");

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "");

Regards,

Gayathri

Edited by: gayathri kavi on Jun 29, 2009 12:07 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Gayathri,

I think this the problem with j2ee engine credentials...

can u pls check once if u still getting the errors... then check the sap as java option in windows->preferences...

regards,

viswa

Former Member
0 Kudos

Hi,

Check if this below code works:

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject()._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "");

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject()._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "");

/message/363021#363021 [original link is broken]

http://help.sap.com/saphelp_nw04/helpdata/en/ab/08194116bfb167e10000000a155106/frameset.htm

/message/721859#721859 [original link is broken]

/message/645853#645853 [original link is broken]

http://help.sap.com/saphelp_nw04/helpdata/en/04/d2c60e78814516afe7811829f02725/content.htm

And before this check if the webservice authentical is correct or not using any webservice client like WebService navigator or XML Spy or Enterprise Portal Webservice checker of (Go to the Enterprise portal perspective in NWDS) NWDS.

Regards,

Charan

Former Member
0 Kudos

Hi,

Check the wsdl file in the webservice navigator...

Go to WS Navigator (http://host:port/wsnavigator).

Copy the WSDL URL in the input box and click 'Next'.

Enter the input parameters and click 'Next'.

Give the correct credentials and press submit..

Check if the result is returned correctly or if some error messages were supplied by the back end..

If there is some error message then check with your backend team ....

Hope this helps you..

Regards,

Saleem

Former Member
0 Kudos

the webservice is working perfectly. It is not displaying any error message in the ouput parameters.

Former Member
0 Kudos

Hi,

You mean to say WebService is working in Webservice client and it is not working from WebDynpro and giving authentication error?

Regards,

Charan

Former Member
0 Kudos

Hi,

Yes it is working in the webservice navigator. in my webdynpro appliction i used the below code to set the authentiction.

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "");

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "");

where username and password is the same i have given in the Webservice navigtor to access the webservice.

Iam not using any logical destinations or service group while creating the model.

Regards,

Gayathri.

Former Member
0 Kudos

Hi,

Can you just check wether your browser HTTP proxy settings and webdynpro application proxy settings are same or not...

Make sure the proxy setting used in browser and webdynpro are same..

This also might cause the problem.

Just go through this [thread|; once..

Regards,

Saleem

Edited by: Saleem Baig Mohammed on Jun 29, 2009 10:07 AM

Edited by: Saleem Baig Mohammed on Jun 29, 2009 10:08 AM

Edited by: Saleem Baig Mohammed on Jun 29, 2009 10:09 AM

Former Member
0 Kudos

Hi,

Just for confimation: You wrote this code before modelobject.execute line of code right? Because this is the way and this should work. And if possible can you post the code?

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "");

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "");

Regards,

Charan

Former Member
0 Kudos

Hi Charan,

This is the code iam using to execute the model

try {

wdComponentAPI.getMessageManager().reportSuccess(

"customerName" + customerName);

SalesOrderModel salesOrderTrckingModel = new SalesOrderModel();

Request_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_In request_customerBasicData = new Request_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_In(

salesOrderTrckingModel);

CustomerERPAddressBasicDataByNameAndAddressQueryResponse_In customerBasicData = new CustomerERPAddressBasicDataByNameAndAddressQueryResponse_In(

salesOrderTrckingModel);

Request_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InCusParameters parameters = new Request_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InCusParameters(

salesOrderTrckingModel);

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_Sync customerBasicDataQuery_Sync = new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_Sync(

salesOrderTrckingModel);

CustomerSelectionByNameAndAddress customerSelection = new CustomerSelectionByNameAndAddress(

salesOrderTrckingModel);

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusCommon common = new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusCommon(

salesOrderTrckingModel);

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusComName name = new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusComName(

salesOrderTrckingModel);

//CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncProcessingConditions customerQueryProcessingConditions = new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncProcessingConditions(

// salesOrderTrckingModel);

//CustomerID customerID = new CustomerID(salesOrderTrckingModel);

wdComponentAPI.getMessageManager().reportSuccess("Created Classes");

//Address Information

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusAddressInformation addressInfo =

new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusAddressInformation(salesOrderTrckingModel);

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusAddAddress address =

new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusAddAddress(salesOrderTrckingModel);

//Physical Address

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusAddAddPhysicalAddress physicalAddress =

new CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncCusAddAddPhysicalAddress(salesOrderTrckingModel);

RegionCode regionCode = new RegionCode(salesOrderTrckingModel);

//TaxJurisdictionCode

TaxJurisdictionCode tax = new TaxJurisdictionCode(salesOrderTrckingModel);

physicalAddress.setRegionCode(regionCode);

address.setPhysicalAddress(physicalAddress);

address.setTaxJurisdictionCode(tax);

addressInfo.setAddress(address);

//Processing Conditions

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncProcessingConditions processingConditions = new

CustomerERPAddressBasicDataByNameAndAddressQueryMessage_SyncProcessingConditions(salesOrderTrckingModel);

CustomerID customerId = new CustomerID(salesOrderTrckingModel);

processingConditions.setLastProvidedCustomerID(customerId);

customerBasicDataQuery_Sync.setProcessingConditions(processingConditions);

//customerQueryProcessingConditions

// .setLastProvidedCustomerID(customerID);

name.setFirstLineName(customerName);

common.setName(name);

customerSelection.setCommon(common);

customerSelection.setAddressInformation(addressInfo);

customerBasicDataQuery_Sync

.setCustomerSelectionByNameAndAddress(customerSelection);

//customerBasicDataQuery_Sync

// .setProcessingConditions(customerQueryProcessingConditions);

parameters

.setCustomerERPAddressBasicDataByNameAndAddressQuery_Sync(customerBasicDataQuery_Sync);

customerBasicData.setParameters(parameters);

request_customerBasicData

.setCustomerERPAddressBasicDataByNameAndAddressQueryResponse_In(customerBasicData);

wdContext

.nodeRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_In()

.bind(request_customerBasicData);

wdComponentAPI.getMessageManager().reportSuccess("Before Execute method");

//wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty("User Name","S0003615005");

//wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty("Password","Welcome123");

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "username of Hu2 system");

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "password of Hu2 System");

wdContext

.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement()

.modelObject().execute();

wdContext.nodeResponse().invalidate();

ICustomerDetailsElement customerDetails = wdContext

.createCustomerDetailsElement();

IName_1Element name2 = wdContext.currentName_1Element();

IIDElement idElement = wdContext.currentIDElement();

wdComponentAPI.getMessageManager().reportSuccess(

"First Name = " + name2.getFirstLineName());

customerDetails.setCustomerName(name2.getFirstLineName());

customerDetails.setCustomerID(idElement.get$0023SimpleContent());

ICustomerDetailsNode customerDetailsNode = wdContext

.nodeCustomerDetails();

customerDetailsNode.addElement(customerDetails);

} catch (WDWSModelExecuteException wdwsmee) {

wdComponentAPI.getMessageManager().reportSuccess(

"Throws Model Execute Exception" + wdwsmee);

}

Regards,

Gayathri.

Former Member
0 Kudos

Hi,

Exctly you are setting as below right? Becuase in the code you have commented some lines of code (I hope that is for posting here..)


wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, "S------------5"); 

wdContext.currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, "W-----------3"); 

wdContext .currentRequest_CustomerERPAddressBasicDataByNameAndAddressQueryResponse_InElement() .modelObject().execute();

wdContext.nodeResponse().invalidate();

And in catch block pls print get cause also as below:

wdComponentAPI.getMessageManager().reportSuccess( "Model Execute Exception cause: " + wdwsmee.getCause()):

Regards,

Charan

former_member192434
Active Contributor
0 Kudos

Hi

ITs look like the cause of exceptions is an authentication problem for calling the Web Service:

check this for Trouble Shooting

https://wiki.sdn.sap.com/wiki/display/BPMT/Ihaveaproblemwithexecutingaserviceoutofmy+process

thanks