SOAPService soapService = server.getService(SERVICE_NAME);
BasicProvider provider = (BasicProvider) soapService.getPivotHandler();
MessageContext mc = new MessageContext(server);
mc.setService(soapService);
mc.setProperty(MessageContext.TRANS_URL, "local");
provider.generateWSDL(mc);
Document wsdl = (Document) mc.getProperty("WSDL");
assertNotNull( "cannot create WSDL", wsdl);
Definition def = WSDLFactory.newInstance().newWSDLReader().readWSDL( null, wsdl);
PortType portType = def.getPortType( PORTTYPEQNAME);
assertNotNull( "cannot find porttype " + PORTTYPEQNAME, portType);
Operation operation = portType.getOperation( "method1", null, null);
assertNotNull( "cannot find operation ", operation);
Input input = operation.getInput();
javax.wsdl.Message message = def.getMessage( new QName( TNS, input.getName()));
assertNotNull( "cannot find message " + input.getName(), message);
Part part = message.getPart("param1");
assertEquals( "wrong type for part", part.getTypeName().getLocalPart(), "string");