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

Problem on document structure when exposing a webservice

  • 1.  Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 11:05 AM

    Hello,

    I’ve got a problem when I try to manipulate the soap request in a service exposed as a webservice (soap msg).

    I’ve developped a testing service and I see that the soap request is well-formed.

    <?xml version="1.0" encoding="UTF-8"?>

    <SOAP-ENV:Envelope xmlns:SOAP-ENV=“[URL=“http://schemas.xmlsoap.org/soap/envelope/”]http://schemas.xmlsoap.org/soap/envelope/[/URL]” xmlns:SOAP-ENC=“[URL=“http://schemas.xmlsoap.org/soap/encoding/”]http://schemas.xmlsoap.org/soap/encoding/[/URL]” xmlns:xsd=“[URL=“http://www.w3.org/2001/XMLSchema”]http://www.w3.org/2001/XMLSchema[/URL]” xmlns:xsi=“[URL=“http://www.w3.org/2001/XMLSchema-instance”]http://www.w3.org/2001/XMLSchema-instance[/URL]”>
    SOAP-ENV:Body
    <tns1:troubleticket xmlns:tns1=“[URL=“http://localhost/PH_SAV_FTPH_SPAS/TroubleTicket/source/services/handleTT”]http://localhost/PH_SAV_FTPH_SPAS/TroubleTicket/source/services/handleTT[/URL]”>

    CLTT
    tns1:troubleticket.system.subactioncode
    SAS
    OCEANE

    tns1:troubleticket.system.sfu.code
    tns1:troubleticket.system.sfu.label



    tns1:troubleticket.system.isticketid.ticketid.objid
    tns1:troubleticket.system.isticketid.ticketid.id
    tns1:troubleticket.system.isticketid.ticketid.subid




    tns1:troubleticket.system.msticketid.ticketid.objid
    tns1:troubleticket.system.msticketid.ticketid.id
    tns1:troubleticket.system.msticketid.ticketid.subid



    tns1:troubleticket.system.agent.agentsystem

    tns1:troubleticket.system.agent.ticketid.objid
    tns1:troubleticket.system.agent.ticketid.id
    tns1:troubleticket.system.agent.ticketid.subid


    tns1:troubleticket.system.agent.group.id
    tns1:troubleticket.system.agent.group.label


    tns1:troubleticket.system.agent.role.id
    tns1:troubleticket.system.agent.role.label



    […]
    </tns1:troubleticket></SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    When I want to get the body node as a document, I obtain the following result : see attached doc troubleticket_in_pipeline.JPG

    I use the built-in service to obtain the document from the body : xmlNodeToDocument with the following parameters :
    input :
    soapRequest *body → *node
    makeArrays set to false
    nsDecls set with an element (spas set to [URL=“http://localhost/PH_SAV_FTPH_SPAS/TroubleTicket/source/services/handleTT”]http://localhost/PH_SAV_FTPH_SPAS/TroubleTicket/source/services/handleTT[/URL])
    output
    document → troubleticket (reference)

    The structure of the troubleticket is exposed in the attached doc : troubleticket_document.JPG

    In fact, i dontt understand why I obtain an added node in the result of the xmlNodeToDocument :

    spas:troubleticket

    I’ve attached my zipped code in the PH_SAV_FTPH_SPAS.zip file.
    The service exposed is : PH_SAV_FTPH_SPAS.TroubleTicket.source.services:handleTT

    Thank you in advance for your ideas !

    Christophe
    troubleticket_in_pipeline.JPG
    troubleticket_document.JPG
    PH_SAV_FTPH_SPAS.zip (43.1 KB)


    #webMethods
    #API-Management
    #soa


  • 2.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 01:16 PM

    Hello,
    The problem is with the document type you defined as input PH_SAV_FTPH_SPAS.TroubleTicket.internal.docType.wsdl:TroubleTicket. Look at it. There are three levels: Leve1- TroubleTicket, Level2- troubleticket and level3-The other segments. As all the segments are defined under one root document an extra ‘troubleticket’ document is coming in the request data. It is obvious from the document type you defined. To overcome this,

    1. either you have to take ‘spas:troubleticket’ (spas is namespace name) under ‘document’ of ‘xmlNodeToDocument’ and then map it to the output document trouble ticket.
    2. or Create a WSDL that defines ‘PH_SAV_FTPH_SPAS.TroubleTicket.internal.docType:troubleticket’ as input for this service and give it to your customer. Use this document in the ‘xmlNodeToDocument’ service as the output doc.

    Cheers
    Guna


    #webMethods
    #soa
    #API-Management


  • 3.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 02:20 PM

    Thank you tgunasekhar,

    I have tried to follow the process described by Mark Carlson in this thread : [URL=“wmusers.com”]wmusers.com

    In fact, I don’t understand where I must use the document PH_SAV_FTPH_SPAS.TroubleTicket.internal.docType.wsdl:TroubleTicket.

    When I call the xmlNodeToDocument service, I use PH_SAV_FTPH_SPAS.TroubleTicket.internal.docType:troubleticket as documentTypeName and I map the result to PH_SAV_FTPH_SPAS.TroubleTicket.internal.docType:troubleticket again.

    According to my short experience, “spas” is a namespace prefix. It is not mandatory in soap protocol. So, I don’t understand why I should reference it in the document troubleticket. This prefix could be named “toto” or nothing ?!

    Other precision : The wsdl is maintened by my client, so I can’t modify it.

    Christophe

    PS : Hope that my poor english is understanding …


    #webMethods
    #soa
    #API-Management


  • 4.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 02:32 PM

    In the sample given by Mark Carlson, you can see the step: xmlNodeToDocument. He did exactly what I said in step-1 of my previous answer

    And you missed it in your implementation. Have a look at both your service and Mark’s example.

    Cheers
    Guna


    #webMethods
    #API-Management
    #soa


  • 5.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 03:00 PM

    Thanx a lot Guna. I’ve not seen that there was a node under document of xmlNodeToDocument.
    And I’ve have not understood your answer. Sorry.

    But what is the purpose of the documentType that Mark Carlson has created in the folder wsdl ? That is for the generation of the wsdl ?

    Best regards.

    Christophe


    #soa
    #API-Management
    #webMethods


  • 6.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 03:43 PM

    I’ve now an other problem.
    The dimension of a few nodes is lost (document list is transformed into single string ).
    Note : The document that I send is empty for these nodes.


    #webMethods
    #API-Management
    #soa


  • 7.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 04:27 PM

    This commonly occurs when you don’t provide a documentType to the nodeToDocument call. If the tag appears a single time in the node, the service by default only knows to create a document and not a document list. You can fix this by defining the element names which repeat or by supplying a fully qualified document type name containing the structure.

    Mark


    #API-Management
    #soa
    #webMethods


  • 8.  RE: Problem on document structure when exposing a webservice

    Posted Tue May 06, 2008 04:34 PM

    Thank you mark for your answer.

    But I provide a documentTypeName to the service xmlNodeToDocument with makearrays = false. So, I don’t understand where the problem is…

    Actually, I call the webservice with empty values or lists for most of the nodes.
    I’ve tried by populate the lists. It doesn’t work.


    #webMethods
    #API-Management
    #soa


  • 9.  RE: Problem on document structure when exposing a webservice

    Posted Wed May 07, 2008 07:56 AM

    Hello,
    for the service ‘xmlNodeToDocument’ give the name of all the multiple occuring segments (agent, site, etc) as input to ‘Arrays’. Set make arrays as ‘true’ and remove the document type name value. This works.

    Cheers
    Guna


    #API-Management
    #soa
    #webMethods


  • 10.  RE: Problem on document structure when exposing a webservice

    Posted Wed May 07, 2008 08:40 AM

    Effectively. It is the solution at least.

    But is it a bug in the service xmlNodeToDocument ?

    Why it is not able to use correctly the documentTypeName that I’ve provided. Is it a problem of structure in the document ?

    I use this service in other parts of the code and it works fine with the documentTypeNames that I provide.

    I’ve seen a few concerns about this service on the forum and the answers are not clear.


    #webMethods
    #API-Management
    #soa


  • 11.  RE: Problem on document structure when exposing a webservice

    Posted Wed May 07, 2008 02:27 PM

    An other difficulties in defining arrays and documents nodes in the input of xmlNodeToDocument is when an element is define as a document in a sub-structure and as a string in an other sub-structure (see diagnostic in my example troubleticket)


    #webMethods
    #API-Management
    #soa


  • 12.  RE: Problem on document structure when exposing a webservice

    Posted Thu December 24, 2009 12:29 PM

    Christophe May I ask how you overcame this problem.

    I am also facing a similar problem where I am trying to build a custom SOAP processor and it is so dependent on the structure and the introduction of this additional tag is making my service go haywire…

    I have pretty much done exactly what you have done and stuck with the same problem.

    Do help.


    #API-Management
    #soa
    #webMethods


  • 13.  RE: Problem on document structure when exposing a webservice

    Posted Tue December 29, 2009 09:37 AM

    I am sorry I am unable to understand what you mentioned in you last post.
    Anway were you able to overcome your problem , if so how?


    #webMethods
    #API-Management
    #soa