conf.setVersion(Soap12.getInstance()); conf.setVersion(Soap12.getInstance()); conf.setMtomEnabled(true);
public void setRoles(Set<String> set) { if (set != null && (set.contains(Soap11.getInstance().getNoneRole()) || set.contains(Soap12.getInstance().getNoneRole()))) { throw new WebServiceException(BUNDLE.getString("NONE_ROLE_ERR")); } this.roles = set; addRequiredRoles(); }
private static void updateSoap12FaultCodes(SoapFault f) { //per Soap 1.2 spec, the fault code MUST be one of the 5 values specified in the spec. //Soap 1.1 allows the soap fault code to be arbitrary (recommends the 4 values in the spec, but //explicitely mentions that it can be extended to include additional codes). Soap 1.2 however //requires the use of one of the 5 defined codes. Additional detail or more specific information //can be transferred via the SubCodes. QName fc = f.getFaultCode(); SoapVersion v = Soap12.getInstance(); if (fc.getNamespaceURI().equals(Soap12.SOAP_NAMESPACE) && (fc.equals(v.getReceiver()) || fc.equals(v.getSender()) || fc.equals(v.getMustUnderstand()) || fc.equals(v.getDateEncodingUnknown()) || fc.equals(v.getVersionMismatch()))) { //valid fault codes, don't change anything return; } f.setFaultCode(Soap12.getInstance().getReceiver()); if (f.getSubCodes() == null) { f.setRootSubCode(fc); } else if (!f.getSubCodes().contains(fc)) { f.getSubCodes().add(fc); } } public static SoapFault createFault(Fault f, SoapVersion v) {
public void secureRequest(SoapMessage message) { SOAPMessage soapMessage = message.getContent(SOAPMessage.class); MessageInfo messageInfo = new GenericMessageInfo(soapMessage, null); String authContextID = clientConfig.getAuthContextID(messageInfo); Properties serverContextProperties = new Properties(); serverContextProperties.put("security-domain", securityDomain); serverContextProperties.put("jaspi-policy", jpi); Subject clientSubject = new Subject(); @SuppressWarnings("unused") AuthStatus authStatus = null; try { ClientAuthContext cctx = clientConfig.getAuthContext(authContextID, clientSubject, serverContextProperties); authStatus = cctx.secureRequest(messageInfo, clientSubject); } catch (AuthException e) { if (isSOAP12(message)) { SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getSender()); throw soap12Fault; } else { throw new SoapFault(e.getMessage(), new QName("", "japsi AuthException")); } } //TODO:look at how to handle AuthStatus }
private static void updateSoap12FaultCodes(SoapFault f) { //per Soap 1.2 spec, the fault code MUST be one of the 5 values specified in the spec. //Soap 1.1 allows the soap fault code to be arbitrary (recommends the 4 values in the spec, but //explicitely mentions that it can be extended to include additional codes). Soap 1.2 however //requires the use of one of the 5 defined codes. Additional detail or more specific information //can be transferred via the SubCodes. QName fc = f.getFaultCode(); SoapVersion v = Soap12.getInstance(); if (fc.getNamespaceURI().equals(Soap12.SOAP_NAMESPACE) && (fc.equals(v.getReceiver()) || fc.equals(v.getSender()) || fc.equals(v.getMustUnderstand()) || fc.equals(v.getDateEncodingUnknown()) || fc.equals(v.getVersionMismatch()))) { //valid fault codes, don't change anything return; } f.setFaultCode(Soap12.getInstance().getReceiver()); if (f.getSubCodes() == null) { f.setRootSubCode(fc); } else if (!f.getSubCodes().contains(fc)) { f.getSubCodes().add(fc); } } public static SoapFault createFault(Fault f, SoapVersion v) {
SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getSender()); throw soap12Fault;
if (namespace != null && cxfNamespace != null && !namespace.equals(cxfNamespace) && Soap12.SOAP_NAMESPACE.equals(namespace)) { cxfSoapMessage.setVersion(Soap12.getInstance()); cxfSoapMessage.put(Message.CONTENT_TYPE, cxfSoapMessage.getVersion().getContentType());
SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getReceiver()); throw soap12Fault;
SoapFault soap12Fault = new SoapFault( "Found anonymous address but non-anonymous required", Soap12.getInstance().getSender()); soap12Fault.addSubCode(new QName(Names.WSA_NAMESPACE_NAME, "OnlyNonAnonymousAddressSupported")); SoapFault soap12Fault = new SoapFault( "Found non-anonymous address but only anonymous supported", Soap12.getInstance().getSender()); soap12Fault.addSubCode(new QName(Names.WSA_NAMESPACE_NAME, "OnlyAnonymousAddressSupported"));
public void setRoles(Set<String> set) { if (set != null && (set.contains(Soap11.getInstance().getNoneRole()) || set.contains(Soap12.getInstance().getNoneRole()))) { throw new WebServiceException(BUNDLE.getString("NONE_ROLE_ERR")); } this.roles = set; addRequiredRoles(); }
/** * {@inheritDoc} */ public Object convert(Object sourceObject, ReifiedType targetType) throws Exception { if ("1.2".equals(sourceObject)) { return Soap12.getInstance(); } else if ("1.1".equals(sourceObject)) { return Soap11.getInstance(); } throw new IllegalArgumentException("Unimplemented SOAP version requested."); } }
faultCode = Soap12.getInstance().getReceiver(); exMessage = new Message("INVALID_FAULT", LOG).toString();
SoapFault soap12Fault = new SoapFault( "Found anonymous address but non-anonymous required", Soap12.getInstance().getSender()); soap12Fault.addSubCode(new QName(Names.WSA_NAMESPACE_NAME, "OnlyNonAnonymousAddressSupported")); SoapFault soap12Fault = new SoapFault( "Found non-anonymous address but only anonymous supported", Soap12.getInstance().getSender()); soap12Fault.addSubCode(new QName(Names.WSA_NAMESPACE_NAME, "OnlyAnonymousAddressSupported"));
private void resolveSoapVersion(String n) { if (WSDLConstants.NS_SOAP11.equalsIgnoreCase(n)) { this.soapVersion = Soap11.getInstance(); } else if (WSDLConstants.NS_SOAP12.equalsIgnoreCase(n)) { this.soapVersion = Soap12.getInstance(); } else { throw new RuntimeException("Unknow bindingId: " + n + ". Can not resolve the SOAP version"); } }
faultCode = Soap12.getInstance().getReceiver(); exMessage = new Message("INVALID_FAULT", LOG).toString();
Soap12.getInstance().getSender()); soap12Fault.setSubCode(new QName(Names.WSA_NAMESPACE_NAME, ContextUtils .retrieveMAPFaultName(message)));
/** * {@inheritDoc} */ public Object convert(Object sourceObject, ReifiedType targetType) throws Exception { if ("1.2".equals(sourceObject)) { return Soap12.getInstance(); } else if ("1.1".equals(sourceObject)) { return Soap11.getInstance(); } throw new IllegalArgumentException("Unimplemented SOAP version requested."); } }
SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getReceiver()); throw soap12Fault;
Soap12.getInstance().getSender()); soap12Fault.setSubCode(new QName(Names.WSA_NAMESPACE_NAME, ContextUtils .retrieveMAPFaultName(message)));
private void resolveSoapVersion(String n) { if (WSDLConstants.NS_SOAP11.equalsIgnoreCase(n)) { this.soapVersion = Soap11.getInstance(); } else if (WSDLConstants.NS_SOAP12.equalsIgnoreCase(n)) { this.soapVersion = Soap12.getInstance(); } else { throw new RuntimeException("Unknow bindingId: " + n + ". Can not resolve the SOAP version"); } }