cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro consuming web service doesn't work

Former Member
0 Kudos

Hi guys,

I am trying to call adaptive web service from webdynpro, however I got error <u><i>Exception on execution of web service with WSDL URL 'http://CN65760781:50000/TimeStatusService/Config1?wsdl' with operation 'getTimeStatusBO' in interface 'TimeStatusServiceVi_Document'</i></u>

The web service works if I consume it as non-adaptive web service model, but with the adaptive one, I got above the error. The code to consume the service:

<i>Adaptive_WS_MODEL mod = wdContext.currentRequest_GetTimeStatusBOElement().modelObject().getModelInstance();

GetTimeStatusBO m = new GetTimeStatusBO(mod);

<u><b>m.setEmployeeID("Jayson");</b></u>

Date d = new Date(2007,8,11);

java.sql.Timestamp ts = new java.sql.Timestamp(d.getTime());

m.setWorkingDate(ts);

wdContext.nodeGetTimeStatusBO().bind(m);

wdThis.wdGetWebServiceController().executeRequest_GetTimeStatusBO_adap();</i>

When debugging into the execution method, the except is in fact saying :

<b>Cannot find the required parameter [employeeID] in request message content.</b>

which you can see from above code, it is indeed set to the context element.

I got no clue why this happens. Can any of you help me on this?

p.s, the runtime meta and execution connections are maintained correctly. Web service works.

THanks

Jayson

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi jayson,

Put this code before executing the model.

public void traceWSInvocation( com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClassExecutable requestModel, java.lang.Exception ex )

{

//@@begin traceWSInvocation()

logger.traceThrowableT(

Severity.ERROR,

wdComponentAPI.getApplication().getDeployableObjectPart().getName(),

ex);

//if (logger.beDebug()) {

logger.fatalT(requestModel.wdGetRequestLog());

logger.fatalT(requestModel.wdGetResponseLog());

logger.fatalT(requestModel.associatedModelClassInfo().getModelInfo().toString());

logger.fatalT(requestModel.toString());

//}

//@@end

}

For Request model put this code

reqModel.wdSetInvocationLogEnabled(true);

In catch block : traceWSInvocation(reqModel,e);

Then check in the log,what exactly is getting passed to webservice. The error "Cannot find the required parameter [employeeID] in request message content." shows that employeeId is not getting passed properly in request model.

Apart from that it seems u r writing this code in view,its always better to do this in controller.

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

in the log I can't see much. following is hte log I copied from NWA, not much I can understand. Yes, the call is made in hte view, this is only a prototype (which doesn't respect the program guideline) to make sure adaptive WS works with WD, only if works, our real project will go this way. But I'm stucking in it now. Your help is appreciated.

Jayson

<ModelInfo name="http://CN65760781:50000/TimeStatusService/Config1?wsdl$DEFAULT_WS_METADATA_DEST$TimeStatusServiceVi_Document$null" metadataChangesAllowed="false" creationStart="Fri Sep 28 09:56:24 EDT 2007" creationEnd="Fri Sep 28 09:56:29 EDT 2007"><ModelClassInfo name="ArrayOfTimeDistributionModel" structureType="null" qName="ArrayOfTimeDistributionModel"><RelationInfo name="ArrayOfTimeDistributionModel_TimeDistributionModel.TimeDistributionModel"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="TimeDistributionModel" cardinality="0..n" navigable="true" readOnly="false" aggregation="false" qName="TimeDistributionModel"/></RelationInfo></ModelClassInfo><ModelClassInfo name="Response_CreateTimeStatus" structureType="null" qName="Response_createTimeStatus"><RelationInfo name="Response_CreateTimeStatus_CreateTimeStatusResponse.createTimeStatusResponse"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="CreateTimeStatusResponse" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="createTimeStatusResponse"/></RelationInfo><RelationInfo name="Response_CreateTimeStatus_TES_Exception.errorPart"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="ErrorPart" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="errorPart"/></RelationInfo></ModelClassInfo><ModelClassInfo name="GetTimeStatusBOResponse" structureType="null" qName="/wsdl:definitions/wsdl:types/xs:schema[3]/xs:element[4]/xs:complexType"><RelationInfo name="GetTimeStatusBOResponse_TimeStatusBO.Response"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="Response" cardinality="1" navigable="true" readOnly="false" aggregation="false" qName="Response"/></RelationInfo></ModelClassInfo><ModelClassInfo name="Response_GetTimeStatusBO" structureType="null" qName="Response_getTimeStatusBO"><RelationInfo name="Response_GetTimeStatusBO_GetTimeStatusBOResponse.getTimeStatusBOResponse"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="GetTimeStatusBOResponse" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="getTimeStatusBOResponse"/></RelationInfo><RelationInfo name="Response_GetTimeStatusBO_TES_Exception.errorPart"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="ErrorPart" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="errorPart"/></RelationInfo></ModelClassInfo><ModelClassInfo name="TES_Exception" structureType="null" qName="TES_Exception"></ModelClassInfo><ModelClassInfo name="CreateTimeStatusResponse" structureType="null" qName="/wsdl:definitions/wsdl:types/xs:schema[3]/xs:element[2]/xs:complexType"><RelationInfo name="CreateTimeStatusResponse_TimeStatusModel.Response"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="Response" cardinality="1" navigable="true" readOnly="false" aggregation="false" qName="Response"/></RelationInfo></ModelClassInfo><ModelClassInfo name="TimeStatusBO" structureType="null" qName="TimeStatusBO"><ModelClassPropertyInfo name="Status" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="status" required="false" backendType="null"/><ModelClassPropertyInfo name="EmployeeID" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="employeeID" required="false" backendType="null"/><ModelClassPropertyInfo name="WorkingDate" dataType="com.sap.tc.webdynpro.model.webservice.types.dateTime(java.sql.Timestamp)" readOnly="false" qName="workingDate" required="false" backendType="null"/><RelationInfo name="TimeStatusBO_ArrayOfTimeDistributionModel.distributions"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="Distributions" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="distributions"/></RelationInfo></ModelClassInfo><ModelClassInfo name="TimeStatusModel" structureType="null" qName="TimeStatusModel"><ModelClassPropertyInfo name="Status" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="status" required="false" backendType="null"/><ModelClassPropertyInfo name="EmployeeID" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="employeeID" required="false" backendType="null"/><ModelClassPropertyInfo name="WorkingDate" dataType="com.sap.tc.webdynpro.model.webservice.types.dateTime(java.sql.Timestamp)" readOnly="false" qName="workingDate" required="false" backendType="null"/></ModelClassInfo><ModelClassInfo name="Request_CreateTimeStatus" structureType="null" qName="Request_createTimeStatus" interfaceQName="TimeStatusServiceVi_Document" operation="createTimeStatus"><RelationInfo name="Request_CreateTimeStatus_CreateTimeStatus.createTimeStatus"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="CreateTimeStatus" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="createTimeStatus"/></RelationInfo><RelationInfo name="Request_CreateTimeStatus_Response_CreateTimeStatus.Response"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="Response" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="Response"/></RelationInfo></ModelClassInfo><ModelClassInfo name="TimeDistributionModel" structureType="null" qName="TimeDistributionModel"><ModelClassPropertyInfo name="OrderNo" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="orderNo" required="false" backendType="null"/><ModelClassPropertyInfo name="Activity" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="activity" required="false" backendType="null"/><ModelClassPropertyInfo name="EmployeeID" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="employeeID" required="false" backendType="null"/><ModelClassPropertyInfo name="WorkingDate" dataType="com.sap.tc.webdynpro.model.webservice.types.dateTime(java.sql.Timestamp)" readOnly="false" qName="workingDate" required="false" backendType="null"/><ModelClassPropertyInfo name="Hours" dataType="com.sap.tc.webdynpro.model.webservice.types.int(int)" readOnly="false" qName="hours" required="false" backendType="null"/><ModelClassPropertyInfo name="OriginatingOrgCode" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="originatingOrgCode" required="false" backendType="null"/><ModelClassPropertyInfo name="ReceivingOrgCode" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="receivingOrgCode" required="false" backendType="null"/><ModelClassPropertyInfo name="Location" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="location" required="false" backendType="null"/></ModelClassInfo><ModelClassInfo name="Request_GetTimeStatusBO" structureType="null" qName="Request_getTimeStatusBO" interfaceQName="TimeStatusServiceVi_Document" operation="getTimeStatusBO"><RelationInfo name="Request_GetTimeStatusBO_GetTimeStatusBO.getTimeStatusBO"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="GetTimeStatusBO" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="getTimeStatusBO"/></RelationInfo><RelationInfo name="Request_GetTimeStatusBO_Response_GetTimeStatusBO.Response"><RelationRoleInfo name="Source" cardinality="1" navigable="false" readOnly="true" aggregation="false" qName="source"/><RelationRoleInfo name="Response" cardinality="0..1" navigable="true" readOnly="false" aggregation="false" qName="Response"/></RelationInfo></ModelClassInfo><ModelClassInfo name="CreateTimeStatus" structureType="null" qName="/wsdl:definitions/wsdl:types/xs:schema[3]/xs:element[1]/xs:complexType"><ModelClassPropertyInfo name="Status" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="status" required="true" backendType="null"/><ModelClassPropertyInfo name="EmployeeID" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="employeeID" required="true" backendType="null"/><ModelClassPropertyInfo name="WorkingDate" dataType="com.sap.tc.webdynpro.model.webservice.types.dateTime(java.sql.Timestamp)" readOnly="false" qName="workingDate" required="true" backendType="null"/></ModelClassInfo><ModelClassInfo name="GetTimeStatusBO" structureType="null" qName="/wsdl:definitions/wsdl:types/xs:schema[3]/xs:element[3]/xs:complexType"><ModelClassPropertyInfo name="EmployeeID" dataType="com.sap.tc.webdynpro.model.webservice.types.string(java.lang.String)" readOnly="false" qName="employeeID" required="true" backendType="null"/><ModelClassPropertyInfo name="WorkingDate" dataType="com.sap.tc.webdynpro.model.webservice.types.dateTime(java.sql.Timestamp)" readOnly="false" qName="workingDate" required="true" backendType="null"/></ModelClassInfo></ModelInfo>

Former Member
0 Kudos

Hi,

The problem looks like the Webdynpro is not recognising the Model Parameter EmployeeID.

For this you should reimport the model once again and restart the Server. This might help you.Try doing it.

-np