本文整理汇总了Java中com.sun.xml.internal.ws.resources.ServerMessages类的典型用法代码示例。如果您正苦于以下问题:Java ServerMessages类的具体用法?Java ServerMessages怎么用?Java ServerMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerMessages类属于com.sun.xml.internal.ws.resources包,在下文中一共展示了ServerMessages类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWSDLOperationMapping
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
WSDLOperationMapping opName;
for(WSDLOperationFinder finder: opFinders) {
opName = finder.getWSDLOperationMapping(request);
if(opName != null)
return opName;
}
//No way to dispatch this request
String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
request.soapAction, request.getMessage().getPayloadNamespaceURI(),
request.getMessage().getPayloadLocalPart());
String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
throw new DispatchException(faultMsg);
}
示例2: getWSDLOperationMapping
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
*
* @return not null if it finds a unique handler for the request
* null if it cannot idenitify a unique wsdl operation from the Payload QName.
*
* @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
* any operation in the port.
*/
// public QName getWSDLOperationQName(Packet request) throws DispatchException{
public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
Message message = request.getMessage();
String localPart = message.getPayloadLocalPart();
String nsUri;
if (localPart == null) {
localPart = EMPTY_PAYLOAD_LOCAL;
nsUri = EMPTY_PAYLOAD_NSURI;
} else {
nsUri = message.getPayloadNamespaceURI();
if(nsUri == null)
nsUri = EMPTY_PAYLOAD_NSURI;
}
WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);
// Check if payload itself is correct. Usually it is, so let us check last
if (op == null && !unique.containsKey(nsUri,localPart)) {
String dispatchKey = "{" + nsUri + "}" + localPart;
String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
}
return op;
}
示例3: getWSDLOperationQName
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
*
* @param request Packet
* @return QName of the wsdl operation.
* @throws DispatchException if a unique operartion cannot be associated with this packet.
*/
public @NotNull QName getWSDLOperationQName(Packet request) throws DispatchException {
QName opName;
for(WSDLOperationFinder finder: opFinders) {
opName = finder.getWSDLOperationQName(request);
if(opName != null)
return opName;
}
//No way to dispatch this request
String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
request.soapAction, request.getMessage().getPayloadNamespaceURI(),
request.getMessage().getPayloadLocalPart());
String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
throw new DispatchException(faultMsg);
}
示例4: getWSDLOperationQName
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
*
* @return not null if it finds a unique handler for the request
* null if it cannot idenitify a unique wsdl operation from the Payload QName.
*
* @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
* any operation in the port.
*/
public QName getWSDLOperationQName(Packet request) throws DispatchException{
Message message = request.getMessage();
String localPart = message.getPayloadLocalPart();
String nsUri;
if (localPart == null) {
localPart = EMPTY_PAYLOAD_LOCAL;
nsUri = EMPTY_PAYLOAD_NSURI;
} else {
nsUri = message.getPayloadNamespaceURI();
if(nsUri == null)
nsUri = EMPTY_PAYLOAD_NSURI;
}
QName op = methodHandlers.get(nsUri, localPart);
// Check if payload itself is correct. Usually it is, so let us check last
if (op == null && !unique.containsKey(nsUri,localPart)) {
String dispatchKey = "{" + nsUri + "}" + localPart;
String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
}
return op;
}
示例5: findAnnotatedMethod
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
* Finds the method that has the given annotation, while making sure that
* there's only at most one such method.
*/
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
boolean once = false;
Method r = null;
for(Method method : clazz.getDeclaredMethods()) {
if (method.getAnnotation(annType) != null) {
if (once)
throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
if (method.getParameterTypes().length != 0)
throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
r = method;
once = true;
}
}
return r;
}
示例6: generateWSDL
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
* Generates the WSDL and XML Schema for the endpoint if necessary
* It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
*/
private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
Container container, Class implType) {
BindingID bindingId = binding.getBindingId();
if (!bindingId.canGenerateWSDL()) {
throw new ServerRtException("can.not.generate.wsdl", bindingId);
}
if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
logger.warning(msg);
}
// Generate WSDL and schema documents using runtime model
WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
wsdlGen.doGeneration();
return wsdlResolver.updateDocs();
}
示例7: createDuplicateHeaderException
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
private SOAPFaultException createDuplicateHeaderException() {
try {
SOAPFault fault = soapVersion.getSOAPFactory().createFault();
fault.setFaultCode(soapVersion.faultCodeServer);
fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
return new SOAPFaultException(fault);
} catch(SOAPException e) {
throw new WebServiceException(e);
}
}
示例8: getImplementorClass
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
* Loads the class of the given name.
*
* @param xsr Used to report the source location information if there's any error.
*/
private Class getImplementorClass(String name, XMLStreamReader xsr) {
try {
return Class.forName(name, true, classLoader);
} catch (ClassNotFoundException e) {
logger.log(Level.SEVERE, e.getMessage(), e);
throw new LocatableWebServiceException(
ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr);
}
}
示例9: publish
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
public void publish(Object serverContext) {
if (serverContext instanceof javax.xml.ws.spi.http.HttpContext) {
setHandler((javax.xml.ws.spi.http.HttpContext)serverContext);
return;
}
if (serverContext instanceof HttpContext) {
this.httpContext = (HttpContext)serverContext;
setHandler(httpContext);
return;
}
throw new ServerRtException(ServerMessages.NOT_KNOW_HTTP_CONTEXT_TYPE(
serverContext.getClass(), HttpContext.class,
javax.xml.ws.spi.http.HttpContext.class));
}
示例10: createDuplicateHeaderException
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
private SOAPFaultException createDuplicateHeaderException() {
try {
SOAPFault fault = soapVersion.getSOAPFactory().createFault();
fault.setFaultCode(soapVersion.faultCodeClient);
fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
return new SOAPFaultException(fault);
} catch(SOAPException e) {
throw new WebServiceException(e);
}
}
示例11: generateWSDL
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
* Generates the WSDL and XML Schema for the endpoint if necessary
* It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
*/
private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
Container container, Class implType) {
BindingID bindingId = binding.getBindingId();
if (!bindingId.canGenerateWSDL()) {
throw new ServerRtException("can.not.generate.wsdl", bindingId);
}
if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
logger.warning(msg);
}
// Generate WSDL and schema documents using runtime model
WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
wsdlGenInfo.setWsdlResolver(wsdlResolver);
wsdlGenInfo.setContainer(container);
wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
wsdlGenInfo.setInlineSchemas(false);
wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
// WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
// ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
// wsdlGen.doGeneration();
return wsdlResolver.updateDocs();
}
示例12: createBuilder
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
static XMLProviderArgumentBuilder createBuilder(ProviderEndpointModel model, WSBinding binding) {
if (model.mode == Service.Mode.PAYLOAD) {
return new PayloadSource();
} else {
if(model.datatype==Source.class)
return new PayloadSource();
if(model.datatype== DataSource.class)
return new DataSourceParameter(binding);
throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
}
}
示例13: create
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
static ProviderArgumentsBuilder create(ProviderEndpointModel model, SOAPVersion soapVersion) {
if (model.mode == Service.Mode.PAYLOAD) {
return new PayloadSource(soapVersion);
} else {
if(model.datatype==Source.class)
return new MessageSource(soapVersion);
if(model.datatype==SOAPMessage.class)
return new SOAPMessageParameter(soapVersion);
if(model.datatype==Message.class)
return new MessageProviderArgumentBuilder(soapVersion);
throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
}
}
示例14: generateWSDL
import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
* Generates the WSDL and XML Schema for the endpoint if necessary
* It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
*/
private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, Collection<SDDocumentImpl> docs,
Container container, Class implType) {
BindingID bindingId = binding.getBindingId();
if (!bindingId.canGenerateWSDL()) {
throw new ServerRtException("can.not.generate.wsdl", bindingId);
}
if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
logger.warning(msg);
}
// Generate WSDL and schema documents using runtime model
WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
wsdlGenInfo.setWsdlResolver(wsdlResolver);
wsdlGenInfo.setContainer(container);
wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
wsdlGenInfo.setInlineSchemas(false);
wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
// WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
// ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
// wsdlGen.doGeneration();
return wsdlResolver.updateDocs();
}