本文整理汇总了Java中javax.jws.soap.SOAPBinding.Style类的典型用法代码示例。如果您正苦于以下问题:Java Style类的具体用法?Java Style怎么用?Java Style使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Style类属于javax.jws.soap.SOAPBinding包,在下文中一共展示了Style类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResponsePayloadName
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
@Override
public @Nullable QName getResponsePayloadName() {
if (emptyResponsePayload)
return null;
if (responsePayloadName != null)
return responsePayloadName;
if(style.equals(Style.RPC)){
String ns = getResponseNamespace() != null ? getResponseNamespace() : name.getNamespaceURI();
responsePayloadName = new QName(ns, name.getLocalPart()+"Response");
return responsePayloadName;
}else{
QName outMsgName = operation.getOutput().getMessage().getName();
EditableWSDLMessage message = messages.get(outMsgName);
for(EditableWSDLPart part:message.parts()){
ParameterBinding binding = getOutputBinding(part.getName());
if(binding.isBody()){
responsePayloadName = part.getDescriptor().name();
return responsePayloadName;
}
}
//Its empty payload
emptyResponsePayload = true;
}
//empty body
return null;
}
示例2: XMLSpineImpl
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* Create a lightweight representation of this protocol (i.e. the Envelope, Header and Body)
*
* @param protocol Protocol
* @param style Style
* @param indirection (0 or 1) indicates location of body blocks
* @param initialPayload (OMElement or null...used to add rest payload)
*/
public XMLSpineImpl(Protocol protocol, Style style, int indirection, OMElement payload) {
super();
this.protocol = protocol;
this.style = style;
this.indirection = indirection;
soapFactory = _getFactory(protocol);
root = _createEmptyEnvelope(style, soapFactory);
if (payload != null) {
((SOAPEnvelope)root).getBody().addChild(payload);
}
}
示例3: getOperationElement
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
public QName getOperationElement() throws WebServiceException {
try {
if (style != Style.RPC) {
return null;
}
switch (contentType) {
case OM:
return ((org.apache.axiom.soap.SOAPEnvelope)content).getBody().
getFirstElement().getQName();
case SPINE:
return ((XMLSpine)content).getOperationElement();
case SOAPENVELOPE:
Iterator it = ((SOAPEnvelope)content).getBody().getChildElements();
while (it.hasNext()) {
Node node = (Node)it.next();
if (node instanceof SOAPElement) {
Name name = ((SOAPElement)node).getElementName();
return new QName(name.getURI(), name.getLocalName(), name.getPrefix());
}
}
}
return null;
} catch (SOAPException se) {
throw ExceptionFactory.makeWebServiceException(se);
}
}
示例4: getRequestPayloadName
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
@Override
public @Nullable QName getRequestPayloadName() {
if (emptyRequestPayload)
return null;
if (requestPayloadName != null)
return requestPayloadName;
if(style.equals(Style.RPC)){
String ns = getRequestNamespace() != null ? getRequestNamespace() : name.getNamespaceURI();
requestPayloadName = new QName(ns, name.getLocalPart());
return requestPayloadName;
}else{
QName inMsgName = operation.getInput().getMessage().getName();
EditableWSDLMessage message = messages.get(inMsgName);
for(EditableWSDLPart part:message.parts()){
ParameterBinding binding = getInputBinding(part.getName());
if(binding.isBody()){
requestPayloadName = part.getDescriptor().name();
return requestPayloadName;
}
}
//Its empty payload
emptyRequestPayload = true;
}
//empty body
return null;
}
示例5: _createEmptyEnvelope
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* Create an emtpy envelope
*
* @param protocol
* @param style
* @param factory
* @return
*/
private static SOAPEnvelope _createEmptyEnvelope(Style style, SOAPFactory factory) {
SOAPEnvelope env = factory.createSOAPEnvelope();
// Add an empty body and header
factory.createSOAPBody(env);
factory.createSOAPHeader(env);
// Create a dummy operation element if this is an rpc message
if (style == Style.RPC) {
OMNamespace ns = factory.createOMNamespace("", "");
factory.createOMElement("PLACEHOLDER_OPERATION", ns, env.getBody());
}
return env;
}
示例6: XMLPartBase
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* XMLPart should be constructed via the XMLPartFactory. This constructor creates an XMLPart from
* the specified root.
*
* @param root
* @param protocol (if null, the soap protocol is inferred from the namespace)
* @throws WebServiceException
*/
XMLPartBase(OMElement root, Protocol protocol) throws WebServiceException {
content = root;
contentType = OM;
QName qName = root.getQName();
if (protocol == null) {
if (qName.getNamespaceURI().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
this.protocol = Protocol.soap11;
} else
if (qName.getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
this.protocol = Protocol.soap12;
}
} else if (protocol == Protocol.rest) {
this.protocol = Protocol.rest;
// Axis2 stores XML/HTTP messages inside a soap11 envelope. We will mimic this behavior
if (qName.getNamespaceURI().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
// Okay
} else
if (qName.getNamespaceURI().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
// throw ExceptionFactory.
// makeWebServiceException(Messages.getMessage("restWithSOAPErr"));
// Okey
} else {
content = _createSpine(Protocol.rest, Style.DOCUMENT, 0, root);
contentType = SPINE;
}
} else {
this.protocol = protocol;
}
}
示例7: setStyle
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
public void setStyle(Style style) throws WebServiceException {
if (this.style != style) {
if (contentType == SPINE) {
// Must switch to something other than XMLSpine
getContentAsOMElement();
}
}
this.style = style;
if (style == Style.RPC) {
setIndirection(1);
} else {
setIndirection(0);
}
}
示例8: getReqPayloadName
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
public @Nullable QName getReqPayloadName() {
if (emptyRequestPayload)
return null;
if (requestPayloadName != null)
return requestPayloadName;
if(style.equals(Style.RPC)){
String ns = getRequestNamespace() != null ? getRequestNamespace() : name.getNamespaceURI();
requestPayloadName = new QName(ns, name.getLocalPart());
return requestPayloadName;
}else{
QName inMsgName = operation.getInput().getMessage().getName();
WSDLMessageImpl message = messages.get(inMsgName);
for(WSDLPartImpl part:message.parts()){
ParameterBinding binding = getInputBinding(part.getName());
if(binding.isBody()){
requestPayloadName = part.getDescriptor().name();
return requestPayloadName;
}
}
//Its empty payload
emptyRequestPayload = true;
}
//empty body
return null;
}
示例9: getResPayloadName
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
public @Nullable QName getResPayloadName() {
if (emptyResponsePayload)
return null;
if (responsePayloadName != null)
return responsePayloadName;
if(style.equals(Style.RPC)){
String ns = getResponseNamespace() != null ? getResponseNamespace() : name.getNamespaceURI();
responsePayloadName = new QName(ns, name.getLocalPart()+"Response");
return responsePayloadName;
}else{
QName outMsgName = operation.getOutput().getMessage().getName();
WSDLMessageImpl message = messages.get(outMsgName);
for(WSDLPartImpl part:message.parts()){
ParameterBinding binding = getOutputBinding(part.getName());
if(binding.isBody()){
responsePayloadName = part.getDescriptor().name();
return responsePayloadName;
}
}
//Its empty payload
emptyResponsePayload = true;
}
//empty body
return null;
}
示例10: getStyle
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* Get {@link Style} - such as <code>document</code> or <code>rpc</code>.
*/
public Style getStyle() {
return style;
}
示例11: isDocLit
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* Returns true if its document/literal
*/
public boolean isDocLit() {
return style == Style.DOCUMENT && use == Use.LITERAL;
}
示例12: isRpcLit
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* Returns true if this is a rpc/literal binding
*/
public boolean isRpcLit() {
return style == Style.RPC && use == Use.LITERAL;
}
示例13: processClass
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
void processClass(Class clazz) {
classUsesWebMethod = new HashSet<Class>();
determineWebMethodUse(clazz);
WebService webService = getAnnotation(clazz, WebService.class);
QName portTypeName = getPortTypeName(clazz, targetNamespace, metadataReader);
// String portTypeLocalName = clazz.getSimpleName();
// if (webService.name().length() >0)
// portTypeLocalName = webService.name();
//
// targetNamespace = webService.targetNamespace();
packageName = "";
if (clazz.getPackage() != null)
packageName = clazz.getPackage().getName();
// if (targetNamespace.length() == 0) {
// targetNamespace = getNamespace(packageName);
// }
// model.setTargetNamespace(targetNamespace);
// QName portTypeName = new QName(targetNamespace, portTypeLocalName);
targetNamespace = portTypeName.getNamespaceURI();
model.setPortTypeName(portTypeName);
model.setTargetNamespace(targetNamespace);
model.defaultSchemaNamespaceSuffix = config.getMappingInfo().getDefaultSchemaNamespaceSuffix();
model.setWSDLLocation(webService.wsdlLocation());
SOAPBinding soapBinding = getAnnotation(clazz, SOAPBinding.class);
if (soapBinding != null) {
if (soapBinding.style() == SOAPBinding.Style.RPC && soapBinding.parameterStyle() == SOAPBinding.ParameterStyle.BARE) {
throw new RuntimeModelerException("runtime.modeler.invalid.soapbinding.parameterstyle",
soapBinding, clazz);
}
isWrapped = soapBinding.parameterStyle()== WRAPPED;
}
defaultBinding = createBinding(soapBinding);
/*
* if clazz != portClass then there is an SEI. If there is an
* SEI, then all methods should be processed. However, if there is
* no SEI, and the implementation class uses at least one
* WebMethod annotation, then only methods with this annotation
* will be processed.
*/
/* if (clazz == portClass) {
WebMethod webMethod;
for (Method method : clazz.getMethods()) {
webMethod = getPrivMethodAnnotation(method, WebMethod.class);
if (webMethod != null &&
!webMethod.exclude()) {
usesWebMethod = true;
break;
}
}
}*/
for (Method method : clazz.getMethods()) {
if (!clazz.isInterface()) { // if clazz is SEI, then all methods are web methods
if (method.getDeclaringClass() == Object.class) continue;
if (!getBooleanSystemProperty("com.sun.xml.internal.ws.legacyWebMethod")) { // legacy webMethod computation behaviour to be used
if (!isWebMethodBySpec(method, clazz))
continue;
} else {
if (!isWebMethod(method))
continue;
}
}
// TODO: binding can be null. We need to figure out how to post-process
// RuntimeModel to link to WSDLModel
processMethod(method);
}
//Add additional jaxb classes referenced by {@link XmlSeeAlso}
XmlSeeAlso xmlSeeAlso = getAnnotation(clazz, XmlSeeAlso.class);
if(xmlSeeAlso != null)
model.addAdditionalClasses(xmlSeeAlso.value());
}
示例14: setStyle
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
/**
* @param style The style to set.
*/
public void setStyle(Style style) {
this.style = style;
}
示例15: setStyle
import javax.jws.soap.SOAPBinding.Style; //导入依赖的package包/类
public void setStyle(Style style){
this.style = style;
}