use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.
the class WSDLGenerator method generatePortType.
/**
* Generates the WSDL portType
*/
protected void generatePortType() {
PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart());
extension.addPortTypeExtension(portType);
for (JavaMethodImpl method : model.getJavaMethods()) {
Operation operation = portType.operation().name(method.getOperationName());
generateParameterOrder(operation, method);
extension.addOperationExtension(operation, method);
switch(method.getMEP()) {
case REQUEST_RESPONSE:
// input message
generateInputMessage(operation, method);
// output message
generateOutputMessage(operation, method);
break;
case ONE_WAY:
generateInputMessage(operation, method);
break;
default:
break;
}
// faults
for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName());
FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName());
extension.addOperationFaultExtension(paramType, method, exception);
}
}
}
use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.
the class WsaTubeHelper method getOutputAction.
public String getOutputAction(Packet packet) {
// String action = AddressingVersion.UNSET_OUTPUT_ACTION;
String action = null;
WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
if (wsdlOp != null) {
JavaMethod javaMethod = wsdlOp.getJavaMethod();
if (javaMethod != null) {
JavaMethodImpl jm = (JavaMethodImpl) javaMethod;
if (jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
return jm.getOutputAction();
}
}
WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
if (wbo != null)
return getOutputAction(wbo);
}
return action;
}
use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.
the class WsaTubeHelper method getFaultActionFromSEIModel.
String getFaultActionFromSEIModel(Packet requestPacket, Packet responsePacket) {
String action = null;
if (seiModel == null || wsdlPort == null) {
return action;
}
try {
SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage();
if (sm == null) {
return action;
}
if (sm.getSOAPBody() == null) {
return action;
}
if (sm.getSOAPBody().getFault() == null) {
return action;
}
Detail detail = sm.getSOAPBody().getFault().getDetail();
if (detail == null) {
return action;
}
String ns = detail.getFirstChild().getNamespaceURI();
String name = detail.getFirstChild().getLocalName();
WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
JavaMethodImpl jm = (wsdlOp != null) ? (JavaMethodImpl) wsdlOp.getJavaMethod() : null;
if (jm != null) {
for (CheckedExceptionImpl ce : jm.getCheckedExceptions()) {
if (ce.getDetailType().tagName.getLocalPart().equals(name) && ce.getDetailType().tagName.getNamespaceURI().equals(ns)) {
return ce.getFaultAction();
}
}
}
return action;
} catch (SOAPException e) {
throw new WebServiceException(e);
}
}
use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.
the class ServiceArtifactSchemaGenerator method generate.
public void generate(SchemaOutputResolver resolver) {
xsdResolver = resolver;
List<WrapperParameter> wrappers = new ArrayList<>();
for (JavaMethodImpl method : model.getJavaMethods()) {
if (method.getBinding().isRpcLit())
continue;
for (ParameterImpl p : method.getRequestParameters()) {
if (p instanceof WrapperParameter) {
if (WrapperComposite.class.equals((p.getTypeInfo().type))) {
wrappers.add((WrapperParameter) p);
}
}
}
for (ParameterImpl p : method.getResponseParameters()) {
if (p instanceof WrapperParameter) {
if (WrapperComposite.class.equals((p.getTypeInfo().type))) {
wrappers.add((WrapperParameter) p);
}
}
}
}
if (wrappers.isEmpty())
return;
HashMap<String, Schema> xsds = initWrappersSchemaWithImports(wrappers);
postInit(xsds);
for (WrapperParameter wp : wrappers) {
String tns = wp.getName().getNamespaceURI();
Schema xsd = xsds.get(tns);
Element e = xsd._element(Element.class);
e._attribute("name", wp.getName().getLocalPart());
e.type(wp.getName());
ComplexType ct = xsd._element(ComplexType.class);
ct._attribute("name", wp.getName().getLocalPart());
ExplicitGroup sq = ct.sequence();
for (ParameterImpl p : wp.getWrapperChildren()) if (p.getBinding().isBody())
addChild(sq, p);
}
for (Schema xsd : xsds.values()) xsd.commit();
}
use of com.sun.xml.ws.model.JavaMethodImpl in project metro-jax-ws by eclipse-ee4j.
the class DatabindingImpl method deserializeRequest.
public JavaCallInfo deserializeRequest(Packet req) {
com.sun.xml.ws.api.databinding.JavaCallInfo call = new com.sun.xml.ws.api.databinding.JavaCallInfo();
try {
JavaMethodImpl wsdlOp = resolveJavaMethod(req);
TieHandler tie = wsdlOpMap.get(wsdlOp);
call.setMethod(tie.getMethod());
Object[] args = tie.readRequest(req.getMessage());
call.setParameters(args);
} catch (DispatchException e) {
call.setException(e);
}
return call;
}
Aggregations