Author: palin
Date: 2007-05-07 17:57:25 -0400 (Mon, 07 May 2007)
New Revision: 2998
Removed:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/META-INF/wsdl/PolicyAttachmentFragment.wsdl
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl
Log:
Bug fix on WSDL11Reader (namespace attribute adding with policy elements)
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-05-07
21:42:10 UTC (rev 2997)
+++
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-05-07
21:57:25 UTC (rev 2998)
@@ -28,7 +28,6 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -482,44 +481,44 @@
}
WSDLService wsdlService =
wsdlDefinitions.getService(epMetaData.getServiceMetaData().getServiceName().getLocalPart());
-
- System.out.println("****** getPortName="+epMetaData.getPortName());
- System.out.println("******
getPortTypeName="+epMetaData.getPortTypeName());
- System.out.println("****** get mio
endpoint="+wsdlService.getEndpoint(epMetaData.getPortName()));
- System.out.println("****** Endpoints: ");
- for (int i=0;i<wsdlService.getEndpoints().length; i++) {
- WSDLEndpoint end = wsdlService.getEndpoints()[i];
- System.out.println("****** "+i+") "+end);
- System.out.println("****** "+i+") qname: "+end.getName());
- }
- System.out.println("****** Interfaces: ");
- for (int i=0;i<wsdlDefinitions.getInterfaces().length; i++) {
- System.out.println("****** "+i+")
"+wsdlDefinitions.getInterfaces()[i]);
- }
- System.out.println("****** Bindings: ");
- for (int i=0;i<wsdlDefinitions.getBindings().length; i++) {
- System.out.println("****** "+i+")
"+wsdlDefinitions.getBindings()[i]);
- }
-
WSDLEndpoint wsdlEndpoint = wsdlService.getEndpoint(epMetaData.getPortName());
WSDLInterface wsdlInterface =
wsdlDefinitions.getInterface(epMetaData.getPortTypeName());
WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(epMetaData.getPortTypeName());
//Port scope
- List<WSDLExtensibilityElement> portPolicyRefList =
wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
- deployPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT, localPolicyRegistry,
epMetaData);
+ if (wsdlEndpoint != null)
+ {
+ List<WSDLExtensibilityElement> portPolicyRefList =
wsdlEndpoint.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ deployPolicies(portPolicyRefList, PolicyScopeLevel.WSDL_PORT,
localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get port '"+epMetaData.getPortName()+"'
from the given wsdl definitions!");
+ }
//Binding scope
- List<WSDLExtensibilityElement> bindingPolicyRefList =
wsdlBinding.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
- deployPolicies(bindingPolicyRefList, PolicyScopeLevel.WSDL_BINDING,
localPolicyRegistry, epMetaData);
+ if (wsdlBinding != null)
+ {
+ List<WSDLExtensibilityElement> bindingPolicyRefList =
wsdlBinding.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE);
+ deployPolicies(bindingPolicyRefList, PolicyScopeLevel.WSDL_BINDING,
localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get binding for portType
'"+epMetaData.getPortTypeName()+"' from the given wsdl
definitions!");
+ }
//PortType scope
- List<WSDLExtensibilityElement> portTypePolicyRefList =
wsdlInterface.getExtensibilityElements(Constants.WSDL_PROPERTY_POLICYURIS);
- deployPolicies(portTypePolicyRefList, PolicyScopeLevel.WSDL_PORT_TYPE,
localPolicyRegistry, epMetaData);
-
+ if (wsdlInterface != null)
+ {
+ List<WSDLExtensibilityElement> portTypePolicyRefList =
wsdlInterface.getExtensibilityElements(Constants.WSDL_PROPERTY_POLICYURIS);
+ deployPolicies(portTypePolicyRefList, PolicyScopeLevel.WSDL_PORT_TYPE,
localPolicyRegistry, epMetaData);
+ }
+ else
+ {
+ log.warn("Cannot get portType
'"+epMetaData.getPortTypeName()+"' from the given wsdl
definitions!");
+ }
}
-
private void deployPolicies(List<WSDLExtensibilityElement> policyReferences,
PolicyScopeLevel scope, PolicyRegistry localPolicies, ExtensibleMetaData extMetaData)
{
if (policyReferences != null && policyReferences.size() != 0 &&
extMetaData instanceof ServerEndpointMetaData)
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
---
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-05-07
21:42:10 UTC (rev 2997)
+++
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-05-07
21:57:25 UTC (rev 2998)
@@ -367,7 +367,8 @@
}
if (prefix!=null && nsUri == null)
{
- destElement.setAttribute("xmlns:"+prefix,
srcElement.lookupNamespaceURI(prefix));
+
destElement.setAttributeNS(Constants.NS_XMLNS,"xmlns:"+prefix,srcElement.lookupNamespaceURI(prefix));
+
}
NamedNodeMap attributes = destElement.getAttributes();
@@ -377,7 +378,7 @@
String attrPrefix = attr.getPrefix();
if (attrPrefix!=null && !attr.getName().startsWith("xmlns")
&& destElement.lookupNamespaceURI(attrPrefix) == null)
{
- destElement.setAttribute("xmlns:"+attrPrefix,
srcElement.lookupNamespaceURI(attrPrefix));
+
destElement.setAttributeNS(Constants.NS_XMLNS,"xmlns:"+attrPrefix,srcElement.lookupNamespaceURI(attrPrefix));
}
}
NodeList childrenList = destElement.getChildNodes();
Deleted:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/META-INF/wsdl/PolicyAttachmentFragment.wsdl
===================================================================
---
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/META-INF/wsdl/PolicyAttachmentFragment.wsdl 2007-05-07
21:42:10 UTC (rev 2997)
+++
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/META-INF/wsdl/PolicyAttachmentFragment.wsdl 2007-05-07
21:57:25 UTC (rev 2998)
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<definitions name="TestService"
targetNamespace="http://org.jboss.ws/jaxrpc"
- xmlns:tns="http://org.jboss.ws/jaxrpc"
-
xmlns="http://schemas.xmlsoap.org/wsdl/"
-
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-
xmlns:fab="http://www.fabrikam123.example.com/stock"
-
xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
-
xmlns:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_...
-
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
-
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
>
- <wsp:Policy wsu:Id="X509EndpointPolicy" >
- <sp:jboss-ws-security>
- <sp:key-store-file>WEB-INF/wsse.keystore</sp:key-store-file>
- <sp:key-store-password>jbossws</sp:key-store-password>
- <sp:trust-store-file>WEB-INF/wsse.truststore</sp:trust-store-file>
- <sp:trust-store-password>jbossws</sp:trust-store-password>
- <sp:config>
- <sp:encrypt type="x509v3" alias="wsse"/>
- <sp:requires>
- <sp:encryption/>
- </sp:requires>
- </sp:config>
- </sp:jboss-ws-security>
- </wsp:Policy>
- <binding name='HelloBinding' type='tns:Hello'>
- <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
- <wsp:PolicyReference URI="#X509EndpointPolicy"
wsdl:required="true" />
- <operation name='echoUserType'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body namespace='http://org.jboss.ws/samples/wssecurity'
use='literal'/>
- </input>
- <output>
- <soap:body namespace='http://org.jboss.ws/samples/wssecurity'
use='literal'/>
- </output>
- </operation>
- </binding>
- <service name='HelloService'>
- <port binding='tns:HelloBinding' name='HelloPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
-</definitions>
Modified:
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl
===================================================================
---
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl 2007-05-07
21:42:10 UTC (rev 2997)
+++
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/PolicyAttachmentFragment.wsdl 2007-05-07
21:57:25 UTC (rev 2998)
@@ -6,8 +6,6 @@
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-
xmlns:fab="http://www.fabrikam123.example.com/stock"
-
xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
xmlns:sp="http://www.jboss.com/ws-security/schema/jboss-ws-security_...
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...