Author: mmao
Date: Thu Dec 27 00:14:26 2007
New Revision: 607018
URL: http://svn.apache.org/viewvc?rev=607018&view=rev
Log:
CXF-1341 Request ReferenceParameter not handled
* EndpointReferenceUtils used wrong addressing wsdl namespace caused the
getPort return null
* MAPCodec used a wrong REFERENCE_PARAM_ATTR_NAME caused interop with RI
failed
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java?rev=607018&r1=607017&r2=607018&view=diff
==============================================================================
---
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
(original)
+++
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/EndpointReferenceUtils.java
Thu Dec 27 00:14:26 2007
@@ -73,6 +73,7 @@
import org.apache.cxf.transport.MultiplexDestination;
import org.apache.cxf.ws.addressing.AttributedURIType;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
import org.apache.cxf.ws.addressing.MetadataType;
import org.apache.cxf.ws.addressing.wsdl.AttributedQNameType;
import org.apache.cxf.ws.addressing.wsdl.ServiceNameType;
@@ -89,11 +90,9 @@
private static final String WSDL_INSTANCE_NAMESPACE =
"http://www.w3.org/2006/01/wsdl-instance";
- private static final String WSA_WSDL_NAMESPACE =
- "http://www.w3.org/2005/02/addressing/wsdl";
- private static final String WSA_WSDL_NAMESPACE_PREFIX = "wsaw";
+
private static final QName WSA_WSDL_NAMESPACE_NS =
- new QName("xmlns:" + WSA_WSDL_NAMESPACE_PREFIX);
+ new QName("xmlns:" + JAXWSAConstants.WSAW_PREFIX);
private static final String XML_SCHEMA_NAMESPACE =
"http://www.w3.org/2001/XMLSchema";
private static final String XML_SCHEMA_NAMESPACE_PREFIX = "xs";
@@ -160,9 +159,9 @@
ServiceNameType serviceNameType =
WSA_WSDL_OBJECT_FACTORY.createServiceNameType();
serviceNameType.setValue(serviceName);
serviceNameType.setEndpointName(portName);
- serviceNameType.getOtherAttributes().put(WSA_WSDL_NAMESPACE_NS,
WSA_WSDL_NAMESPACE);
+ serviceNameType.getOtherAttributes().put(WSA_WSDL_NAMESPACE_NS,
JAXWSAConstants.NS_WSAW);
serviceNameType.getOtherAttributes().put(XSI_TYPE,
- WSA_WSDL_NAMESPACE_PREFIX +
":"
+ JAXWSAConstants.WSAW_PREFIX +
":"
+
serviceNameType.getClass().getSimpleName());
return WSA_WSDL_OBJECT_FACTORY.createServiceName(serviceNameType);
}
@@ -178,7 +177,7 @@
for (Object obj : metadata.getAny()) {
if (obj instanceof Element) {
Node node = (Element)obj;
- if (node.getNamespaceURI().equals(WSA_WSDL_NAMESPACE)
+ if (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW)
&& node.getLocalName().equals("ServiceName")) {
String content = node.getTextContent();
String namespaceURI =
node.getFirstChild().getNamespaceURI();
@@ -217,7 +216,7 @@
for (Object obj : metadata.getAny()) {
if (obj instanceof Element) {
Node node = (Element)obj;
- if (node.getNamespaceURI().equals(WSA_WSDL_NAMESPACE)
+ if (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW)
&& node.getNodeName().contains("ServiceName")) {
return
node.getAttributes().getNamedItem("EndpointName").getTextContent();
}
@@ -286,7 +285,7 @@
if (obj instanceof Element) {
Node node = (Element)obj;
System.out.println(node.getNamespaceURI() + ":" +
node.getNodeName());
- if (node.getNamespaceURI().equals(WSA_WSDL_NAMESPACE)
+ if (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW)
&& node.getNodeName().contains("InterfaceName")) {
String content = node.getTextContent();
Modified:
incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?rev=607018&r1=607017&r2=607018&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
(original)
+++
incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
Thu Dec 27 00:14:26 2007
@@ -60,6 +60,7 @@
import org.apache.cxf.ws.addressing.AttributedURIType;
import org.apache.cxf.ws.addressing.ContextUtils;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
import org.apache.cxf.ws.addressing.Names;
import org.apache.cxf.ws.addressing.ReferenceParametersType;
import org.apache.cxf.ws.addressing.RelatesToType;
@@ -73,7 +74,7 @@
public class MAPCodec extends AbstractSoapInterceptor {
private static final Logger LOG = LogUtils.getL7dLogger(MAPCodec.class);
- private static final String IS_REFERENCE_PARAM_ATTR_NAME =
"isReferenceParameter";
+ private static final String IS_REFERENCE_PARAM_ATTR_NAME =
"IsReferenceParameter";
/**
* REVISIT: map usage that the *same* interceptor instance
@@ -324,19 +325,19 @@
String pfx = lastAdded.lookupPrefix(namespaceURI);
if (StringUtils.isEmpty(pfx)) {
//attributes cannot be in empty namespace...
- if (lastAdded.lookupNamespaceURI("wsa") == null) {
- pfx = "wsa";
+ if (lastAdded.lookupNamespaceURI(JAXWSAConstants.WSA_PREFIX) ==
null) {
+ pfx = JAXWSAConstants.WSA_PREFIX;
lastAdded.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:wsa",
namespaceURI);
- } else if
(lastAdded.lookupNamespaceURI("wsa").equals(namespaceURI)) {
- pfx = "wsa";
+ } else if
(lastAdded.lookupNamespaceURI(JAXWSAConstants.WSA_PREFIX).equals(namespaceURI))
{
+ pfx = JAXWSAConstants.WSA_PREFIX;
} else {
int cnt = 1;
- while (lastAdded.lookupNamespaceURI("wsa" + cnt) != null) {
+ while (lastAdded.lookupNamespaceURI(JAXWSAConstants.WSA_PREFIX
+ cnt) != null) {
cnt++;
}
- pfx = "wsa" + cnt;
+ pfx = JAXWSAConstants.WSA_PREFIX + cnt;
lastAdded.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:wsa" + cnt,
namespaceURI);