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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Check via code if a service input is a document

    Posted 08/03/22 08:36 AM

    Hi everyone!

    What product do you use and which version?

    I’m using the webMethods Designer version 10.11

    What are trying to achieve?

    I’m creating a code reviewer and one of the features I’m trying to implement is checking the service’s input type (EG: String, Document, etc.). I tried to use wm.server.services:serviceInfo, but it doesn’t have any information about the service input. Is there any functionality that could return this information to me?
    I would also like to know if there is a service that provides information about fields inside a document or adapter.

    Thanks in advance for the replies, have a nice day!


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


  • 2.  RE: Check via code if a service input is a document

    Posted 08/04/22 10:10 PM

    Hi

    This can be achieved using Java snipped below.

    NSName nsSvc = NSName.create(serviceName);
    BaseService baseService = Namespace.getService(nsSvc);
    NSSignature sig = baseService.getSignature();
    for(NSField nsField: sig.getInput().getFields()){
    if(nsField.getRecordTypeString().equals("IData")){
    // this would be your block for document field
    }
    }
    

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


  • 3.  RE: Check via code if a service input is a document

    Posted 08/05/22 12:15 PM

    We use these classes/methods too, for other purposes. They are very useful.

    Just be aware that this uses classes that are not intended to be used by customers. If there are issues or you have problems, you’re on your own.


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


  • 4.  RE: Check via code if a service input is a document

    Posted 08/09/22 01:49 PM

    Hi Prathipati

    During the implementation of the java code, we came across the error shown in the screenshot. Apparently, the getService method doesn’t exist in the imported class. Would it be possible to use another method or class?


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


  • 5.  RE: Check via code if a service input is a document

    Posted 08/09/22 02:08 PM

    @Joao_Guilherme_Raminelli , please make sure that you use Namespace from com.wm.app.b2b.server.ns package.

    Regards,
    -Kalpesh


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


  • 6.  RE: Check via code if a service input is a document

    Posted 08/19/22 01:41 PM

    Thanks a lot for the answers guys! Take care!


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