summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-ws-xml/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-09-01 09:03:03 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-09-01 09:03:03 +0000
commitda7af9cb89b83b077e83d1e3b1a4b0add7d42308 (patch)
treeba3b14ea7b311dc12a6b8d56d64a1611b1098926 /java/sca/modules/binding-ws-xml/src
parente1c806a57e2ab1ed46f07710b438f273a6984f0b (diff)
TUSCANY-2242: Apply patch from Ramkumar Ramalingam for Incorrent port name in wsdlElement leads to NPE
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@690913 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-ws-xml/src')
-rw-r--r--java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java8
-rw-r--r--java/sca/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties4
2 files changed, 9 insertions, 3 deletions
diff --git a/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
index c472caac3a..15b58e499c 100644
--- a/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
+++ b/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
@@ -348,8 +348,12 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ
model.setService(service.getElement());
if (model.getPortName() != null) {
Port port = service.getElement().getPort(model.getPortName());
- model.setPort(port);
- model.setBinding(port.getBinding());
+ if (port != null) {
+ model.setPort(port);
+ model.setBinding(port.getBinding());
+ } else {
+ warning("WsdlPortTypeDoesNotMatch", wsdlDefinition, model.getPortName());
+ }
}
} else {
warning("WsdlServiceDoesNotMatch", wsdlDefinition, model.getServiceName());
diff --git a/java/sca/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties b/java/sca/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties
index 60a7e9e2f2..2dfa5e6133 100644
--- a/java/sca/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties
+++ b/java/sca/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties
@@ -21,6 +21,8 @@
InvalidWsdlElementAttr = Invalid WebService binding wsdlElement attribute: {0}
MustUseWsdlBinding = {0} must use wsdl.binding when using wsa:EndpointReference
InvalidInterfaceException = Exception creating interface from WSDL for binding: {0}
-WsdlBindingDoesNotMatch = The #wsdl.binding({0}) does not match with the WSDL Definitions
+WsdlBindingDoesNotMatch = The #wsdl.binding({0}) does not match with the WSDL Definitions
WsdlServiceDoesNotMatch = The #wsdl.service({0}) does not match with the WSDL Definitions
+WsdlPortTypeDoesNotMatch = The #wsdl.port({0}) does not match with the WSDL Definitions
+