Transform error, error unmarshalling XML: EOF

I am trying to transform a SOAP XML using the learnwebservices.com demo

I setup a template to transform, and set the input type as XML

[Jun 30 19:04:46] ERROR Body transform failure api_id=da76007a-6533-49ef-96d1-0022584e8092 api_name=HelloEndpointService error=error unmarshalling XML: EOF mw=TransformMiddleware org_id=1 origin=172.17.0.1 path=/HelloEndpointService/HelloEndpointService/SayHello

my template file with no variables to transform at this point:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <SayHello xmlns="http://learnwebservices.com/services/hello">
         <HelloRequest>
            <Name>Mike</Name>
         </HelloRequest>
      </SayHello>
   </soapenv:Body>
</soapenv:Envelope>

what am I doing wrong here?

Hi moshe,

Couple of questions-

  • How have you configured it?
  • What are you trying to transform to?
  • What’s the template you’re using?

Hi,

I have since figured it out, it is a known bug

I worked around it by switching to a blob of base64 but it is very inconvenient…

it seems that the master version of tyk includes the PR to fix it, however the current stable version is still broken. I mentioned it in the github bug.

I think it is important for Tyk to be more responsive to community raised issues to be considered to be part of a production product stack.

I like the product alot but it seems that bugs linger for too long, and we are talking of a basic transform functionality

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <SayHello xmlns="http://learnwebservices.com/services/hello">
         <HelloRequest>
            <Name>{{.name}}</Name>
         </HelloRequest>
      </SayHello>
   </soapenv:Body>
</soapenv:Envelope>
                  "transform": [
                    {
                      "path": "HelloEndpointService/SayHello",
                      "method": "POST",
                      "template_data": {
                        "template_mode": "file",
                        "template_source": "transform/out-hello.tmpl",
                        "input_type": "json",
                        "enable_session": true
                      }
                    }
                  ]
curl -s -X POST -H "authorization: 18498873b3c2b4725aaa0dfc7e2741d5" \
 -H "Content-Type: application/json" \
 -d '{"name": "My Name"}' \
 http://localhost:8080/HelloEndpointService/HelloEndpointService/SayHello