Get a service input as an XML from extranel java class in webmethods

I need to extract the input xml schema for specific webmethod service from extrnel java class it’s like when you run a flow sevice in disigner; a new window apear contian all inputs and you can save it in external file as pipeline. i’m tring to do the same thing form external java class. Means, get the input—>transfert to xml —> save it in file i can get the input name put not its structure( for record type as exp)