I am generating a soap envelope with the soap
package on NodeJS and generated envelope is below:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:i0="http://tempuri.org/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="http://schemas.microsoft.com/ws/2008/06/identity/securitytokenservice" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q1="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q2="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q3="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q4="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q5="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q6="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q7="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:q8="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
<soap:Header>
<Action>http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</Action>
<MessageID>urn:uuid:568d575f-6760-4fd7-837d-04c610abcff4</MessageID>
<To>https://kpsv2test.saglik.gov.tr/STS/STSService.svc</To>
<ReplyTo>
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>
<SorgulayanKimlikNo>10774881040</SorgulayanKimlikNo>
<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="Timestamp-2021-02-26T13:15:20Z">
<wsu:Created>2021-02-26T13:15:20Z</wsu:Created>
<wsu:Expires>2021-02-26T13:25:20Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-2021-02-26T13:15:20Z">
<wsse:Username>test_user2</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Twm=x5Gb</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">r9V/OHo2DbI7hLmw+a2fpt12qZI=</wsse:Nonce>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<q7:RequestSecurityToken xmlns:q7="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<EndpointReference>
<Address>https://kpsv2test.saglik.gov.tr/Router/RoutingService.svc</Address>
</EndpointReference>
</wsp:AppliesTo>
<trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
</q7:RequestSecurityToken>
</soap:Body>
</soap:Envelope>
I copied and pasted this request to SOAPUI but SOAPUI is giving below error.
ERROR:org.apache.xmlbeans.XmlException: Missing/Invalid SOAP Envelope, expecting [{http://www.w3.org/2003/05/soap-envelope}Envelope]
org.apache.xmlbeans.XmlException: Missing/Invalid SOAP Envelope, expecting [{http://www.w3.org/2003/05/soap-envelope}Envelope]
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.getHeaderElement(SoapUtils.java:147)
at com.eviware.soapui.impl.wsdl.support.wsa.WsaUtils.getHeader(WsaUtils.java:133)
at com.eviware.soapui.impl.wsdl.support.wsa.WsaUtils.createNewWSAddressingRequest(WsaUtils.java:288)
at com.eviware.soapui.impl.wsdl.support.wsa.WsaUtils.addWSAddressingRequest(WsaUtils.java:281)
at com.eviware.soapui.impl.wsdl.submit.filters.WsaRequestFilter.filterAbstractHttpRequest(WsaRequestFilter.java:54)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:33)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.filterRequest(HttpClientRequestTransport.java:322)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:184)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
I didn't understand where the problem is. Could you help me?
It‘s a SOAP version mismatch, server expects version 1.2 but client is sending 1.1 (I am confused about SOAP namespaces). You need to implement (here: construct request based on) wsdl from server and make sure to use version 1.2