Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaajSoapMessage created with default (empty) SoapEnvelope [SWS-1018] #1088

Closed
gregturn opened this issue May 9, 2018 · 3 comments
Closed

SaajSoapMessage created with default (empty) SoapEnvelope [SWS-1018] #1088

gregturn opened this issue May 9, 2018 · 3 comments

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented May 9, 2018

Sachin Lad opened SWS-1018 and commented

It seems like with the fix for #1052 check for SOAP 1.1 was added. This results in setting default/empty SoapEnvelope for SaajSoapMessage.

 

public SaajSoapMessage(SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString, MessageFactory messageFactory) {
   Assert.notNull(soapMessage, "soapMessage must not be null");
   saajMessage = soapMessage;
   this.langAttributeOnSoap11FaultString = langAttributeOnSoap11FaultString;
   this.messageFactory = messageFactory;
   if (SoapVersion.SOAP_11.equals(getVersion())) {
      MimeHeaders headers = soapMessage.getMimeHeaders();
      if (ObjectUtils.isEmpty(headers.getHeader(TransportConstants.HEADER_SOAP_ACTION))) {
         headers.addHeader(TransportConstants.HEADER_SOAP_ACTION, "\"\"");
      }
   }
}

 Invoking getVersion() results in introspection for SoapEnvelope. This constructor is invoked as part of createMessage() method which sets the soapMessage in doWithMessage() method after the SaajSoapMessage is initialized.

 

@Override
public final WebServiceMessage createMessage(WebServiceMessageFactory messageFactory) throws IOException {
   WebServiceMessage message = messageFactory.createWebServiceMessage();
   doWithMessage(message);
   return message;
}

We started to see our integration tests failing with this upgrade.  


Affects: 3.0.1

Issue Links:

  • #1089 RequestCreators withSoapEnvelope can not found endpoint
    ("is duplicated by")

Referenced from: pull request #119, and commits 743fb29, 0da6aca

Backported to: 2.4.3

1 votes, 5 watchers

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 14, 2018

Tomas Hudec commented

lol. I create very similar bug right after yours. Check how you can temporary fix it: #1089

@gregturn
Copy link
Member Author

@gregturn gregturn commented Jun 21, 2018

jaminh commented

I tried addressing this issue by moving the addition of the empty SoapAction for SOAP 1.1 messages to the postProcess method of the SaajSoapMessageFactory. This eliminates the need to look at the envelope to figure out the version since we can just look at the messageFactoryProtocol of the factory. If you want you can try running against https://github.com/jaminh/spring-ws/tree/SWS-1018 to see if that fixes the issue for you.

@gregturn
Copy link
Member Author

@gregturn gregturn commented Sep 13, 2018

Greg Turnquist commented

Empty envelope initialization moved to SaajSoapMessageFactory based on jaminh's work and backported to 2.x.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant