### Question:
WSDLHelper { public static org.w3c.dom.Element wrapRequestMessagePart(org.w3c.dom.Element content, javax.wsdl.Operation operation) { return (wrapMessagePart(content, operation, operation.getInput().getMessage().getParts(), false)); } private  WSDLHelper(); static javax.wsdl.Definition getWSDLDefinition(String location); static javax.wsdl.PortType getPortType(String location, javax.wsdl.Definition wsdl); static javax.wsdl.Service getServiceForPortType(javax.wsdl.PortType portType,
                                javax.wsdl.Definition wsdl); static org.w3c.dom.Node unwrapMessagePart(org.w3c.dom.Element content); static org.w3c.dom.Element wrapRequestMessagePart(org.w3c.dom.Element content,
                        javax.wsdl.Operation operation); static org.w3c.dom.Element wrapResponseMessagePart(org.w3c.dom.Element content,
                        javax.wsdl.Operation operation); static org.w3c.dom.Element wrapFaultMessagePart(org.w3c.dom.Element content,
                        javax.wsdl.Operation operation, String faultName);  }### Answer:
@Test public void testWrapRequestMessagePart() { try { java.net.URL url=WSDLHelperTest.class.getResource("/tests/wsdl/LoanService.wsdl"); javax.wsdl.Definition wsdl=javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader().readWSDL(url.getFile()); javax.wsdl.PortType portType= wsdl.getPortType(QName.valueOf("{http: if (portType == null) { fail("Unable to get port type"); } javax.wsdl.Operation op=portType.getOperation("request", null, null); if (op == null) { fail("Unable to get operation 'request'"); } String content="content"; String xml="<"+content+"/>"; org.w3c.dom.Element elem=DOMUtils.stringToDOM(xml); org.w3c.dom.Element wrapped=WSDLHelper.wrapRequestMessagePart(elem, op); if (wrapped == null) { fail("Result is null"); } if (wrapped.getFirstChild().getNodeName().equals("reqpart") == false) { fail("Part name was not 'reqpart': "+wrapped.getFirstChild().getNodeName()); } if (wrapped.getFirstChild().getFirstChild().getNodeName().equals(content) == false) { fail("Content was not '"+content+"': "+wrapped.getFirstChild().getFirstChild().getNodeName()); } } catch(Exception e) { fail("Failed: "+e); } }