[jboss-svn-commits] JBL Code SVN: r27446 - in labs/jbossesb/workspace/dward/wsproxy/product: samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 2 11:36:26 EDT 2009


Author: dward
Date: 2009-07-02 11:36:26 -0400 (Thu, 02 Jul 2009)
New Revision: 27446

Modified:
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
   labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
   labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
Log:
better debugging/docs over soapaction


Modified: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt	2009-07-02 15:13:34 UTC (rev 27445)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/readme.txt	2009-07-02 15:36:26 UTC (rev 27446)
@@ -18,7 +18,7 @@
   	- In your server console, you will see output like this:
 
 02:21:53,792 INFO  [SOAPProxy] mapped soapaction [] to binding [HelloWorldBinding]
-02:21:53,792 INFO  [SOAPProxy] also mapped soapaction [""] to binding [HelloWorldBinding]
+02:21:53,792 INFO  [SOAPProxy] mapped soapaction [""] to binding [HelloWorldBinding]
 02:21:53,793 INFO  [SOAPProxy] mapped operation [sayHello] to binding [HelloWorldBinding]
 02:21:53,807 INFO  [SOAPProxy] mapped binding [HelloWorldBinding] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS]
 
@@ -77,9 +77,10 @@
 	3) echo out the outgoing SOAP response.
 	Configuration:
 	- wsdl (required): The original wsdl url whose WS endpoint will get re-written and exposed as
-	new wsdl from the ESB.  Depending upon the <definitions><service><port><soap:address location
-	attribute's protocol (for example "http"), a protocol-specific SOAPProxyTransport
-	implementation is used.
+	new wsdl from the ESB:
+	http://localhost:8080/contract/contract.jsp?serviceCat=WSProxy_Basic&serviceName=WSProxy&protocol=http
+	Depending upon the <definitions><service><port><soap:address location attribute's protocol
+	(for example "http"), a protocol-specific SOAPProxyTransport implementation is used.
 	For other possible configuration properties, see the specific SOAPProxyTransport implementations
 	themselves.
 

Modified: labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java	2009-07-02 15:13:34 UTC (rev 27445)
+++ labs/jbossesb/workspace/dward/wsproxy/product/samples/quickstarts/webservice_wsproxy_basic/src/org/jboss/soa/esb/samples/quickstart/webservice_wsproxy_basic/test/SendWSMessage.java	2009-07-02 15:36:26 UTC (rev 27446)
@@ -55,8 +55,8 @@
 			// for testing main method from Eclipse (build.xml passes these args in)
 			args = new String[2];
 			//args[0] = "http://localhost:8080/Quickstart_webservice_wsproxy_basic/HelloWorldWS"; // original ws ("ant runws")
-			args[0] = "http://localhost:9090"; // jbr gateway ("ant runjbr" or "ant runtest")
-			//args[0] = "http://localhost:9999/WSProxy_Basic/HelloWorldWS/"; // http gateway ("ant runhttp")
+			args[0] = "http://localhost:9090"; // proxy via jbr gateway ("ant runjbr" or "ant runtest")
+			//args[0] = "http://localhost:9999/WSProxy_Basic/HelloWorldWS/"; // proxy via http gateway ("ant runhttp")
 			args[1] = System.getProperty("user.name");
 		}
 		
@@ -65,8 +65,10 @@
 		PostMethod method = new PostMethod(url);
 		method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
 		
-		// this line should be used for better performance but is not necessary
-		method.setRequestHeader("SOAPAction", "");
+		// this line should be used for better performance/interop but is not necessary
+		// http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
+		// http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAPAction_HTTP_Header
+		method.setRequestHeader("SOAPAction", "\"\"");
 		
 		String request = SOAP_PRE + args[1] + SOAP_POST;
 		System.out.println("****  REQUEST BODY: " + request);

Modified: labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java
===================================================================
--- labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java	2009-07-02 15:13:34 UTC (rev 27445)
+++ labs/jbossesb/workspace/dward/wsproxy/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/proxy/SOAPProxy.java	2009-07-02 15:36:26 UTC (rev 27446)
@@ -102,26 +102,34 @@
 				if (binding != null)
 				{
 					String soapaction = wsdl_bind_oper.getSOAPAction();
-					if (soapaction != null)
+					if (soapaction == null)
 					{
+						soapaction = "";
+					}
+					if ( !soapaction_to_binding.containsKey(soapaction) )
+					{
 						soapaction_to_binding.put(soapaction, binding);
 						if ( logger.isInfoEnabled() )
 						{
 							logger.info("mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
 						}
-						// TODO: do SOAPActions always have quotes around them?
-						if ( !soapaction.startsWith("\"") && !soapaction.endsWith("\"") )
+					}
+					// http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
+					// http://www.ws-i.org/Profiles/BasicProfile-1.1.html#SOAPAction_HTTP_Header
+					if ( !soapaction.startsWith("\"") && !soapaction.endsWith("\"") )
+					{
+						soapaction = '"' + soapaction + '"';
+						if ( !soapaction_to_binding.containsKey(soapaction) )
 						{
-							soapaction = '"' + soapaction + '"';
 							soapaction_to_binding.put(soapaction, binding);
 							if ( logger.isInfoEnabled() )
 							{
-								logger.info("also mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
+								logger.info("mapped soapaction [" + soapaction + "] to binding [" + binding + "]");
 							}
 						}
 					}
 					String operation = wsdl_bind_oper.getRef().getLocalPart();
-					if (operation != null)
+					if ( operation != null && !operation_to_binding.containsKey(operation) )
 					{
 						operation_to_binding.put(operation, binding);
 						if ( logger.isInfoEnabled() )
@@ -146,10 +154,13 @@
 				// else if jms ...
 				if (transport != null)
 				{
-					binding_to_transport.put(binding, transport);
-					if ( logger.isInfoEnabled() )
+					if ( !binding_to_transport.containsKey(binding) )
 					{
-						logger.info("mapped binding [" + binding + "] to transport [" + transport.getClass().getName() + "] with endpoint address: [" + transport.getEndpointAddress() + "]");
+						binding_to_transport.put(binding, transport);
+						if ( logger.isInfoEnabled() )
+						{
+							logger.info("mapped binding [" + binding + "] to transport [" + transport.getClass().getName() + "] with endpoint address: [" + transport.getEndpointAddress() + "]");
+						}
 					}
 				}
 				else
@@ -180,10 +191,14 @@
 		{
 			if ( logger.isEnabledFor(Level.WARN) )
 			{
-				logger.warn("\"SOAPAction\" should be set in request!  Resorting to (potentially expensive) parsing of SOAP Body to guess operation!");
+				logger.warn("null binding for soapaction [" + soapaction + "].  Resorting to (potentially expensive) parsing of Envelope to discover operation.");
 			}
 			operation = getOperation(message);
 			binding = (operation != null) ? operation_to_binding.get(operation) : null;
+			if ( binding == null  && logger.isEnabledFor(Level.ERROR) )
+			{
+				logger.error("null binding for operation [" + operation + "] in addition to soapaction [" + soapaction + "]");
+			}
 		}
 		SOAPProxyTransport transport = (binding != null) ? binding_to_transport.get(binding) : null;
 		if (transport == null)




More information about the jboss-svn-commits mailing list