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
  • 1.  Using struct fields in Broker Documents from Java Client

    Posted Thu February 24, 2005 09:39 PM

    Thanks for listening. seems as soon as I post I find my own answer

    stEvent = new BrokerEvent(null,"wm::is::Samples::SampleStruct)

    <doh>


    #Integration-Server-and-ESB
    #webMethods
    #Universal-Messaging-Broker
    #broker


  • 2.  RE: Using struct fields in Broker Documents from Java Client

    Posted Thu February 24, 2005 10:00 PM

    Now I can publish the document, but if I look at the data in the pipeline the data is not (IMO) correct
    Pipleine in WmMonitor show ???
    save Pipeline from Flow Service shows high-ascii data
    Not my simple strings.

    eventtype wm::is::Samples::StructDoc
    { unicode_string name;
    struct
    { unicode_string element01;
    unicode_string element02;
    unicode_string element03; }
    sampStruct; }
    […]
    try
    {
    event.setStringField(“name”,“Name is Paul”);
    stEvent.setStringField(“element01”,“Name is Paul”);
    stEvent.setStringField(“element02”,“e02Val”);
    stEvent.setStringField(“element03”,“e03Val”);
    event.setStructFieldFromEvent(“sampStruct”,stEvent);
    }
    […]

    see attachment for pipeline

    pipeline file
    structdoc.xml (2.3 k)


    #broker
    #Integration-Server-and-ESB
    #Universal-Messaging-Broker
    #webMethods


  • 3.  RE: Using struct fields in Broker Documents from Java Client

    Posted Fri February 25, 2005 03:27 PM

    I put some output into the client
    to getStructFieldAsEvent on the sampStruct I just built.
    and I can get it back populated
    System.out.println("sampStruct is "+event.getStructFieldAsEvent(“sampStruct”));

    […]
    sampStruct is

    event struct_value {
    string element01 = “e01Val”;
    string element02 = “e02Val”;
    string element03 = “e03Val”;
    };
    […]

    Why cannot I not see this in the pipeline?


    #broker
    #Universal-Messaging-Broker
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Using struct fields in Broker Documents from Java Client

    Posted Fri February 25, 2005 05:39 PM

    Got it.
    Attached please find a sample java BrokerClient for a simple structured document and a java class to store the object.

    brokerclientrequest.java
    BrokerClientRequest.java (3.2 k)

    sampStruct.java
    sampStruct.java (0.8 k)


    #Universal-Messaging-Broker
    #webMethods
    #Integration-Server-and-ESB
    #broker


  • 5.  RE: Using struct fields in Broker Documents from Java Client

    Posted Sat November 19, 2005 05:28 PM

    Paul great job. thank you for posting the answer to your own question.
    just want to say
    while ()
    {
    thank you
    }


    #Universal-Messaging-Broker
    #broker
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Using struct fields in Broker Documents from Java Client

    Posted Mon January 09, 2006 03:05 PM

    Hi Paul
    I’ve been trying to reproduce what you’ve done here on a concrete example.
    But, in my case, “sampStruct” is a Struct array (Struct).
    Furthermore, my IS document “sampStruct” has not been declared as publishable onto the broker.

    So in my case, the line
    “stEvent = new BrokerEvent(null,”<any>“,sampleMsgToPublish);” doesn’t seem to work out since “<any>” is not a valid reference to a document type declared on the broker.

    I guess I have to make my doc “sampStruct” publishable in order to make it work correctly. I’ll try out …


    #broker
    #webMethods
    #Integration-Server-and-ESB
    #Universal-Messaging-Broker


  • 7.  RE: Using struct fields in Broker Documents from Java Client

    Posted Mon January 09, 2006 03:39 PM

    Well, I’ve declared the sub-document as publishable (hopefully, it was a separate document and now it works fine.
    So “<any>” can’t be “anything” like I thought, but a valid reference to a a declared doc onto the broker.
    This is obvious because what if you want to fill in a document in a main document (that is, a sub-document), knowing that this subdocument is not a separate document? I guess you can’t …


    #Universal-Messaging-Broker
    #webMethods
    #broker
    #Integration-Server-and-ESB