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.

 View Only
Expand all | Collapse all

Detecting host Name or IP in flow service

  • 1.  Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:26 PM

    I am developing a general purpose error notification routine.
    The email address and the mailhost ip will be different between Dev and prod. Is there a way to detect which server I’m running on within a flow service or does anyone have a Java service that will do this.

    Thanks.

    Chris


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


  • 2.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:36 PM

    Can I suggest that you use configuration files? It might make your deployment simpler and easier to maintain.

    However, here is a simple, hard-coded version that does employ configuration files.

    1. Create a server variable named watt.server.environment and assign it the value of “dev” or “prd”, depending on your environment. []Create a Java service that invokes System.getProperty(“watt.server.environment”) and returns the string variable. This variable is your environment (i.e. “dev”, “prd”) []BRANCH on the returned string to assign an email address and mailhost IP.

    As noted above, this approach is using hard-coding variables. If you can use configuration files to store the email address and mailhost IP, you will be building a more flexible solution.


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


  • 3.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:40 PM

    Dan,

    Thanks for the speedy reply.
    I haven’t used config files. Which manual do I research in?
    Thanks.

    Chris


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


  • 4.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:41 PM

    And if you want to get the name of the configured mailhost and the email address you can create a java service that reads the values of the properties :

    watt.server.smtpServer
    watt.server.serviceMail


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


  • 5.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:42 PM

    And if all that you want is to get the name of the IS server then you can use the service

    wm.server.admin:getServerHost


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


  • 6.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:46 PM

    Nice pick up, Rupinder! Funny how I missed the obvious play on that one.

    Regarding environment-independent configuration files, Chris – I will write a webMethods Ezine article about the process and will include sample code for download. Our November ezine line-up is already full, so expect to see it in the December issue.


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


  • 7.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 04:50 PM

    Dan,

    I’ll look forward to the ezine article but in the meantime is there a wm doc that I can read on the properties of the configuration files and how to use them.

    Chris


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


  • 8.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 05:30 PM

    Rupinder,

    I do not have wm.server.admin:getServerHost in my system.
    I’m running IS 4.6.
    I have searched all the packages.

    Chris


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


  • 9.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 05:35 PM

    Hi, Chris. I am not sure if there is any manual discussing configuration files. The IS Developer Guide talks a little bit about using server.cnf for managing properties, but that solution can be limiting.

    You should be okay with Rupinder’s solution(s). In effect, using the Settings > Extended feature of the Administrator is the same as setting the variables in server.cnf but with more control – your webMethods administrators can change the properties at any time for any environment.


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


  • 10.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 05:56 PM

    Chris,
    why don’t you use watt.server.port property combined with InetAddress.getLocalHost().getHostAddress()
    to determine “dev” or “prd” and then accordingly set the mailhost and email params.

    Additionally, you can use combination of System.getProperty and Extended settings to set the env-specific params.
    or use set of java property files. options are limitless.

    HTH,
    Saurabh.


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


  • 11.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 05:59 PM

    Is there some property setting, that would put the timestamp in the server.log file.
    The setting watt.server.dateStampFmt seems to affect only the error.log file.


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


  • 12.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 06:03 PM

    The wm.server.admin:getServerHost service is there, it’s just hidden inside the WmRoot package.

    To make the WmRoot package browsable in Developer, go to Adminstrator and select Settings > Extended > Edit Extended Settings. Add “watt.server.ns.hideWmRoot=False” to the extended settings and select “Save Changes”.

    Refresh your Developer and you will be able to browse the WmRoot package for wm.server.admin:getServerHost.


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


  • 13.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 06:26 PM

    Dan,

    You’re a life saver!
    How would one know about this? Is this buried somewhere in the endless number of pdf files?

    Thanks again to all.

    Chris


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


  • 14.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 07:01 PM

    Happy to share.

    No, that tip is not documented anywhere except for on these Discussion Forums.

    I think we need to add a new feature to the webMethods User Community – “Things Every Developer Needs To Know (But Didn’t Know To Ask)”.


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


  • 15.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 07:31 PM

    The reason wmroot is hidden, and the flag isn’t documented, is that wm doesn’t want you using/messing with anything in there. It’s unlikely that any services would change but be aware that doing anything with wmroot in your services is unsupported and could be broken by future releases.


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


  • 16.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 07:42 PM

    We use a slightly diffent method.
    A Java Service is called from flow and hostName is populated. We then Branch on hostName
    // pipeline
    String hostName = “unknown”;

    hostName = ServerAPI.getServerName();

    // pipeline
    IDataHashCursor pipelineCursor = pipeline.getHashCursor();
    pipelineCursor.last();
    pipelineCursor.insertAfter( “hostName”, hostName );
    pipelineCursor.destroy();


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


  • 17.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 09:04 PM

    For situations where we have values that change per environment and which can’t be obtained via webMethods services, we use a resource bundle which is located in one of our packages. This bundle is modified during our automated builds depending on the environment. So our flow service loads a value via this bundle and it is configured correctly beforehand.

    I think the extended properties idea is interesting as well.


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


  • 18.  RE: Detecting host Name or IP in flow service

    Posted Wed October 09, 2002 09:17 PM

    Hi Will,
    can you explain this resource bundle usuage ??

    Sounds like you have different resource bundles for different env’s. How do you edit these resource bundles - manually or did you write a utility for it??

    And, how does the build scripts know which bundle to pick for a particular env?

    Additional details will help us understand this concept of using resource bundles instead of java property files?? What are the other benefits of it?

    Thanks in advance,
    Saurabh.


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


  • 19.  RE: Detecting host Name or IP in flow service

    Posted Thu October 10, 2002 04:45 PM

    Hi Saurabh,

    We used a resource bundle to handle the possibility that we may have locale-specific values in the bundle (like error messages in different languages perhaps). If you are just storing server configurations a property file will work fine. In both cases you would have something like this:

    my.property=@envSpecificProperty@

    When the build script runs it replaces @envSpecificProperty@ with the proper value. We just use one bundle, but this bundle is altered during the build script run. We could run our build script at a command line that goes something like this:

    bld --ENV=qa

    So within the shell script, it knows which environment it is building. The environment specific values are in this shell script. Although we use the same bundle, this bundle will be in a different location since we have multiple instances of IS installed - so the directory structure has this environment in it like - /opt/wm/qa or /opt/wm/rc. Here’s an example of what the script is doing.

    elif [[ $ENV = qa ]]; then
    envSpecificProperty=“qa.myhost.com

    You can use ant to do this as well as do the search and replacing of the bundle. The script could load the values for the different environments from one file containing values for all environments.

    As I describe this I’m starting to think that the extended property settings would be much easier! Since you have to store the values you want somewhere, why not within the server instance itself! One argument could be to have all the values in one location instead of having to go to each server to make changes.


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


  • 20.  RE: Detecting host Name or IP in flow service

    Posted Fri December 13, 2002 05:03 PM

    Dan,

    I noticed when I tried to add a custom property to this file that I don’t see the entry. Instead there’s a line like:
    watt.server.extendedSettingsList=do.hub.url;

    This could be confusing for administrator’s - any idea how this works, where the value is stored, etc?

    Thanks


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


  • 21.  RE: Detecting host Name or IP in flow service

    Posted Fri December 13, 2002 09:45 PM

    Hi, Will. If you look closer at your server.cnf file, you’ll see that the values in the semi-colon delimited list for watt.server.extendedSettingsList are each listed a property names themselves in the same document.

    Do a search for “do.hub.url” and you will see that the string occurs twice in your server.cnf – once in the watt.server.extendedSettingsList value and once as its own property.


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


  • 22.  RE: Detecting host Name or IP in flow service

    Posted Fri December 13, 2002 09:51 PM

    I just did a search and only that one came up. My java service is returning null when I query for it too.


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


  • 23.  RE: Detecting host Name or IP in flow service

    Posted Fri October 17, 2003 03:27 PM

    I’ve been working with webMethods on communication via AS2 and EDIINT.
    I have AS1 working, but I just can’t get our customers the ability to send data via the internet over an http or https port on our machine. I’m not sure if this is a firewall issue or certificate issue, I’ve received the following message from one of our customer when trying to invoke a service.

    Messages Sending Http error. Error sending file to [url=“http://https://apsdev.deltafaucet.com:8890/invoke/wm.EDIINT/receive”]https://apsdev.deltafaucet.com:8890/invoke/wm.EDIINT/receive[/url]: [ErrHttpBadResp] The server could not fulfill the request: ‘HTTP/1.0 403 [B2BSERV.0084.9101] Access Denied’.

    I have the wm.EDIINT/receive set up in the system as anonymous and wouldn’t expect the customer to supply a user name and password.

    On top of that, the customer’s system doesn’t really have the ability to supply a user name and password. I also thought that certificates would authenticate who the partner was when the EDI data was received and the sender/receiver information was compared in Trading Networks.

    Our network administrator has assured me that the IP address that the customer is sending from has been resolved in our system and points to the machine with my IS server. He has also told me that all the ports that we are currently using have been opened up to all customers for sending EDI data.

    Does anybody have any suggestion on why we are unable to get this service fire off in our system from an outside user.

    Need some help. Thanks.


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


  • 24.  RE: Detecting host Name or IP in flow service

    Posted Tue January 06, 2004 11:31 PM

    Hi,
    Can any body tell me the good start place to webMethods

    bye
    shanti


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


  • 25.  RE: Detecting host Name or IP in flow service

    Posted Wed January 07, 2004 06:42 AM

    Hi Shanti

    Try downloading a trial version from webMethods.com also look for a Developer Tutorial

    Thahir


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


  • 26.  RE: Detecting host Name or IP in flow service

    Posted Wed February 25, 2004 07:58 PM

    Hi…
    Can anybody point me to good site where i can find more explanation on developing EDIINT AS1 using java.

    Thanks


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


  • 27.  RE: Detecting host Name or IP in flow service

    Posted Mon May 02, 2005 01:16 PM

    hi,

    i have changed my dispatch.cnf file, ie old ips to new ips can anyone solve the problem. 
    

    Here are the logs from the webMethods test failure. Can someone help with fixing this:

    2005-04-29 11:49:14 EDT [ISS.0025.0001C] Integration Server 6.1 Build 132
    2005-04-29 11:49:14 EDT [ISS.0025.0006C] License Manager started
    2005-04-29 11:49:14 EDT [ISS.0025.0041C] FIPS mode not initialized
    2005-04-29 11:49:16 EDT [BAS.0123.0001C] FSData full consistency check is being performed. Db:WmRepository4/FSD
    2005-04-29 11:49:18 EDT [ISS.0025.0017C] Repository Manager started
    2005-04-29 11:49:20 EDT [ISS.0025.0024C] JDBC Connection Manager started
    2005-04-29 11:49:21 EDT [ISS.0095.0005C] AuditLogManager Initialization failed, no JDBC connection pool available.
    2005-04-29 11:49:21 EDT [BAS.0123.0001C] FSData full consistency check is being performed. Db:audit/data/AuditStore.
    2005-04-29 11:49:28 EDT [ISS.0025.0023C] Audit Log Manager started
    2005-04-29 11:49:29 EDT [ISS.0025.0021C] ACL Manager started
    2005-04-29 11:49:29 EDT [ISS.0025.0008C] State Manager started
    2005-04-29 11:49:33 EDT [ISS.0025.0010C] Service Manager started
    2005-04-29 11:49:33 EDT [ISS.0025.0020C] Validation Processor started
    2005-04-29 11:49:33 EDT [ISS.0025.0022C] Statistics Processor started
    2005-04-29 11:49:33 EDT [ISS.0025.0018C] Invoke Manager started
    2005-04-29 11:49:34 EDT [ISS.0025.0012C] Cache Manager started
    2005-04-29 11:49:37 EDT [ISS.0099.0003E] Unable to create Broker Transport 172.28.77.20_5555_AdminClient. Exception com.wm.app.b2b.server.dispatcher.exceptions.EndpointUnavailableException: [ISS.0098.9014] BrokerException: Broker Not Running (101-1020): The host ‘localhost’ was found, but no Broker Server is running on port 6849 of that host.

    2005-04-29 11:49:37 EDT [ISS.0099.0003E] Unable to create Broker Transport F9ihzGtfxZCs94fuZg4YWrG4+1k__DefaultClient. Exception com.wm.app.b2b.server.dispatcher.exceptions.EndpointUnavailableException: [ISS.0098.9014] BrokerException: Broker Not Running (101-1020): The host ‘localhost’ was found, but no Broker Server is running on port 6849 of that host.

    2005-04-29 11:49:37 EDT [ISS.0099.0003E] Unable to create Broker Transport 172.28.77.20_5555_RequestReplyClient. Exception com.wm.app.b2b.server.dispatcher.exceptions.EndpointUnavailableException: [ISS.0098.9014] BrokerException: Broker Not Running (101-1020): The host ‘localhost’ was found, but no Broker Server is running on port 6849 of that host.

    2005-04-29 11:49:37 EDT [ISS.0099.0003E] Unable to create Broker Transport 172.28.77.20_5555_SyncClient. Exception com.wm.app.b2b.server.dispatcher.exceptions.EndpointUnavailableException: [ISS.0098.9014] BrokerException: Broker Not Running (101-1020): The host ‘localhost’ was found, but no Broker Server is running on port 6849 of that host.

    2005-04-29 11:49:37 EDT [ISS.0098.0010C] Exception initializing Dispatcher configuration from file: com.wm.app.b2b.server.dispatcher.exceptions.TransportException: [ISS.0098.9027] Unknown broker version.

    2005-04-29 11:49:37 EDT [BAS.0123.0001C] FSData full consistency check is being performed. Db:DocumentStore/ISTransStore

    2005-04-29 11:49:44 EDT [ISS.0098.0026D] Document Store DefaultStore initialized
    2005-04-29 11:49:44 EDT [BAS.0123.0001C] FSData full consistency check is being performed. Db:DocumentStore/TriggerStore

    2005-04-29 11:49:51 EDT [ISS.0098.0103C] DocumentStore not initialized. Adjust document store settings and restart server.

    2005-04-29 11:49:51 EDT [ISS.0025.9998C] Exception –> com.wm.app.b2b.server.dispatcher.exceptions.PersistenceException: com.wm.app.store.TSException: [BAT.0002.0000] Wrapped Exception: java.lang.ArrayIndexOutOfBoundsException: -7146
    <


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


  • 28.  RE: Detecting host Name or IP in flow service

    Posted Wed June 22, 2005 11:02 AM

    Dear all,
    I have problem in starting the IS server installed on linux machine
    Actually startup doesnot proceeds after below lines.Please help me to solve the issue and i have removed the LOCFILE before starting server.
    Thanks in Advance

    2005-06-22 12:51:07 IST [ISS.0025.0001C] Integration Server 6.1 Build 132
    2005-06-22 12:51:07 IST [ISS.0025.0006C] License Manager started
    2005-06-22 12:51:07 IST [ISS.0025.0041C] FIPS mode not initialized
    2005-06-22 12:51:10 IST [BAS.0123.0001C] FSData full consistency check is being performed. Db:WmR
    epository4/FSD
    2005-06-22 12:51:12 IST [ISS.0025.0017C] Repository Manager started
    ~
    ~


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


  • 29.  RE: Detecting host Name or IP in flow service

    Posted Thu June 23, 2005 01:45 AM

    When you increase the logging level to a higher number (say 5 or 6) do you see any helpful messages? Does the error log show anything useful?

    Mark


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


  • 30.  RE: Detecting host Name or IP in flow service

    Posted Thu July 27, 2006 03:43 PM

    I have tried 3 ways to get the host server name:

    Java service using ServerAPI.getServerName();
    wm.server.admin:getServerHost
    pub.flow:getTransportInfo

    Here is the weird thing. Using the first 2 ways, one on server I am getting the full name (wMDev.server.net for example). On another server, I am NOT getting the full name (would show up as wMDev). However, on BOTH servers I get the full name (and port - wMDev.server.net:5150) using the pub.flow:getTransportInfo. Can’t figure out why I am getting the full name using the first 2 ways on the one server and not the other. Any thoughts?

    FYI - we are using the getTransportInfo for now but I would like to know why the other 2 are not working on all servers.

    Thanks


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


  • 31.  RE: Detecting host Name or IP in flow service

    Posted Mon August 07, 2006 04:53 PM

    Chris,

    There is ‘sample.serverInfo:getServerInformation’ service in the
    wmSamples package from advantage site. But This is 6.1 not sure whether there is something for 4.6.

    In our case we invoke this service and brach on the server name to get the email list and mailhub url (or what so ever) .

    HTH
    PRY


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


  • 32.  RE: Detecting host Name or IP in flow service

    Posted Mon August 07, 2006 04:56 PM

    Chris,

    adding more!!!

    This service uses

    //Output variable
    String strServerName = ServerAPI.getServerName();
    int intCurrentPort = ServerAPI.getCurrentPort();

    Is this (ServerAPI) not available in the 4.6 ?

    HTH
    PRY


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