当前位置: 首页>>代码示例>>Java>>正文


Java SOAPBinding类代码示例

本文整理汇总了Java中javax.jws.soap.SOAPBinding的典型用法代码示例。如果您正苦于以下问题:Java SOAPBinding类的具体用法?Java SOAPBinding怎么用?Java SOAPBinding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SOAPBinding类属于javax.jws.soap包,在下文中一共展示了SOAPBinding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: popSoapBinding

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
protected SOAPBinding popSoapBinding() {
    if (pushedSoapBinding)
        soapBindingStack.pop();
    SOAPBinding soapBinding = null;
    if (!soapBindingStack.empty()) {
        soapBinding = soapBindingStack.peek();
        if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
            soapStyle = SOAPStyle.RPC;
            wrapped = true;
        } else {
            soapStyle = SOAPStyle.DOCUMENT;
            wrapped = soapBinding.parameterStyle().equals(ParameterStyle.WRAPPED);
        }
    } else {
            pushedSoapBinding = false;
    }
    return soapBinding;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:WebServiceVisitor.java

示例2: updateAccount

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
@WebResult(name = "CorporateAccount")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public CorporateAccount updateAccount(Account account) {
	LOGGER.info("Updating Account: {}", account);

	// Create new Corporate Account
	CorporateAccount ca = new CorporateAccount();
	ca.setCompany(account.getCompany());
	ca.setContact(account.getContact());
	ca.setId(genRandom());
	ca.setSalesContact(getRandomSales(sales));
	
	LOGGER.info("New CorporateAccount created: {}", ca);

	return ca;
}
 
开发者ID:rmarting,项目名称:fis-demo,代码行数:17,代码来源:CustomerWSImpl.java

示例3: create

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
@WebMethod(operationName = "Create", action = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Create")
@Action(input = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Create", output = "http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse")
@WebResult(name = "ResourceCreated", targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/transfer", partName = "ResourceCreated")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public ResourceCreated create(
    @WebParam(name = "Shell", targetNamespace = "http://schemas.microsoft.com/wbem/wsman/1/windows/shell")
    Shell shell,
    @WebParam(name = "ResourceURI", targetNamespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", header = true)
    String resourceURI,
    @WebParam(name = "MaxEnvelopeSize", targetNamespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", header = true)
    int maxEnvelopeSize,
    @WebParam(name = "OperationTimeout", targetNamespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", header = true)
    String operationTimeout,
    @WebParam(name = "Locale", targetNamespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", header = true)
    Locale locale,
    @WebParam(name = "OptionSet", targetNamespace = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd", header = true)
    OptionSetType optionSet
) {
    return null;
}
 
开发者ID:cloudsoft,项目名称:winrm4j,代码行数:21,代码来源:WinRm.java

示例4: convertOperationParametersToGui

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
public static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod, WSDynamicClient client) {
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client, true);
TreeNodeImpl rootElement = new TreeNodeImpl();
Collection<? extends WebParameter> parameters = wsMethod.getWebParams().values();
SOAPBinding soapBindingAnn = wsMethod.getEndpoint().getUnderlyingObjectClass().getAnnotation(SOAPBinding.class);
boolean rpcLit = false;
if (soapBindingAnn != null) {
    SOAPBinding.Style style = soapBindingAnn.style();
    rpcLit = style != null && SOAPBinding.Style.RPC.equals(style);
}
for (WebParameter parameter : parameters) {
    if (parameter.getMode() != WebParam.Mode.OUT) {
	WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName(), null, !rpcLit);
	rootElement.addChild(wte.getId(), wte);
    }
}
return rootElement;
   }
 
开发者ID:chtiJBUG,项目名称:wise-webui,代码行数:19,代码来源:ClientHelper.java

示例5: createDocLitMethodMarshaller

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
private static MethodMarshaller createDocLitMethodMarshaller(OperationDescription op,
                                                             boolean isClient,
                                                             ClassLoader cl) {
    SOAPBinding.ParameterStyle parameterStyle = null;
    SUBTYPE subType = SUBTYPE.NORMAL;
    if (isDocLitBare(op)) {
        if (isDocLitBareMinimal(op, cl)) {
            subType = SUBTYPE.MINIMAL;
        }
        parameterStyle = SOAPBinding.ParameterStyle.BARE;
    } else {
        if (isDocLitWrappedMinimal(op)) {
            subType = SUBTYPE.MINIMAL;
        } else if (isDocLitWrappedPlus(op)) {
            subType = SUBTYPE.PLUS;
        }
        parameterStyle = SOAPBinding.ParameterStyle.WRAPPED;
    }
    return createMethodMarshaller(SOAPBinding.Style.DOCUMENT, parameterStyle, subType,
                                  isClient);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:MethodMarshallerFactory.java

示例6: swaAttachment

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
/**
 * This method passes an SWA attachment as a request
 * and expects an SWA attachment as a response.
 * Note that the body content in both cases is empty.
 * (See the wsdl)
 * @param attachment (swa)
 * @return attachment (swa)
 */
@WebMethod(operationName="swaAttachment", action="swaAttachment")
@XmlJavaTypeAdapter(HexBinaryAdapter.class)
@WebResult(name = "jpegImageResponse", targetNamespace = "", partName = "jpegImageResponse")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public byte[] swaAttachment(
      @XmlJavaTypeAdapter(HexBinaryAdapter.class)
      @WebParam(name = "jpegImageRequest", targetNamespace = "", partName = "jpegImageRequest")
      byte[] attachment) {
    if (attachment == null || attachment.length == 0){
        throw new RuntimeException("Received empty attachment");
    } else {
        // Change the first three characters and return the attachment
        attachment[0] = 'S';
        attachment[1] = 'W';
        attachment[2] = 'A';
    }
    return attachment;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:SWAMTOMPortTypeImpl.java

示例7: mtomAttachment

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
@WebMethod(operationName="mtomAttachment", action="mtomAttachment")
@SOAPBinding(parameterStyle=ParameterStyle.BARE)
public void mtomAttachment(Holder<byte[]> message) {

    byte[] attachment = message.value;

    if (attachment == null || attachment.length == 0){
        throw new RuntimeException("Received empty mtom attachment");
    } else {
        // Change the first characters
        attachment[0] = 'X';
        attachment[1] = 'O';
        attachment[2] = 'P';
    }

    message.value = attachment;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:18,代码来源:SWAMTOMPortTypeImpl.java

示例8: getAnnoWebParamName

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
public String getAnnoWebParamName() {
    if (webParamName == null) {
        if (getAnnoWebParam() != null && !DescriptionUtils.isEmpty(getAnnoWebParam().name())) {
            webParamName = getAnnoWebParam().name();
        } else if (getOperationDescription().getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT
                && getOperationDescription().getSoapBindingParameterStyle() ==
                SOAPBinding.ParameterStyle.BARE) {
            // Defaul per JSR-181 MR Sec 4.4.1, pg 19
            // TODO: Validation: For BARE paramaterUse, only a single IN our INOUT paramater and a single output (either return or OUT or INOUT) is allowed
            //       Per JSR-224, Sec 3.6.2.2, pg 37
            webParamName = getOperationDescription().getOperationName();
        } else {
            // Default per JSR-181 MR Sec 4.4.1, pg 20
            // Return "argN" where N is the index of the parameter in the method signature
            webParamName = "arg" + parameterNumber;
        }
    }
    return webParamName;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:ParameterDescriptionImpl.java

示例9: getAnnoWebResultTargetNamespace

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
public String getAnnoWebResultTargetNamespace() {
    if (!isOperationReturningResult()) {
        return null;
    }
    if (webResultTargetNamespace == null) {
        if (getAnnoWebResult() != null &&
                !DescriptionUtils.isEmpty(getAnnoWebResult().targetNamespace())) {
            webResultTargetNamespace = getAnnoWebResult().targetNamespace();
        } else if (getAnnoSoapBindingStyle() == SOAPBinding.Style.DOCUMENT
                && getAnnoSoapBindingParameterStyle() == SOAPBinding.ParameterStyle.WRAPPED
                && !getAnnoWebResultHeader()) {
            // Default for operation style DOCUMENT and paramater style WRAPPED and the return value
            // does not map to a header per JSR-181 MR Sec 4.5.1, pg 23-24
            webResultTargetNamespace = WebResult_TargetNamespace_DEFAULT;
        } else {
            // Default is the namespace from the WebService per JSR-181 MR Sec 4.5.1, pg 23-24
            webResultTargetNamespace =
                    ((EndpointDescriptionJava)getEndpointInterfaceDescription()
                            .getEndpointDescription()).getAnnoWebServiceTargetNamespace();
        }

    }
    return webResultTargetNamespace;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:OperationDescriptionImpl.java

示例10: testSOAPBindingDefault

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
public void testSOAPBindingDefault() {
    EndpointInterfaceDescription testEndpointInterfaceDesc =
            getEndpointInterfaceDesc(SOAPBindingDefaultTestImpl.class);

    assertNull(
            ((EndpointInterfaceDescriptionJava)testEndpointInterfaceDesc).getAnnoSoapBinding());
    assertEquals(javax.jws.soap.SOAPBinding.Style.DOCUMENT,
                 testEndpointInterfaceDesc.getSoapBindingStyle());
    assertEquals(javax.jws.soap.SOAPBinding.Use.LITERAL,
                 testEndpointInterfaceDesc.getSoapBindingUse());
    assertEquals(javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED,
                 testEndpointInterfaceDesc.getSoapBindingParameterStyle());

    OperationDescription operationDesc =
            testEndpointInterfaceDesc.getOperationForJavaMethod("echoString")[0];
    // Verify WebResult annotation default values for DOC/LIT/WRAPPED from a defaulted SOAPBinding
    assertNull(((OperationDescriptionJava)operationDesc).getAnnoWebResult());
    assertEquals("return", operationDesc.getResultName());
    assertEquals("return", operationDesc.getResultPartName());
    assertEquals("", operationDesc.getResultTargetNamespace());
    assertFalse(operationDesc.isResultHeader());

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:AnnotationServiceImplDescriptionTests.java

示例11: createBinding

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
/**
 * creates a runtime model <code>SOAPBinding</code> from a <code>javax.jws.soap.SOAPBinding</code> object
 * @param soapBinding the <code>javax.jws.soap.SOAPBinding</code> to model
 * @return returns the runtime model SOAPBinding corresponding to <code>soapBinding</code>
 */
protected SOAPBindingImpl createBinding(SOAPBinding soapBinding) {
    SOAPBindingImpl rtSOAPBinding = new SOAPBindingImpl();
    Style style = soapBinding!=null ? soapBinding.style() : Style.DOCUMENT;
    rtSOAPBinding.setStyle(style);
    assert bindingId != null;
    model.bindingId = bindingId;
    SOAPVersion soapVersion = bindingId.getSOAPVersion();
    rtSOAPBinding.setSOAPVersion(soapVersion);
    return rtSOAPBinding;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:RuntimeModeler.java

示例12: writeSOAPBinding

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
private void writeSOAPBinding(Port port, JDefinedClass cls) {
    JAnnotationUse soapBindingAnn = null;
    isDocStyle = port.getStyle() == null || port.getStyle().equals(SOAPStyle.DOCUMENT);
    if(!isDocStyle){
        soapBindingAnn = cls.annotate(SOAPBinding.class);
        soapBindingAnn.param("style", SOAPBinding.Style.RPC);
        port.setWrapped(true);
    }
    if(isDocStyle){
        boolean first = true;
        boolean isWrapper = true;
        for(Operation operation:port.getOperations()){
            if(first){
                isWrapper = operation.isWrapped();
                first = false;
                continue;
            }
            sameParamStyle = (isWrapper == operation.isWrapped());
            if (!sameParamStyle) {
                break;
            }
        }
        if (sameParamStyle) {
            port.setWrapped(isWrapper);
        }
    }
    if(sameParamStyle && !port.isWrapped()){
        if (soapBindingAnn == null) {
            soapBindingAnn = cls.annotate(SOAPBinding.class);
        }
        soapBindingAnn.param("parameterStyle", SOAPBinding.ParameterStyle.BARE);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:SeiGenerator.java

示例13: preProcessWebService

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:WebServiceVisitor.java

示例14: visitExecutable

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
@Override
public Void visitExecutable(ExecutableElement method, Object o) {
    // Methods must be public
    if (!method.getModifiers().contains(Modifier.PUBLIC))
        return null;
    if (processedMethod(method))
        return null;
    WebMethod webMethod = method.getAnnotation(WebMethod.class);
    if (webMethod != null && webMethod.exclude())
        return null;
    SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
    if (soapBinding == null && !method.getEnclosingElement().equals(typeElement)) {
        if (method.getEnclosingElement().getKind().equals(ElementKind.CLASS)) {
            soapBinding = method.getEnclosingElement().getAnnotation(SOAPBinding.class);
            if (soapBinding != null)
                builder.log("using " + method.getEnclosingElement() + "'s SOAPBinding.");
            else {
                soapBinding = new MySoapBinding();
            }
        }
    }
    boolean newBinding = false;
    if (soapBinding != null) {
        newBinding = pushSoapBinding(soapBinding, method, typeElement);
    }
    try {
        if (shouldProcessMethod(method, webMethod)) {
            processMethod(method, webMethod);
        }
    } finally {
        if (newBinding) {
            popSoapBinding();
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:WebServiceVisitor.java

示例15: getPaneConfiguration

import javax.jws.soap.SOAPBinding; //导入依赖的package包/类
/**
 * Retrieve the pane configuration for a pane token.
 */
@WebMethod(operationName = "GetPaneConfiguration", action = "http://www.onvif.org/ver10/display/wsdl/GetPaneConfiguration")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "GetPaneConfigurationResponse", targetNamespace = "http://www.onvif.org/ver10/display/wsdl", partName = "parameters")
public GetPaneConfigurationResponse getPaneConfiguration(
    @WebParam(partName = "parameters", name = "GetPaneConfiguration", targetNamespace = "http://www.onvif.org/ver10/display/wsdl")
    GetPaneConfiguration parameters
);
 
开发者ID:fpompermaier,项目名称:onvif,代码行数:11,代码来源:DisplayPort.java


注:本文中的javax.jws.soap.SOAPBinding类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。