0 Replies Latest reply on Sep 6, 2006 6:16 PM by cfmxWeb

    Adding soap header in MX6.1

    cfmxWeb
      I have a code working on MX7, it first adds soap header(username and password) then gets the response, but similar code didn't work on MX6.1. Please help.
      MX7 code:
      <cfscript>
      ru = XmlNew();
      ru.AuthenticationHeader = XmlElemNew(ru, " http://www.mytesting.com/Webservices/ProductInfo","AuthenticationHeader");
      ru.AuthenticationHeader.UserName = mlElemNew(ru," http://www.mytesting.com/Webservices/ProductInfo","UserName");
      ru.AuthenticationHeader.UserName.XmlText = "myusername";
      ru.AuthenticationHeader.Password = XmlElemNew(ru," http://www.mytesting.com/Webservices/ProductInfo","Password");
      ru.AuthenticationHeader.Password.XmlText = "mypassword";

      ws = CreateObject("webservice", " http://www.mytesting.com/Webservices/ProductInfo/Management.asmx?WSDL");
      addSOAPRequestHeader(ws, " http://www.mytesting.com/Webservices/ProductInfo", "AuthenticationHeader", ru.AuthenticationHeader, true);
      subbid = ws.GetProductInfo();
      </cfscript>


      MX6.1 code:
      <!--- get SOAP functions --->
      <cfinclude template="soap-udfs.cfm">
      <cfscript>
      ru = XmlNew();
      ru.AuthenticationHeader = XmlElemNew(ru, " http://www.mytesting.com/Webservices/ProductInfo","AuthenticationHeader");
      ru.AuthenticationHeader.UserName = XmlElemNew(ru," http://www.mytesting.com/Webservices/ProductInfo","UserName");
      ru.AuthenticationHeader.UserName.XmlText = "myusername";
      ru.AuthenticationHeader.Password = XmlElemNew(ru," http://www.mytesting.com/Webservices/ProductInfo","Password");
      ru.AuthenticationHeader.Password.XmlText = "mypassword";

      ws = CreateObject("webservice", " http://www.mytesting.com/Webservices/ProductInfo/Management.asmx?WSDL");
      addRequestHeader(ws, "AuthenticationHeader", ru.AuthenticationHeader, " http://www.mytesting.com/Webservices/ProductInfo", true);
      subbid = ws.GetProductInfo();
      </cfscript>

      Error message for MX6.1:
      Could not perform web service invocation "GetProductInfo" because AxisFault faultCode: { http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.io.IOException: No serializer found for class coldfusion.xml.XmlNodeList in registry org.apache.axis.encoding.TypeMappingImpl@19a61ad faultActor: faultNode: faultDetail: { http://xml.apache.org/axis/}stackTrace: java.io.IOException: No serializer found for class coldfusion.xml.XmlNodeList in registry org.apache.axis.encoding.TypeMappingImpl@19a61ad at org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImp l.java:1281) at org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java :795) at org.apache.axis.message.MessageElement.outputImpl(MessageElement.java:817) at org.apache.axis.message.SOAPHeaderElement.outputImpl(SOAPHeaderElement.java:250) at org.apache.axis.message.MessageElement.output(MessageElement.java:783) at org.apache.axis.message.SOAPHeader.outputImpl(SOAPHeader.java:342) at org.apache.ax...