Topic
  • 2 replies
  • Latest Post - ‏2012-03-27T17:07:26Z by CDSR
CDSR
CDSR
5 Posts

Pinned topic Get XML message over HTTP by setting interface return type as string-WID7.0

‏2012-03-26T21:01:38Z |
How can we get XML message over HTTP by setting interface return type as string in WID 7.0 (WESB 7.0)?

Created a HTTP service which will return following XML message:

<ns0:PartDetail1 xmlns:ns0="http://ai.Schemas.PartDetail1">
<PartNumber>123</PartNumber>
<PartName>asd</PartName>
<PartType>PartType_0</PartType>
<PDMAuthority>PDMAuthority_0</PDMAuthority>
<DingList>
<Ding>
<DingNbr>DingNbr_0</DingNbr>
<DingSheet>DingSheet_0</DingSheet>
</Ding>
</DingList>
<MaterialList>
<Material> <MaterialClassCode>MaterialClassCode_0</MaterialClassCode>
<Length>Length_0</Length>
<Width>Width_0</Width>
</Material>
</MaterialList>
<UsedOnAssemblyList>
<UsedOnAssembly> <UsedOn_PartNumber>UsedOn_PartNumber_0</UsedOn_PartNumber>
<Quantity>Quantity_0</Quantity>
</UsedOnAssembly>
</UsedOnAssemblyList>
</ns0:PartDetail1>

From WID 7.0(WESB 7.0), I am calling a HTTP service which will return above XML file. This is working, when I set the interface return type as XML schema type. But if I set interface return type as string, in the WID (7.0) I can see only “123” as a message (which is part number). How can we get the entire above XML message by setting interface return type as string? Because same HTTP service will return different XML messages on different conditions.

Please help us how could we resolve this. Any help would be greatly appreciated.

Thanks
Updated on 2012-03-27T17:07:26Z at 2012-03-27T17:07:26Z by CDSR
  • TrushkinAndrey
    TrushkinAndrey
    112 Posts

    Re: Get XML message over HTTP by setting interface return type as string-WID7.0

    ‏2012-03-27T06:46:08Z  
    Hello, CDSR.

    I think, your problem is based on DataHandler and string return type mixing. You have XML DataHandler, it parses your input message to XML format, and String return type indicates it return the first string from XML. This is "123".

    You should clear your DataHandler class. In this case you will get only string. And after this you can deserialize it with BOXMLSerializer. BOXMLSerializer usage example is listed: http://www.ibm.com/developerworks/webservices/library/ws-boxml/

    Andrey
  • CDSR
    CDSR
    5 Posts

    Re: Get XML message over HTTP by setting interface return type as string-WID7.0

    ‏2012-03-27T17:07:26Z  
    Hello, CDSR.

    I think, your problem is based on DataHandler and string return type mixing. You have XML DataHandler, it parses your input message to XML format, and String return type indicates it return the first string from XML. This is "123".

    You should clear your DataHandler class. In this case you will get only string. And after this you can deserialize it with BOXMLSerializer. BOXMLSerializer usage example is listed: http://www.ibm.com/developerworks/webservices/library/ws-boxml/

    Andrey
    Thank you Andrey for your replay.

    when I clear the datahandler class,I was getting following error:

    "No output data binding is available for the getDetail method on the HTTP_String component.

    And No InPut data binding is available for the getDetail method on the HTTP_String component.

    Here "HTTP_String" is Import primitive name. this is synchronous call.

    I am very new to WESB. Not sure whether I am missing something? Please help me.

    Thanks