本文整理汇总了Java中javax.wsdl.PortType类的典型用法代码示例。如果您正苦于以下问题:Java PortType类的具体用法?Java PortType怎么用?Java PortType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PortType类属于javax.wsdl包,在下文中一共展示了PortType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addWsdlPortTypeOperation
import javax.wsdl.PortType; //导入依赖的package包/类
private static void addWsdlPortTypeOperation(Definition definition, QName portTypeQName, String operationName, String operationComment, QName inputQName, QName ouptutQName) {
Message inputMessage = definition.createMessage();
inputMessage.setQName(inputQName);
Input input = definition.createInput();
input.setMessage(inputMessage);
Message outpuMessage = definition.createMessage();
outpuMessage.setQName(ouptutQName);
Output output = definition.createOutput();
output.setMessage(outpuMessage);
Operation operation = definition.createOperation();
operation.setName(operationName);
operation.setInput(input);
operation.setOutput(output);
operation.setUndefined(false);
addWsdLDocumentation(definition, operation, operationComment);
PortType portType = definition.getPortType(portTypeQName);
portType.addOperation(operation);
}
示例2: test
import javax.wsdl.PortType; //导入依赖的package包/类
@Test
@RunAsClient
public void test() throws Exception
{
File destDir = new File(TEST_DIR, "wsprovide" + FS + "java");
String absOutput = destDir.getAbsolutePath();
String command = JBOSS_HOME + FS + "bin" + FS + "wsprovide" + EXT + " -k -w -o " + absOutput + " --classpath " + CLASSES_DIR + " " + ENDPOINT_CLASS;
Map<String, String> env = new HashMap<>();
env.put("JAVA_OPTS", System.getProperty("additionalJvmArgs"));
executeCommand(command, null, "wsprovide", env);
URL wsdlURL = new File(destDir, "JBWS2528EndpointService.wsdl").toURI().toURL();
WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
PortType portType = wsdlDefinition.getPortType(new QName("http://jbws2528.jaxws.ws.test.jboss.org/", "JBWS2528Endpoint"));
Operation op = (Operation)portType.getOperations().get(0);
@SuppressWarnings("unchecked")
List<String> parOrder = op.getParameterOrdering();
assertEquals("id", parOrder.get(0));
assertEquals("Name", parOrder.get(1));
assertEquals("Employee", parOrder.get(2));
}
示例3: addOWOperation2PT
import javax.wsdl.PortType; //导入依赖的package包/类
private Operation addOWOperation2PT(Definition def, PortType pt, OneWayOperationDeclaration op) {
Operation wsdlOp = def.createOperation();
wsdlOp.setName(op.id());
wsdlOp.setStyle(OperationType.ONE_WAY);
wsdlOp.setUndefined(false);
Input in = def.createInput();
Message msg_req = addRequestMessage(localDef, op);
msg_req.setUndefined(false);
in.setMessage(msg_req);
wsdlOp.setInput(in);
wsdlOp.setUndefined(false);
pt.addOperation(wsdlOp);
return wsdlOp;
}
示例4: createBindingSOAP
import javax.wsdl.PortType; //导入依赖的package包/类
private Binding createBindingSOAP(Definition def, PortType pt, String bindingName) {
Binding bind = def.getBinding(new QName(bindingName));
if (bind == null) {
bind = def.createBinding();
bind.setQName(new QName(tns, bindingName));
}
bind.setPortType(pt);
bind.setUndefined(false);
try {
SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension(Binding.class, new QName(NameSpacesEnum.SOAP.getNameSpaceURI(), "binding"));
soapBinding.setTransportURI(NameSpacesEnum.SOAPoverHTTP.getNameSpaceURI());
soapBinding.setStyle("document");
bind.addExtensibilityElement(soapBinding);
} catch (WSDLException ex) {
System.out.println((ex.getStackTrace()));
}
def.addBinding(bind);
return bind;
}
示例5: testTN_BPEL4WSProcessTModel
import javax.wsdl.PortType; //导入依赖的package包/类
@Test
public void testTN_BPEL4WSProcessTModel() throws WSDLException, JAXBException, Exception {
// Obtained from the .bpel file:
String targetNamespace = "http://example.com/travelagent";
QName serviceName = new QName (targetNamespace, "ReservationAndBookingTickets");
String bpelOverViewUrl = "http://localhost/registry/" + serviceName.getLocalPart() + ".bpel";
// Reading the WSDL
Definition wsdlDefinition = rw.readWSDL("bpel/bpel-technote.wsdl");
@SuppressWarnings("unchecked")
Map<QName,PortType> portTypes= (Map<QName,PortType>) wsdlDefinition.getAllPortTypes();
TModel bpel4WSTModel = bpel2UDDI.createBPEL4WSProcessTModel(serviceName, targetNamespace, portTypes, bpelOverViewUrl);
System.out.println("***** BPEL4WS Process TModel: " + bpel4WSTModel.getName().getValue());
if (serialize)
System.out.println(pTModel.print(bpel4WSTModel));
Assert.assertNotNull(bpel4WSTModel);
}
示例6: testHelloWorld_WSDLPortTypeModels
import javax.wsdl.PortType; //导入依赖的package包/类
@Test
public void testHelloWorld_WSDLPortTypeModels() throws WSDLException, JAXBException , Exception{
// Reading the WSDL
Definition wsdlDefinition = rw.readWSDL("bpel/HelloWorld.wsdl");
@SuppressWarnings("unchecked")
Map<QName,PortType> portTypes= (Map<QName,PortType>) wsdlDefinition.getAllPortTypes();
Set<TModel> portTypeTModels = bpel2UDDI.createWSDLPortTypeTModels(wsdlDefinition.getDocumentBaseURI(), portTypes);
for (TModel tModel : portTypeTModels) {
System.out.println("***** UDDI PortType TModel: " + tModel.getName().getValue());
if (serialize)
System.out.println(pTModel.print(tModel));
}
Assert.assertEquals(1,portTypeTModels.size());
}
示例7: testHelloWorld_BPEL4WSProcessTModel
import javax.wsdl.PortType; //导入依赖的package包/类
@Test
public void testHelloWorld_BPEL4WSProcessTModel() throws WSDLException, JAXBException , Exception{
//Obtained from the .bpel file:
String targetNamespace = "http://www.jboss.org/bpel/examples";
QName serviceName = new QName (targetNamespace, "HelloWorld");
String bpelOverViewUrl = "http://localhost/registry/" + serviceName.getLocalPart() + ".bpel";
// Reading the WSDL
Definition wsdlDefinition = rw.readWSDL("bpel/HelloWorld.wsdl");
@SuppressWarnings("unchecked")
Map<QName,PortType> portTypes= (Map<QName,PortType>) wsdlDefinition.getAllPortTypes();
TModel bpel4WSTModel = bpel2UDDI.createBPEL4WSProcessTModel(serviceName, targetNamespace, portTypes, bpelOverViewUrl);
System.out.println("***** BPEL4WS Process TModel: " + bpel4WSTModel.getName().getValue());
if (serialize)
System.out.println(pTModel.print(bpel4WSTModel));
Assert.assertNotNull(bpel4WSTModel);
}
示例8: testUDDIBindingModel
import javax.wsdl.PortType; //导入依赖的package包/类
@Test
public void testUDDIBindingModel() throws WSDLException, JAXBException, ConfigurationException , Exception{
// Reading the WSDL
Definition wsdlDefinition = rw.readWSDL("wsdl/HelloWorld.wsdl");
String wsdlURL = wsdlDefinition.getDocumentBaseURI();
Properties properties = new Properties();
properties.put("keyDomain", "juddi.apache.org");
WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
Set<TModel> tModels = new HashSet<TModel>();
@SuppressWarnings("unchecked")
Map<QName,PortType> portTypes = (Map<QName,PortType>) wsdlDefinition.getAllPortTypes();
Set<TModel> portTypeTModels = wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes);
tModels.addAll(portTypeTModels);
for (TModel tModel : tModels) {
System.out.println("UDDI PortType TModel " + tModel.getName().getValue());
if (serialize)
System.out.println(pTModel.print(tModel));
}
Assert.assertEquals(1,tModels.size());
}
示例9: generateActionFromOutputElement
import javax.wsdl.PortType; //导入依赖的package包/类
/**
* Generate the Action for an Output using the Default Action Pattern
* <p/>
* Pattern is defined as [target namespace][delimiter][port type name][delimiter][output name]
*
* @param def is required to obtain the targetNamespace
* @param wsdl4jPortType is required to obtain the portType name
* @param op is required to generate the output name if not explicitly specified
* @param output is required for its name if specified
* @return a wsa:Action value based on the Default Action Pattern and the provided objects
*/
public static String generateActionFromOutputElement(Definition def, PortType wsdl4jPortType,
Operation op, Output output) {
// Get the targetNamespace of the wsdl:definition
String targetNamespace = def.getTargetNamespace();
// Determine the delimiter. Per the spec: 'is ":" when the [target namespace] is a URN, otherwise "/".
// Note that for IRI schemes other than URNs which aren't path-based (i.e. those that outlaw the "/"
// character), the default action value may not conform to the rules of the IRI scheme. Authors
// are advised to specify explicit values in the WSDL in this case.'
String delimiter = SLASH;
if (targetNamespace.toLowerCase().startsWith(URN)) {
delimiter = COLON;
}
// Get the portType name (as a string to be included in the action)
String portTypeName = wsdl4jPortType.getQName().getLocalPart();
// Get the name of the output element (and generate one if none explicitly specified)
String outputName = getNameFromOutputElement(op, output);
// Append the bits together
StringBuffer sb = new StringBuffer();
sb.append(targetNamespace);
// Deal with the problem that the targetNamespace may or may not have a trailing delimiter
if (!targetNamespace.endsWith(delimiter)) {
sb.append(delimiter);
}
sb.append(portTypeName);
sb.append(delimiter);
sb.append(outputName);
// Resolve the action from the StringBuffer
String result = sb.toString();
if (log.isTraceEnabled()) {
log.trace("generateActionFromOutputElement result: " + result);
}
return result;
}
示例10: findOperation
import javax.wsdl.PortType; //导入依赖的package包/类
private Operation findOperation(PortType portType,
BindingOperation wsdl4jBindingOperation) {
Operation op = wsdl4jBindingOperation.getOperation();
String input = null;
if (op != null && op.getInput() != null) {
input = op.getInput().getName();
if (":none".equals(input)) {
input = null;
}
}
String output = null;
if (op != null && op.getOutput() != null) {
output = op.getOutput().getName();
if (":none".equals(output)) {
output = null;
}
}
Operation op2 = portType.getOperation(op.getName(), input, output);
return ((op2 == null) ? op : op2);
}
示例11: removePortType
import javax.wsdl.PortType; //导入依赖的package包/类
public PortType removePortType(QName name) {
if (isDebugEnabled) {
log.debug(myClassName + ".removePortType(" + name + ")");
}
getWrappedDefinitionForUse();
PortType results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.removePortType(name);
}
doneUsingWrappedDefinition();
return results;
}
示例12: createPortType
import javax.wsdl.PortType; //导入依赖的package包/类
public PortType createPortType() {
if (isDebugEnabled) {
log.debug(myClassName + ".createPortType()");
}
getWrappedDefinitionForUse();
PortType results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.createPortType();
}
doneUsingWrappedDefinition();
return results;
}
示例13: getWSDLPortType
import javax.wsdl.PortType; //导入依赖的package包/类
public PortType getWSDLPortType() {
PortType portType = null;
// EndpointDescriptionWSDL endpointDescWSDL = (EndpointDescriptionWSDL) getEndpointDescription();
// Binding wsdlBinding = endpointDescWSDL.getWSDLBinding();
// if (wsdlBinding != null) {
// portType = wsdlBinding.getPortType();
// }
Definition wsdlDefn = getWSDLDefinition();
if (wsdlDefn != null) {
String tns = getEndpointDescription().getTargetNamespace();
String localPart = getEndpointDescription().getName();
if (localPart != null) {
portType = wsdlDefn.getPortType(new QName(tns, localPart));
}
}
return portType;
}
示例14: getWSDLPortsUsingPortType
import javax.wsdl.PortType; //导入依赖的package包/类
public List<Port> getWSDLPortsUsingPortType(QName portTypeQN) {
ArrayList<Port> portList = new ArrayList<Port>();
if (!DescriptionUtils.isEmpty(portTypeQN)) {
Map wsdlPortMap = getWSDLPorts();
if (wsdlPortMap != null && !wsdlPortMap.isEmpty()) {
for (Object mapElement : wsdlPortMap.values()) {
Port wsdlPort = (Port)mapElement;
PortType wsdlPortType = wsdlPort.getBinding().getPortType();
QName wsdlPortTypeQN = wsdlPortType.getQName();
if (portTypeQN.equals(wsdlPortTypeQN)) {
portList.add(wsdlPort);
}
}
}
}
return portList;
}
示例15: getOperation
import javax.wsdl.PortType; //导入依赖的package包/类
/**
* Find the specified operation in the WSDL definition.
*
* @param operationName Name of operation to find.
* @return A WsdlOperation instance, null if operation can not be found in WSDL.
*/
public WsdlOperation getOperation(String operationName) {
// is the operation in the cache?
if (_operationCache.containsKey(operationName)) {
return (WsdlOperation) _operationCache.get(operationName);
}
Binding b = _port.getBinding();
PortType pt = b.getPortType();
Operation op = pt.getOperation(operationName, null, null);
if (op != null) {
try {
WsdlOperation wop = new WsdlOperation(b, op, _wsdlTypes);
// cache the operation
_operationCache.put(operationName, wop);
return wop;
}
catch(Exception e) {
LogWriter.getInstance().logError("WSDL", "Could retrieve WSDL Operator for operation name: "+operationName, e);
}
}
return null;
}