當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。