{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-connector-soap/issues/77","repository_url":"https://api.github.com/repos/strongloop/loopback-connector-soap","labels_url":"https://api.github.com/repos/strongloop/loopback-connector-soap/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-connector-soap/issues/77/comments","events_url":"https://api.github.com/repos/strongloop/loopback-connector-soap/issues/77/events","html_url":"https://github.com/strongloop/loopback-connector-soap/issues/77","id":234400330,"number":77,"title":"Unexpected Element generated","user":{"login":"liudonghua123","id":2276718,"avatar_url":"https://avatars3.githubusercontent.com/u/2276718?v=4","gravatar_id":"","url":"https://api.github.com/users/liudonghua123","html_url":"https://github.com/liudonghua123","followers_url":"https://api.github.com/users/liudonghua123/followers","following_url":"https://api.github.com/users/liudonghua123/following{/other_user}","gists_url":"https://api.github.com/users/liudonghua123/gists{/gist_id}","starred_url":"https://api.github.com/users/liudonghua123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liudonghua123/subscriptions","organizations_url":"https://api.github.com/users/liudonghua123/orgs","repos_url":"https://api.github.com/users/liudonghua123/repos","events_url":"https://api.github.com/users/liudonghua123/events{/privacy}","received_events_url":"https://api.github.com/users/liudonghua123/received_events","type":"User","site_admin":false},"labels":[{"id":674227439,"url":"https://api.github.com/repos/strongloop/loopback-connector-soap/labels/stale","name":"stale","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-06-08T03:16:41Z","updated_at":"2017-12-19T13:36:03Z","closed_at":"2017-11-15T22:21:05Z","author_association":"NONE","body":"<!--\r\n- Please ask questions at https://groups.google.com/forum/#!forum/loopbackjs or\r\n  https://gitter.im/strongloop/loopback\r\n\r\n- Immediate support is available through our subscription plans, see\r\n  https://strongloop.com/api-connect-faqs/\r\n-->\r\n\r\n### Bug or feature request\r\n\r\n<!--\r\nMark your choice with an \"x\" (eg. [x], NOT [*]).\r\n-->\r\n\r\n- [x] Bug\r\n- [ ] Feature request\r\n\r\n### Description of feature (or steps to reproduce if bug)\r\n\r\nI have a existed web service. and I followed the tutorial [Connecting to SOAP web services](https://loopback.io/doc/en/lb3/Connecting-to-SOAP.html). And When I invoke a simple operation. It gave me the unexpected element exception. I looked up the documentation and could not find a option to disable generating these internal properties.\r\n\r\nI use Wireshark to capture the related packets\r\n\r\n```\r\nPOST /apiws/services/API HTTP/1.1\r\nUser-Agent: loopback-connector-soap/3.0.1\r\nAccept: text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: none\r\nAccept-Charset: utf-8\r\nConnection: close\r\nHost: mail.ynu.edu.cn:9900\r\nContent-Length: 17821\r\nContent-Type: text/xml; charset=utf-8\r\nSOAPAction: \"\"\r\n\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n  <soap:Header/>\r\n  <soap:Body>\r\n    <ns1:authenticate xmlns:ns1=\"http://coremail.cn/apiws\">\r\n      <__cachedRelations/>\r\n      <__data>\r\n        <user_at_domain>my_mail_address</user_at_domain>\r\n        <password>my_mail_password</password>\r\n      </__data>\r\n      <__dataSource/>\r\n      <__strict>false</__strict>\r\n      <__persisted>false</__persisted>\r\n      <user_at_domain>my_mail_address</user_at_domain>\r\n      <password>my_mail_password</password>\r\n      <_initProperties>function (data, options) {\r\n  var self = this;\r\n  var ctor = this.constructor;\r\n\r\n  if (typeof data !== 'undefined' &amp;&amp; data.constructor &amp;&amp;\r\n      typeof (data.constructor) !== 'function') {\r\n    throw new Error(g.f('Property name \"{{constructor}}\" is not allowed in %s data', ctor.modelName));\r\n  }\r\n\r\n  if (data instanceof ctor) {\r\n    // Convert the data to be plain object to avoid pollutions\r\n    data = data.toObject(false);\r\n  }\r\n  var properties = _extend({}, ctor.definition.properties);\r\n  data = data || {};\r\n\r\n  if (typeof ctor.applyProperties === 'function') {\r\n    ctor.applyProperties(data);\r\n  }\r\n\r\n  options = options || {};\r\n  var applySetters = options.applySetters;\r\n  var applyDefaultValues = options.applyDefaultValues;\r\n  var strict = options.strict;\r\n\r\n  if (strict === undefined) {\r\n    strict = ctor.definition.settings.strict;\r\n  } else if (strict === 'throw') {\r\n    g.warn('Warning: Model %s, {{strict mode: `throw`}} has been removed, ' +\r\n      'please use {{`strict: true`}} instead, which returns' +\r\n      '{{`Validation Error`}} for unknown properties,', ctor.modelName);\r\n  }\r\n\r\n  var persistUndefinedAsNull = ctor.definition.settings.persistUndefinedAsNull;\r\n\r\n  if (ctor.hideInternalProperties) {\r\n    // Object.defineProperty() is expensive. We only try to make the internal\r\n    // properties hidden (non-enumerable) if the model class has the\r\n    // `hideInternalProperties` set to true\r\n    Object.defineProperties(this, {\r\n      __cachedRelations: {\r\n        writable: true,\r\n        enumerable: false,\r\n        configurable: true,\r\n        value: {},\r\n      },\r\n\r\n      __data: {\r\n        writable: true,\r\n        enumerable: false,\r\n        configurable: true,\r\n        value: {},\r\n      },\r\n\r\n      // Instance level data source\r\n      __dataSource: {\r\n        writable: true,\r\n        enumerable: false,\r\n        configurable: true,\r\n        value: options.dataSource,\r\n      },\r\n\r\n      // Instance level strict mode\r\n      __strict: {\r\n        writable: true,\r\n        enumerable: false,\r\n        configurable: true,\r\n        value: strict,\r\n      },\r\n\r\n      __persisted: {\r\n        writable: true,\r\n        enumerable: false,\r\n        configurable: true,\r\n        value: false,\r\n      },\r\n    });\r\n\r\n    if (strict) {\r\n      Object.defineProperty(this, '__unknownProperties', {\r\n        writable: true,\r\n        enumerable: false,\r\n        configrable: true,\r\n        value: [],\r\n      });\r\n    }\r\n  } else {\r\n    this.__cachedRelations = {};\r\n    this.__data = {};\r\n    this.__dataSource = options.dataSource;\r\n    this.__strict = strict;\r\n    this.__persisted = false;\r\n    if (strict) {\r\n      this.__unknownProperties = [];\r\n    }\r\n  }\r\n\r\n  if (options.persisted !== undefined) {\r\n    this.__persisted = options.persisted === true;\r\n  }\r\n\r\n  if (data.__cachedRelations) {\r\n    this.__cachedRelations = data.__cachedRelations;\r\n  }\r\n\r\n  var keys = Object.keys(data);\r\n\r\n  if (Array.isArray(options.fields)) {\r\n    keys = keys.filter(function(k) {\r\n      return (options.fields.indexOf(k) != -1);\r\n    });\r\n  }\r\n\r\n  var size = keys.length;\r\n  var p, propVal;\r\n  for (var k = 0; k &lt; size; k++) {\r\n    p = keys[k];\r\n    propVal = data[p];\r\n    if (typeof propVal === 'function') {\r\n      continue;\r\n    }\r\n\r\n    if (propVal === undefined &amp;&amp; persistUndefinedAsNull) {\r\n      propVal = null;\r\n    }\r\n\r\n    if (properties[p]) {\r\n      // Managed property\r\n      if (applySetters || properties[p].id) {\r\n        self[p] = propVal;\r\n      } else {\r\n        self.__data[p] = propVal;\r\n      }\r\n    } else if (ctor.relations[p]) {\r\n      var relationType = ctor.relations[p].type;\r\n\r\n      var modelTo;\r\n      if (!properties[p]) {\r\n        modelTo = ctor.relations[p].modelTo || ModelBaseClass;\r\n        var multiple = ctor.relations[p].multiple;\r\n        var typeName = multiple ? 'Array' : modelTo.modelName;\r\n        var propType = multiple ? [modelTo] : modelTo;\r\n        properties[p] = {name: typeName, type: propType};\r\n        /* Issue #1252\r\n        this.setStrict(false);\r\n        */\r\n      }\r\n\r\n      // Relation\r\n      if (relationType === 'belongsTo' &amp;&amp; propVal != null) {\r\n        // If the related model is populated\r\n        self.__data[ctor.relations[p].keyFrom] = propVal[ctor.relations[p].keyTo];\r\n\r\n        if (ctor.relations[p].options.embedsProperties) {\r\n          var fields = fieldsToArray(ctor.relations[p].properties,\r\n            modelTo.definition.properties, modelTo.settings.strict);\r\n          if (!~fields.indexOf(ctor.relations[p].keyTo)) {\r\n            fields.push(ctor.relations[p].keyTo);\r\n          }\r\n          self.__data[p] = new modelTo(propVal, {\r\n            fields: fields,\r\n            applySetters: false,\r\n            persisted: options.persisted,\r\n          });\r\n        }\r\n      }\r\n\r\n      self.__cachedRelations[p] = propVal;\r\n    } else {\r\n      // Un-managed property\r\n      if (strict === false || self.__cachedRelations[p]) {\r\n        self[p] = self.__data[p] =\r\n          (propVal !== undefined) ? propVal : self.__cachedRelations[p];\r\n\r\n        // Throw error for properties with unsupported names\r\n        if (/\\./.test(p)) {\r\n          throw new Error(g.f(\r\n            'Property names containing dot(s) are not supported. ' +\r\n            'Model: %s, dynamic property: %s',\r\n            this.constructor.modelName, p\r\n          ));\r\n        }\r\n      } else {\r\n        if (strict !== 'filter') {\r\n          this.__unknownProperties.push(p);\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  keys = Object.keys(properties);\r\n\r\n  if (Array.isArray(options.fields)) {\r\n    keys = keys.filter(function(k) {\r\n      return (options.fields.indexOf(k) != -1);\r\n    });\r\n  }\r\n\r\n  size = keys.length;\r\n\r\n  for (k = 0; k &lt; size; k++) {\r\n    p = keys[k];\r\n    propVal = self.__data[p];\r\n    var type = properties[p].type;\r\n\r\n    // Set default values\r\n    if (applyDefaultValues &amp;&amp; propVal === undefined) {\r\n      var def = properties[p]['default'];\r\n      if (def !== undefined) {\r\n        if (typeof def === 'function') {\r\n          if (def === Date) {\r\n            // FIXME: We should coerce the value in general\r\n            // This is a work around to {default: Date}\r\n            // Date() will return a string instead of Date\r\n            def = new Date();\r\n          } else {\r\n            def = def();\r\n          }\r\n        } else if (type.name === 'Date' &amp;&amp; def === '$now') {\r\n          def = new Date();\r\n        }\r\n        // FIXME: We should coerce the value\r\n        // will implement it after we refactor the PropertyDefinition\r\n        self.__data[p] = propVal = def;\r\n      }\r\n    }\r\n\r\n    // Set default value using a named function\r\n    if (applyDefaultValues &amp;&amp; propVal === undefined) {\r\n      var defn = properties[p].defaultFn;\r\n      switch (defn) {\r\n        case undefined:\r\n          break;\r\n        case 'guid':\r\n        case 'uuid':\r\n          // Generate a v1 (time-based) id\r\n          propVal = uuid.v1();\r\n          break;\r\n        case 'uuidv4':\r\n          // Generate a RFC4122 v4 UUID\r\n          propVal = uuid.v4();\r\n          break;\r\n        case 'now':\r\n          propVal = new Date();\r\n          break;\r\n        case 'shortid':\r\n          propVal = shortid.generate();\r\n          break;\r\n        default:\r\n          // TODO Support user-provided functions via a registry of functions\r\n          g.warn('Unknown default value provider %s', defn);\r\n      }\r\n      // FIXME: We should coerce the value\r\n      // will implement it after we refactor the PropertyDefinition\r\n      if (propVal !== undefined)\r\n        self.__data[p] = propVal;\r\n    }\r\n\r\n    if (propVal === undefined &amp;&amp; persistUndefinedAsNull) {\r\n      self.__data[p] = propVal = null;\r\n    }\r\n\r\n    // Handle complex types (JSON/Object)\r\n    if (!BASE_TYPES[type.name]) {\r\n      if (typeof self.__data[p] !== 'object' &amp;&amp; self.__data[p]) {\r\n        try {\r\n          self.__data[p] = JSON.parse(self.__data[p] + '');\r\n        } catch (e) {\r\n          self.__data[p] = String(self.__data[p]);\r\n        }\r\n      }\r\n\r\n      if (type.prototype instanceof ModelBaseClass) {\r\n        if (!(self.__data[p] instanceof type) &amp;&amp;\r\n            typeof self.__data[p] === 'object' &amp;&amp;\r\n            self.__data[p] !== null) {\r\n          self.__data[p] = new type(self.__data[p]);\r\n        }\r\n      } else if (type.name === 'Array' || Array.isArray(type)) {\r\n        if (!(self.__data[p] instanceof List) &amp;&amp;\r\n            self.__data[p] !== undefined &amp;&amp;\r\n            self.__data[p] !== null) {\r\n          self.__data[p] = List(self.__data[p], type, self);\r\n        }\r\n      }\r\n    }\r\n  }\r\n  this.trigger('initialize');\r\n}</_initProperties>\r\n      <getPropertyType>function (propName) {\r\n  return this.constructor.getPropertyType(propName);\r\n}</getPropertyType>\r\n      <toObject>function (onlySchema, removeHidden, removeProtected) {\r\n  if (onlySchema === undefined) {\r\n    onlySchema = true;\r\n  }\r\n  var data = {};\r\n  var self = this;\r\n  var Model = this.constructor;\r\n\r\n  // if it is already an Object\r\n  if (Model === Object) {\r\n    return self;\r\n  }\r\n\r\n  var strict = this.__strict;\r\n  var schemaLess = (strict === false) || !onlySchema;\r\n  var persistUndefinedAsNull = Model.definition.settings.persistUndefinedAsNull;\r\n\r\n  var props = Model.definition.properties;\r\n  var keys = Object.keys(props);\r\n  var propertyName, val;\r\n\r\n  for (var i = 0; i &lt; keys.length; i++) {\r\n    propertyName = keys[i];\r\n    val = self[propertyName];\r\n\r\n    // Exclude functions\r\n    if (typeof val === 'function') {\r\n      continue;\r\n    }\r\n    // Exclude hidden properties\r\n    if (removeHidden &amp;&amp; Model.isHiddenProperty(propertyName)) {\r\n      continue;\r\n    }\r\n\r\n    if (removeProtected &amp;&amp; Model.isProtectedProperty(propertyName)) {\r\n      continue;\r\n    }\r\n\r\n    if (val instanceof List) {\r\n      data[propertyName] = val.toObject(!schemaLess, removeHidden, true);\r\n    } else {\r\n      if (val !== undefined &amp;&amp; val !== null &amp;&amp; val.toObject) {\r\n        data[propertyName] = val.toObject(!schemaLess, removeHidden, true);\r\n      } else {\r\n        if (val === undefined &amp;&amp; persistUndefinedAsNull) {\r\n          val = null;\r\n        }\r\n        data[propertyName] = val;\r\n      }\r\n    }\r\n  }\r\n\r\n  if (schemaLess) {\r\n    // Find its own properties which can be set via myModel.myProperty = 'myValue'.\r\n    // If the property is not declared in the model definition, no setter will be\r\n    // triggered to add it to __data\r\n    keys = Object.keys(self);\r\n    var size = keys.length;\r\n    for (i = 0; i &lt; size; i++) {\r\n      propertyName = keys[i];\r\n      if (props[propertyName]) {\r\n        continue;\r\n      }\r\n      if (propertyName.indexOf('__') === 0) {\r\n        continue;\r\n      }\r\n      if (removeHidden &amp;&amp; Model.isHiddenProperty(propertyName)) {\r\n        continue;\r\n      }\r\n      if (removeProtected &amp;&amp; Model.isProtectedProperty(propertyName)) {\r\n        continue;\r\n      }\r\n      if (data[propertyName] !== undefined) {\r\n        continue;\r\n      }\r\n      val = self[propertyName];\r\n      if (val !== undefined) {\r\n        if (typeof val === 'function') {\r\n          continue;\r\n        }\r\n        if (val !== null &amp;&amp; val.toObject) {\r\n          data[propertyName] = val.toObject(!schemaLess, removeHidden, true);\r\n        } else {\r\n          data[propertyName] = val;\r\n        }\r\n      } else if (persistUndefinedAsNull) {\r\n        data[propertyName] = null;\r\n      }\r\n    }\r\n    // Now continue to check __data\r\n    keys = Object.keys(self.__data);\r\n    size = keys.length;\r\n    for (i = 0; i &lt; size; i++) {\r\n      propertyName = keys[i];\r\n      if (propertyName.indexOf('__') === 0) {\r\n        continue;\r\n      }\r\n      if (data[propertyName] === undefined) {\r\n        if (removeHidden &amp;&amp; Model.isHiddenProperty(propertyName)) {\r\n          continue;\r\n        }\r\n        if (removeProtected &amp;&amp; Model.isProtectedProperty(propertyName)) {\r\n          continue;\r\n        }\r\n        var ownVal = self[propertyName];\r\n        // The ownVal can be a relation function\r\n        val = (ownVal !== undefined &amp;&amp; (typeof ownVal !== 'function')) ? ownVal : self.__data[propertyName];\r\n        if (typeof val === 'function') {\r\n          continue;\r\n        }\r\n\r\n        if (val !== undefined &amp;&amp; val !== null &amp;&amp; val.toObject) {\r\n          data[propertyName] = val.toObject(!schemaLess, removeHidden, true);\r\n        } else if (val === undefined &amp;&amp; persistUndefinedAsNull) {\r\n          data[propertyName] = null;\r\n        } else {\r\n          data[propertyName] = val;\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  return data;\r\n}</toObject>\r\n      <toJSON>function () {\r\n  return this.toObject(false, true, false);\r\n}</toJSON>\r\n      <fromObject>function (obj) {\r\n  for (var key in obj) {\r\n    this[key] = obj[key];\r\n  }\r\n}</fromObject>\r\n      <reset>function () {\r\n  var obj = this;\r\n  for (var k in obj) {\r\n    if (k !== 'id' &amp;&amp; !obj.constructor.dataSource.definitions[obj.constructor.modelName].properties[k]) {\r\n      delete obj[k];\r\n    }\r\n  }\r\n}</reset>\r\n      <inspect>function (depth) {\r\n  if (INSPECT_SUPPORTS_OBJECT_RETVAL)\r\n    return this.__data;\r\n\r\n  // Workaround for older versions\r\n  // See also https://github.com/joyent/node/commit/66280de133\r\n  return util.inspect(this.__data, {\r\n    showHidden: false,\r\n    depth: depth,\r\n    colors: false,\r\n  });\r\n}</inspect>\r\n      <getDataSource>function () {\r\n  return this.__dataSource || this.constructor.dataSource;\r\n}</getDataSource>\r\n      <setStrict>function (strict) {\r\n  this.__strict = strict;\r\n}</setStrict>\r\n      <trigger>function trigger(actionName, work, data, callback) {\r\n  var capitalizedName = capitalize(actionName);\r\n  var beforeHook = this.constructor['before' + capitalizedName] ||\r\n    this.constructor['pre' + capitalizedName];\r\n  var afterHook = this.constructor['after' + capitalizedName] ||\r\n    this.constructor['post' + capitalizedName];\r\n  if (actionName === 'validate') {\r\n    beforeHook = beforeHook || this.constructor.beforeValidation;\r\n    afterHook = afterHook || this.constructor.afterValidation;\r\n  }\r\n  var inst = this;\r\n\r\n  if (actionName !== 'initialize') {\r\n    if (beforeHook)\r\n      deprecateHook(inst.constructor, ['before', 'pre'], capitalizedName);\r\n    if (afterHook)\r\n      deprecateHook(inst.constructor, ['after', 'post'], capitalizedName);\r\n  }\r\n\r\n  // we only call \"before\" hook when we have actual action (work) to perform\r\n  if (work) {\r\n    if (beforeHook) {\r\n      // before hook should be called on instance with two parameters: next and data\r\n      beforeHook.call(inst, function() {\r\n        // Check arguments to next(err, result)\r\n        if (arguments.length) {\r\n          return callback &amp;&amp; callback.apply(null, arguments);\r\n        }\r\n        // No err &amp; result is present, proceed with the real work\r\n        // actual action also have one param: callback\r\n        work.call(inst, next);\r\n      }, data);\r\n    } else {\r\n      work.call(inst, next);\r\n    }\r\n  } else {\r\n    next();\r\n  }\r\n\r\n  function next(done) {\r\n    if (afterHook) {\r\n      afterHook.call(inst, done);\r\n    } else if (done) {\r\n      done.call(this);\r\n    }\r\n  }\r\n}</trigger>\r\n      <isValid>function (callback, data, options) {\r\n  options = options || {};\r\n  var valid = true, inst = this, wait = 0, async = false;\r\n  var validations = this.constructor.validations;\r\n\r\n  var reportDiscardedProperties = this.__strict &amp;&amp;\r\n    this.__unknownProperties &amp;&amp; this.__unknownProperties.length;\r\n\r\n  // exit with success when no errors\r\n  if (typeof validations !== 'object' &amp;&amp; !reportDiscardedProperties) {\r\n    cleanErrors(this);\r\n    if (callback) {\r\n      this.trigger('validate', function(validationsDone) {\r\n        validationsDone.call(inst, function() {\r\n          callback(valid);\r\n        });\r\n      }, data, callback);\r\n    }\r\n    return valid;\r\n  }\r\n\r\n  Object.defineProperty(this, 'errors', {\r\n    enumerable: false,\r\n    configurable: true,\r\n    value: new Errors,\r\n  });\r\n\r\n  this.trigger('validate', function(validationsDone) {\r\n    var inst = this,\r\n      asyncFail = false;\r\n\r\n    var attrs = Object.keys(validations || {});\r\n\r\n    attrs.forEach(function(attr) {\r\n      var attrValidations = validations[attr] || [];\r\n      attrValidations.forEach(function(v) {\r\n        if (v.options &amp;&amp; v.options.async) {\r\n          async = true;\r\n          wait += 1;\r\n          process.nextTick(function() {\r\n            validationFailed(inst, attr, v, options, done);\r\n          });\r\n        } else {\r\n          if (validationFailed(inst, attr, v)) {\r\n            valid = false;\r\n          }\r\n        }\r\n      });\r\n    });\r\n\r\n    if (reportDiscardedProperties) {\r\n      for (var ix in inst.__unknownProperties) {\r\n        var key = inst.__unknownProperties[ix];\r\n        var code = 'unknown-property';\r\n        var msg = defaultMessages[code];\r\n        inst.errors.add(key, msg, code);\r\n        valid = false;\r\n      }\r\n    }\r\n\r\n    if (!async) {\r\n      validationsDone.call(inst, function() {\r\n        if (valid) cleanErrors(inst);\r\n        if (callback) {\r\n          callback(valid);\r\n        }\r\n      });\r\n    }\r\n\r\n    function done(fail) {\r\n      asyncFail = asyncFail || fail;\r\n      if (--wait === 0) {\r\n        validationsDone.call(inst, function() {\r\n          if (valid &amp;&amp; !asyncFail) cleanErrors(inst);\r\n          if (callback) {\r\n            callback(valid &amp;&amp; !asyncFail);\r\n          }\r\n        });\r\n      }\r\n    }\r\n  }, data, callback);\r\n\r\n  if (async) {\r\n    // in case of async validation we should return undefined here,\r\n    // because not all validations are finished yet\r\n    return;\r\n  } else {\r\n    return valid;\r\n  }\r\n}</isValid>\r\n    </ns1:authenticate>\r\n  </soap:Body>\r\n</soap:Envelope>HTTP/1.1 500 Internal Server Error\r\nServer: Apache-Coyote/1.1\r\nContent-Type: text/xml;charset=UTF-8\r\nContent-Length: 323\r\nDate: Thu, 08 Jun 2017 02:40:26 GMT\r\nConnection: close\r\n\r\n<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unmarshalling Error: 意外的元素 (uri:\"\", local:\"__cachedRelations\")。所需元素为&lt;{}password>,&lt;{}user_at_domain> </faultstring></soap:Fault></soap\r\n```\r\n\r\n### Link to sample repo to reproduce issue (if bug)\r\n\r\n\r\n\r\n### Expected result\r\n\r\n\r\n\r\n### Actual result (if bug)\r\n\r\n\r\n\r\n### Additional information (Node.js version, LoopBack version, etc)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-connector-soap/issues/comments/352751058","html_url":"https://github.com/strongloop/loopback-connector-soap/issues/77#issuecomment-352751058","issue_url":"https://api.github.com/repos/strongloop/loopback-connector-soap/issues/77","id":352751058,"user":{"login":"liudonghua123","id":2276718,"avatar_url":"https://avatars3.githubusercontent.com/u/2276718?v=4","gravatar_id":"","url":"https://api.github.com/users/liudonghua123","html_url":"https://github.com/liudonghua123","followers_url":"https://api.github.com/users/liudonghua123/followers","following_url":"https://api.github.com/users/liudonghua123/following{/other_user}","gists_url":"https://api.github.com/users/liudonghua123/gists{/gist_id}","starred_url":"https://api.github.com/users/liudonghua123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liudonghua123/subscriptions","organizations_url":"https://api.github.com/users/liudonghua123/orgs","repos_url":"https://api.github.com/users/liudonghua123/repos","events_url":"https://api.github.com/users/liudonghua123/events{/privacy}","received_events_url":"https://api.github.com/users/liudonghua123/received_events","type":"User","site_admin":false},"created_at":"2017-12-19T13:36:03Z","updated_at":"2017-12-19T13:36:03Z","author_association":"NONE","body":"I updated the latest dependencies, but still the same error.\r\n\r\nmy dependencies part of package.json is below.\r\n\r\n```\r\n  \"dependencies\": {\r\n    \"compression\": \"^1.7.1\",\r\n    \"cors\": \"^2.8.4\",\r\n    \"helmet\": \"^3.9.0\",\r\n    \"loopback\": \"^3.17.1\",\r\n    \"loopback-boot\": \"^2.27.0\",\r\n    \"loopback-component-explorer\": \"^5.2.0\",\r\n    \"loopback-connector-soap\": \"^4.0.1\",\r\n    \"serve-favicon\": \"^2.4.5\",\r\n    \"strong-error-handler\": \"^2.3.0\"\r\n  }\r\n```\r\n\r\nWhen I invoke an endpoint on loopback-explorer like `/api/APISoapBinding/authenticate`. The following error is shown.\r\n\r\n![image](https://user-images.githubusercontent.com/2276718/34159474-5ae3849c-e504-11e7-8dd2-cb103742e9d5.png)\r\n\r\nThe error message of backend console is.\r\n\r\n```\r\n未处理请求 POST /api/APISoapBinding/authenticate 的错误：Error: faultcode: soap:Client faultstring: Unmarshalling Error: 意外的元素 (uri:\"\", local:\"__cachedRelations\")\r\n。所需元素为<{}password>,<{}user_at_domain>\r\n    at XMLHandler.xmlToJson (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\strong-soap\\src\\parser\\xmlHandler.js:637:23)\r\n    at D:\\code\\loopback\\ynu-mail-ws\\node_modules\\strong-soap\\src\\client.js:279:28\r\n    at D:\\code\\loopback\\ynu-mail-ws\\node_modules\\loopback-datasource-juggler\\lib\\observer.js:250:22\r\n    at doNotify (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\loopback-datasource-juggler\\lib\\observer.js:155:49)\r\n    at SOAPConnector.ObserverMixin._notifyBaseObservers (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\loopback-datasource-juggler\\lib\\observer.js:178:5)\r\n    at SOAPConnector.ObserverMixin.notifyObserversOf (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\loopback-datasource-juggler\\lib\\observer.js:153:8)\r\n    at cbForWork (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\loopback-datasource-juggler\\lib\\observer.js:240:14)\r\n    at Request._callback (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\loopback-connector-soap\\lib\\http.js:98:9)\r\n    at Request.self.callback (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\request\\request.js:186:22)\r\n    at Request.emit (events.js:159:13)\r\n    at Request.<anonymous> (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\request\\request.js:1163:10)\r\n    at Request.emit (events.js:159:13)\r\n    at IncomingMessage.<anonymous> (D:\\code\\loopback\\ynu-mail-ws\\node_modules\\request\\request.js:1085:12)\r\n    at Object.onceWrapper (events.js:254:19)\r\n    at IncomingMessage.emit (events.js:164:20)\r\n    at endReadableNT (_stream_readable.js:1062:12)\r\n\r\n```\r\n\r\n"}}
{"actor":{"display_login":"liudonghua123"}}