IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Set serviceName for calling service

webMethods Community Member

webMethods Community MemberWed January 06, 2016 03:01 PM

  • 1.  Set serviceName for calling service

    Posted Wed January 06, 2016 07:19 AM

    I am new in creating java services in webMethods.

    Can someone let me know on how can I pass a list of service Names and change the properties of those services using java services?

    Thanks in advance.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Set serviceName for calling service

    Posted Wed January 06, 2016 07:59 AM

    Do you mean changing the flow service properties like stateless, cache results etc…?

    If yes, use the service wm.server.services:serviceInfoSet at your own risk.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Set serviceName for calling service

    Posted Wed January 06, 2016 11:29 AM

    Hey Satya ,

    Here is sample code which you can make use of , you need to customize it according to your requirement.

    public static final void getAuditPropertyPerService(IData pipeline)
    throws ServiceException {
    IDataCursor pipelineCursor = pipeline.getCursor();
    String serviceName = IDataUtil.getString( pipelineCursor, "serviceName");
    
    
    NSName localNSName=NSName.create(serviceName);
    NSService localNSService=Namespace.current().getService(localNSName);
    
    int auditEnable=localNSService.getAuditOption(); //Give the audit enable property value
    
    AuditSettings as; 
    as=localNSService.getAuditSettings();  // to get the logOn and Include Pipeline property of the audit property
    
    IData asData = IDataFactory.create();
    
    asData=as.getAsData();
    
    
    
    // pipeline
    IDataCursor pipelineCursor_1 = pipeline.getCursor();
    IDataUtil.put( pipelineCursor_1, "asData", asData );
    pipelineCursor_1.destroy();
    
    
    }

    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: Set serviceName for calling service

    Posted Wed January 06, 2016 01:20 PM

    Thanks Rakesh.

    But ,debugging the java service returns null in this step

    NSService localNSService=Namespace.current().getService(localNSName);


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: Set serviceName for calling service

    Posted Wed January 06, 2016 02:21 PM

    Hi Sathya ,

    Have you added all the import statements in the code , if not please add all the import statements mentioned below :-

    import com.wm.data.*;
    import com.wm.util.Values;
    import com.wm.app.b2b.server.Service;
    import com.wm.app.b2b.server.ServiceException;
    import com.wm.app.b2b.server.ns.Namespace;
    import com.wm.lang.ns.AuditSettings;
    import com.wm.lang.ns.NSService;
    import com.wm.lang.ns.NSName;


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: Set serviceName for calling service



  • 7.  RE: Set serviceName for calling service

    Posted Wed January 06, 2016 03:05 PM

    Hi Rakesh and Mahesh,

    Thanks you.

    I am able to set the property

    But the issue now is the flow.xml of the services are getting corrupted when I reloaded the packages of the service which I have updated.

    Any suggestion to get back the services.

    Thanks,
    Sathyaraj


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: Set serviceName for calling service

    Posted Thu January 07, 2016 07:11 AM

    Hi Sathya,

    is there a flow.xml.bak available for the services affected?

    If yes, you can replace the corrupted flow.xml with the bak-file and reload the package.
    Hopefully it will not get corrupted again.

    Can provide a sample of the correct and corrupted flow.xml for one of the services you have tested?

    Sounds like strange behaviour anyway.

    Regards,
    Holger


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Set serviceName for calling service

    Posted Thu January 07, 2016 07:24 AM

    Hi Holger,

    Thanks for your inputs.

    I services and the java code which got corrupted are the one created under a test folder in Default package.

    I created them in a custom package and I don’t the issue now .

    PFA the requested files

    flow.xml (84 Bytes)
    flow_bak.xml (84 Bytes)


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: Set serviceName for calling service

    Posted Thu January 07, 2016 07:28 AM

    Replacing the flow.xml with flow.xml.bak worked .

    Thanks :slight_smile:


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 11.  RE: Set serviceName for calling service

    Posted Fri January 08, 2016 07:59 AM

    Hi Satya,

    As the both files are identical I am not sure what happend exactly to make the flow.xml corrupt.

    Regards,
    Holger


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 12.  RE: Set serviceName for calling service

    Posted Mon January 11, 2016 08:51 AM

    Hi Sathya ,

    The flow service is not corrupted , you have to reload the package to see it in package navigator.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 13.  RE: Set serviceName for calling service

    Posted Mon January 11, 2016 03:51 PM

    Yes reload of restart the server some times these kind of will resolve:)

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services