[jboss-svn-commits] JBL Code SVN: r22930 - labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Sep 19 14:29:02 EDT 2008
Author: kevin.conner at jboss.com
Date: 2008-09-19 14:29:01 -0400 (Fri, 19 Sep 2008)
New Revision: 22930
Modified:
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java
labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java
Log:
Fix WSDL generation for consumption by .NET: JBESB-2052
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java 2008-09-19 16:08:45 UTC (rev 22929)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBContractGenerator.java 2008-09-19 18:29:01 UTC (rev 22930)
@@ -43,6 +43,7 @@
import javax.wsdl.PortType;
import javax.wsdl.Types;
import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.factory.WSDLFactory;
import javax.xml.namespace.QName;
@@ -60,6 +61,7 @@
import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
import com.ibm.wsdl.extensions.soap.SOAPBodyImpl;
import com.ibm.wsdl.extensions.soap.SOAPFaultImpl;
+import com.ibm.wsdl.extensions.soap.SOAPOperationImpl;
public class ESBContractGenerator {
private static final QName XSD_QN = new QName("http://www.w3.org/2001/XMLSchema", "schema");
@@ -141,7 +143,7 @@
try {
getWSDLFactory().newWSDLWriter().writeWSDL(def, sw);
} catch (WSDLException e) {
- new ConfigurationException("Failed to generate wsdl for service:" + serviceConfig.getCategory() + "/" + serviceConfig.getName() , e);
+ throw new ConfigurationException("Failed to generate wsdl for service:" + serviceConfig.getCategory() + "/" + serviceConfig.getName() , e);
}
return sw.toString();
}
@@ -252,13 +254,19 @@
BindingOperation bop = def.createBindingOperation();
bop.setName(serviceInfo.getOperationName());
+
Operation op = (Operation) portType.getOperations().get(0);
bop.setOperation(op);
+ SOAPOperation soapOperation = new SOAPOperationImpl() ;
+ soapOperation.setSoapActionURI(serviceInfo.getAction()) ;
+ bop.addExtensibilityElement(soapOperation) ;
+
if (op.getInput() != null) {
BindingInput binput = def.createBindingInput();
bop.setBindingInput(binput);
SOAPBodyImpl soapBody = new SOAPBodyImpl();
soapBody.setUse("literal");
+ binput.setName(serviceInfo.getRequestName()) ;
binput.addExtensibilityElement(soapBody);
}
if (op.getOutput() != null) {
@@ -266,6 +274,7 @@
bop.setBindingOutput(boutput);
SOAPBodyImpl soapBody = new SOAPBodyImpl();
soapBody.setUse("literal");
+ boutput.setName(serviceInfo.getResponseName()) ;
boutput.addExtensibilityElement(soapBody);
}
final Map faults = op.getFaults() ;
Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java 2008-09-19 16:08:45 UTC (rev 22929)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/webservice/ESBServiceEndpointInfo.java 2008-09-19 18:29:01 UTC (rev 22930)
@@ -48,6 +48,7 @@
private final String className ;
private final String namespace ;
private final boolean isOneWay ;
+ private final String action ;
public ESBServiceEndpointInfo(final Service service)
throws UnsupportedEncodingException {
@@ -67,6 +68,7 @@
packageName = "esb.ws." + serviceCategory + "." + serviceName ;
className = packageName + ".Implementation" ;
namespace = "http://soa.jboss.org/" + URLEncoder.encode(service.getCategory(), DEFAULT_ENCODING) ;
+ action = namespace + "/" + operationName ;
final Actions actions = service.getActions() ;
if (actions != null)
@@ -142,6 +144,10 @@
return namespace ;
}
+ public String getAction() {
+ return action ;
+ }
+
public boolean isOneWay() {
return isOneWay ;
}
More information about the jboss-svn-commits
mailing list