Skip to main content
Nelson Schroth
Participating Frequently
Nov 6, 2026 2:25 PM UTC
Solved

U2 Basic submitRequest returns "SOAP Request is not well formed" ERROR

We have been trying for weeks to get our CCN transmissions connected to the bank’s test machine using their new certs.  Would appreciate ANY useful suggestions to resolve this problem.

Details below:

RESULT=setHTTPDefault("HEADERS","")
RESULT=setHTTPDefault("VERSION","1.1")
RESULT=setHTTPDefault("BUFSIZE","8192")
RESULT=createSecurityContext(CMP_CONTEXT,"TLSv1.2:Min")
RESULT=addAuthenticationRule(CMP_CONTEXT,2,"ServerName","a-b.c.com")
RESULT=addAuthenticationRule(CMP_CONTEXT,2,"VerificationStrength","Generous")
     (there is a chain.pem that includes both root & issuing certs , but it did not 
      like that, so we added them seperately.)
RESULT=addCertificate("/a/b/c/ROOT CA.pem",2,1,1,CMP_CONTEXT)
RESULT=addCertificate("/a/b/c/ISSUING CA 01.pem",2,1,1,CMP_CONTEXT)
RESULT=addCertificate("/a/b/c/xxx.com.pem",1,1,1,CMP_CONTEXT)
RESULT=setPrivateKey("/a/b/c/xxx.com_pvtkey",1,2,"zzzzzzzz",1,CMP_CONTEXT)
RESULT=createSecureRequest("https://bank.services",CMP_METHOD,CMP_REQHANDLE,CMP_CONTEXT)
ENCODESTATUS = ENCODE("BASE64", 1, "username:password", 1, ENCODEDSTR, 1)
RESULT=setRequestHeader(CMP_REQHANDLE, "Authorization:Basic", ENCODEDSTR)
RESULT=setRequestHeader(CMP_REQHANDLE,"Content-Type","test/xml;charset=utf-8")
RESULT=submitRequest(CMP_REQHANDLE,
                        CMP_TIMEOUT,
                        CMP_POSTDATA,    <-- the actual SOAPenvelope
                        CMP_RESPHDRS,
                        CMP_RESPDATA,
                        CMP_RESPSTATUS)
                        
The RESPDATA comes back:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:
Client</faultcode><faultstring xml:lang="en">CompassAuthException</faultstring><
detail>Input SOAP Request is not well-formed. The Exception is org.xml.sax.SAXPa
rseException; lineNumber: 1; columnNumber: 1; Premature end of file.</detail>
</S
OAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

The RESPSTATUS comes back:  200ýOK

However, submitting via openSSL works fine?
The bank's tech support folks feel that U2 Basic is doing something to the 
payload that their parser doesn’t like, while their PostMan and OpenSSL
test all work fine.
Google makes this error sound like the SOAP package is blank.

Hoping for some ideas.

Nelson

Jon Card
Jon CardAnswer
Inspiring
Nov 6, 2026 4:02 PM UTC

check the BASE64 in  ENCODESTATUS = ENCODE("BASE64", 1, "username:password", 1, ENCODEDSTR, 1) I think it should be BASE64A

8 replies

Mike Hulls
New Participant
Nov 6, 2026 2:37 PM UTC

We have had serveral problems with updated websites due to the requirement of SNI auth headers. The implementation of these in not consistent so the responses can be inconsistent.

To add a SNI auth header:
 

    SERVER.NAME                 = FIELD(ACCESS.TOKEN.URL,"/",1,1)    ERRLVL = addAuthenticationRule(SECURITY.CONTEXT, 2, "ServerName", SERVER.NAME)

Another suggestion is to turn on the http log and review it:
 

    IF USE.PROTOCOL.LOGGING THEN        ERRLVL = protocolLogging("/tmp/servicetrackersendws.log","ON",10)    ENDGood luck
Dave Weinstein
Rocketeer
Nov 6, 2026 3:10 PM UTC

Nelson,

How is the  CMP_POSTDATA being formed? Read from a record or something else?

Can you inspect for control chars or marks in the CMP_POSTDATA request? Specifically at beginning of the response I would think based on the location reported in the error.

It’s getting a 200 so we can reach the server. I’d focus on the formation of the SOAP request.

-Dave

Joseph von Arx
Participating Frequently
Nov 6, 2026 3:26 PM UTC

Nelson,

 

In addition to the SNI response Dave provided, in our experience, the Basic authorization structure does not need the encoding performed.  Universe seems to do that itself behind the scenes.  Whenever I tried what you are doing and encoding it and then passing the encoded value, I never had any success.  I would try doing something like the following:

 

credStr = (“username:password”)

setRequestHeader(request_handle, 'Authorization', credStr)

 

 

Joseph

Jonathan Smith
Rocketeer
Nov 6, 2026 3:28 PM UTC

If you turn on the protocolLogging and send us the results it would give us a lot better of understanding of what is happening under the covers.

 

Rocket Software - Senior Principal Technical Support Engineer - UniData ATS
Jonathan Smith
Rocketeer
Nov 6, 2026 3:41 PM UTC

A few comments from looking at the code … 

Your certs are fine — no need to debug TLS
You got a SOAP envelope back with 200 OK. That means the handshake completed, the chain validated, and the bank's application answered you. This is a request-header problem, not a cert problem.

Check "Authorization:Basic" as I don't think that is a header name 
Check — test/xml is a typo for text/xml
Check — no SOAPAction header

 

RESULT = setHTTPDefault("HEADERS","")
RESULT = setHTTPDefault("VERSION","1.1")
RESULT = setHTTPDefault("BUFSIZE","8192")
RESULT = protocolLogging("/a/b/c/httplog","ON",3)

RESULT = createSecurityContext(CMP_CONTEXT,"TLSv1.2:Min")
RESULT = addAuthenticationRule(CMP_CONTEXT,2,"ServerName","a-b.c.com")
RESULT = addAuthenticationRule(CMP_CONTEXT,2,"VerificationStrength","Generous")
RESULT = addCertificate("/a/b/c/ROOT CA.pem",2,1,1,CMP_CONTEXT)
RESULT = addCertificate("/a/b/c/ISSUING CA 01.pem",2,1,1,CMP_CONTEXT)
RESULT = addCertificate("/a/b/c/xxx.com.pem",1,1,1,CMP_CONTEXT)
RESULT = setPrivateKey("/a/b/c/xxx.com_pvtkey",1,2,"zzzzzzzz",1,CMP_CONTEXT)

CMP_METHOD = "POST"
RESULT = createSecureRequest("https://bank.services",CMP_METHOD,CMP_REQHANDLE,CMP_CONTEXT)

RESULT = setRequestHeader(CMP_REQHANDLE,"Authorization","username:password")
RESULT = setRequestHeader(CMP_REQHANDLE,"Content-Type","text/xml; charset=utf-8")
RESULT = setRequestHeader(CMP_REQHANDLE,"SOAPAction",'"urn:fromTheirWSDL"')

RESULT = submitRequest(CMP_REQHANDLE, CMP_TIMEOUT, CMP_POSTDATA,
                       CMP_RESPHDRS, CMP_RESPDATA, CMP_RESPSTATUS)

IF LEN(CMP_POSTDATA) = 0 THEN STOP "POSTDATA IS EMPTY"
IF INDEX(CMP_POSTDATA,@AM,1) OR INDEX(CMP_POSTDATA,@VM,1) THEN STOP "POSTDATA HAS MARKS"

Rocket Software - Senior Principal Technical Support Engineer - UniData ATS
Jon Card
Jon CardAnswer
Inspiring
Nov 6, 2026 4:02 PM UTC

check the BASE64 in  ENCODESTATUS = ENCODE("BASE64", 1, "username:password", 1, ENCODEDSTR, 1) I think it should be BASE64A

Nelson Schroth
Participating Frequently
Nov 6, 2026 9:15 PM UTC

Thanks for all the feedback.

Mike - our server name does not have any slashes in it so the field statement is not needed.

            Also, we already are doing protocol logging set to “27”

Dave - all inspections of the request have proven to be fine

Joe - We tried not encoding the username/password but that always fails.

Jon - You are the winner...we changed BASE64 to BASE64A and finally got a successful response!!!

Jonathan  - I am attaching the protocol log as requested

 

BTW, We also found that linearizing the SoapEnvelope was required.

 

Now we are down to the bank RESPONSE error being:

    RESPDATA   = {"fault":{"faultstring":"Requested resource cannot be found","detail”:
           {"errorcode":"steps.apim.custom.ResourceNotFound"}}}
    RESPSTATUS = 404ýNot Found

 

However, not sure what the “Requested Resource” is.  My guess is the response file we are trying to pick up.

 

Nelson

 

John Jenkins
Participating Frequently
Nov 12, 2026 10:37 PM UTC

Nelson,

 

It looks like a “404” was generated as the request was sent as a GET to service that was looking for a SOAP POST.

 

I ran it through an analysis tool as well and got a fuller breakdown - please review the file as I’ve sent it “as is” via a private mail rather than post it here.

Regards

JJ

 

JJ