@@ -34,6 +34,10 @@ public void testExtractActionFromContentType() throws Exception {
3434 contentType = "application/soap+xml; action=" + soapAction + " ; charset=UTF-8" ;
3535 result = SoapUtils .extractActionFromContentType (contentType );
3636 assertEquals ("Invalid SOAP action" , soapAction , result );
37+
38+ contentType = "application/soap+xml; charset=UTF-8; action=" + soapAction ;
39+ result = SoapUtils .extractActionFromContentType (contentType );
40+ assertEquals ("Invalid SOAP action" , soapAction , result );
3741 }
3842
3943 public void testEscapeAction () throws Exception {
@@ -51,4 +55,18 @@ public void testEscapeAction() throws Exception {
5155
5256 }
5357
58+ public void testSetActionInContentType () throws Exception {
59+ String soapAction = "http://springframework.org/spring-ws/Action" ;
60+ String contentType = "application/soap+xml" ;
61+
62+ String result = SoapUtils .setActionInContentType (contentType , soapAction );
63+ assertEquals ("Invalid SOAP action" , soapAction , SoapUtils .extractActionFromContentType (result ));
64+
65+ String anotherSoapAction = "http://springframework.org/spring-ws/AnotherAction" ;
66+ String contentTypeWithAction = "application/soap+xml; action=http://springframework.org/spring-ws/Action" ;
67+ result = SoapUtils .setActionInContentType (contentTypeWithAction , anotherSoapAction );
68+ assertEquals ("Invalid SOAP action" , anotherSoapAction , SoapUtils .extractActionFromContentType (result ));
69+
70+ }
71+
5472}
0 commit comments