Skip to Content

Consume the ManageSiteLogisticsTaskIn Webservice in SAP ByD

Hi Experts

We need to consume the web service to update the site logistics task (warehouse task) by the A2X service.

I have created the external ExternalWebServiceIntegration.wsid to consume the ManageSiteLogisticsTaskIn Webserive.

This is working fine in SOAP UI.

While consume the service I have a problem that values are not update(going) correctly.

Please check my code and correct me what is wrong in this.

import ABSL;

foreach (var ins in this)

{

var ManageSiteWHTask : Library::ManageSiteWarehouseTask.MaintainBundle_V1.Request;

var eleSitetask : Library::ManageSiteWarehouseTask.MaintainBundle_V1.Request.SiteLogisticsTaskBundleMaintainRequest_sync_V1;

var elementSiteWHTask : Library::ManageSiteWarehouseTask.MaintainBundle_V1.Request.SiteLogisticsTaskBundleMaintainRequest_sync_V1.SiteLogisticsTask;

var eleReferenceObject : Library::ManageSiteWarehouseTask.MaintainBundle_V1.Request.SiteLogisticsTaskBundleMaintainRequest_sync_V1.SiteLogisticsTask.ReferenceObject;

var eleOperationActivity : Library::ManageSiteWarehouseTask.MaintainBundle_V1.Request.SiteLogisticsTaskBundleMaintainRequest_sync_V1.SiteLogisticsTask.ReferenceObject.OperationActivity;

var elementMaterialOutput : Library::ManageSiteWarehouseTask.MaintainBundle_V1.Request.SiteLogisticsTaskBundleMaintainRequest_sync_V1.SiteLogisticsTask.ReferenceObject.OperationActivity.MaterialOutput;

// basic header hardcoded

// Static Values

eleSitetask.BasicMessageHeader.ID.content = "Token 4";

eleSitetask.BasicMessageHeader.ID.schemeAgencyID = "Token 2";

eleSitetask.BasicMessageHeader.ID.schemeAgencySchemeAgencyID = "Tok";

eleSitetask.BasicMessageHeader.ID.schemeID = "Token 1";

eleSitetask.BasicMessageHeader.UUID.schemeID = "Token 5";

eleSitetask.BasicMessageHeader.UUID.schemeAgencyID = "Token 6";

eleSitetask.BasicMessageHeader.UUID.content = "1234567890ABCDEF0123456789ABCDEF";

eleSitetask.BasicMessageHeader.ReferenceID.schemeID = "Token 7";

eleSitetask.BasicMessageHeader.ReferenceID.schemeAgencyID = "Token 8";

eleSitetask.BasicMessageHeader.ReferenceID.schemeAgencySchemeAgencyID = "Token 9";

eleSitetask.BasicMessageHeader.ReferenceID.content = "Token 10";

eleSitetask.BasicMessageHeader.ReferenceUUID.schemeID = "Token 11";

eleSitetask.BasicMessageHeader.ReferenceUUID.schemeAgencyID = "Token 12";

eleSitetask.BasicMessageHeader.ReferenceUUID.content = "1234567890ABCDEF0123456789ABCDEF";

// from my custom BO updating the valeus (UUID's)

// Site Logistic Task ID

elementSiteWHTask.SiteLogisticTaskID.content = ins.ID.content.RemoveLeadingZeros();

//Site Logistic Task UUID

elementSiteWHTask.SiteLogisticTaskUUID.content = ins.SiteLogisticTaskUUID.content.ToString();

//Reference Object UUID

eleReferenceObject.ReferenceObjectUUID.content = ins.ReferenceObjectUUID.content.ToString();

// Operation Activity UUID

eleOperationActivity.OperationActivityUUID.content = ins.OperationActivityUUID.content.ToString();

// Output values from my custom note

foreach (var materialoutput in ins.lineItem)

{

elementMaterialOutput.ProductID.content = materialoutput.Product.content.RemoveLeadingZeros();

elementMaterialOutput.ActualQuantity.content = materialoutput.OpenQuantity.content;

elementMaterialOutput.ActualQuantity.unitCode = materialoutput.OpenQuantity.unitCode;

elementMaterialOutput.MaterialOutputUUID.content = materialoutput.MaterialOutputUUID.content.ToString();

}

eleSitetask.SiteLogisticsTask.Add(elementSiteWHTask);

// upto here no issue

// from this code values are not updated properly

eleSitetask.SiteLogisticsTask.GetFirst().ReferenceObject.Add(eleReferenceObject);

eleSitetask.SiteLogisticsTask.GetFirst().ReferenceObject.GetFirst().OperationActivity.Add(eleOperationActivity);

eleSitetask.SiteLogisticsTask.GetFirst().ReferenceObject.GetFirst().OperationActivity.GetFirst().MaterialOutput.Add(elementMaterialOutput);

ManageSiteWHTask.SiteLogisticsTaskBundleMaintainRequest_sync_V1 = eleSitetask;

var ManageResponseObject = Library::ManageSiteWarehouseTask.MaintainBundle_V1(ManageSiteWHTask, "", "MainSiteWarehouseTask");

}




Regards

Rudhra

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Jul 12, 2016 at 09:42 AM

    Hi Experts

    anyone can help on this ?

    Regards

    Rudhra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Rudhra Udayakumar

      Hello Rudhra,

      Following code is problamatic. It is not in order.

      "eleSitetask.SiteLogisticsTask.GetFirst().ReferenceObject.Add(eleReferenceObject);

      eleSitetask.SiteLogisticsTask.GetFirst().ReferenceObject.GetFirst().OperationActivity.Add(eleOperationActivity);

      eleSitetask.SiteLogisticsTask.GetFirst().ReferenceObject.GetFirst().OperationActivity.GetFirst().MaterialOutput.Add(elementMaterialOutput);

      ManageSiteWHTask.SiteLogisticsTaskBundleMaintainRequest_sync_V1 = eleSitetask;"

      If the child not cardinality is 0:n then Add() function should be written in the for loop where you are assigning the values to the element of that node. So this means create the stucture step by step, not in the end directly. So when you are passing/assigning the values to the node, use create operations at the point of time.


      It is not possible for me to re-write all the code, but let me know if it is helping you to solve your problem.

      REgards,

      Saurabh