CXF client SOAP message formatting

后端 未结 1 596
渐次进展
渐次进展 2021-02-20 08:44

The WSDL file I used to create the CXF client has this element definition:

 
  
    

        
相关标签:
1条回答
  • 2021-02-20 09:14

    I might suggest the use of xQuery on the schema referenced by the WSDL. The name and location of the schema are part of the WSDL, and can be retrieved via XQuery also.

    Schemas are well-formed XML, so you will just have to determine the correct XPath selector to retrieve the desired value - in this case, that will be at a minimum something like...

    //xsd:element[@name == 'Rate']//xsd:fractionDigits/@value
    

    Which should yield the value 2.

    Keep in mind that there is an XPath/XQuery interpretor built into the latest JDKs. You merely have to put some kind of front-end on it, and I believe it will handle streams quite nicely.

    Doing the above will let you query the schema dynamically as you are processing a given element, allowing you, for example, to get the correct number of decimal digits when processing the Rate.

    0 讨论(0)
提交回复
热议问题