Skip to main content
New Participant
May 14, 2010
Question

Webservice API call

  • May 14, 2010
  • 3 replies
  • 9052 views

I have been trying to make Webservice call to "https://webservice.exacttarget.com/etframework.wsdl" using coldfusion server 9.0 without much success. My code recognizes WSDL and it methods but When I call method it throws following error:

Web service operation Describe with parameters {{DESCRIBEREQUESTS={[Lcom.et.client.ObjectDefinitionRequest;@78b0e1}}} cannot be found.

Please suggest.....



MyCode CFM file code:

Package Class: "com.et.client"

<cfsilent>
    <cffunction name="head1" access="private" returntype="Any" output="false"
                hint="Return the header needed to make an Omniture web service request as a SOAPHeaderElement object">
        <cfargument name="strUsername" type="String" required="true" />
        <cfargument name="strSecret" type="String" required="true" />
        <cfscript>
            // Unique random number
            var strNonce = createUUID();
          
            var strCreated  = DateFormat(Now(),'YYYY-mm-dd H:mm:ss');
          
            var strPassword = arguments.strSecret;
           
            // Start to build header
            var objHeader = CreateObject("java", "org.apache.axis.message.SOAPHeaderElement");
            var nodeUserToken = "";
            var nodePassword = "";
            // Construct XML structure with code
            objHeader.init("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "wsse:Security");
            objHeader.setMustUnderstand(1);
            objHeader.setActor("");
            nodeUserToken = objHeader.addChildElement("wsse:UsernameToken");
            nodeUserToken.setAttribute("wsu:Id", "User");
            nodeUserToken.addChildElement("wsse:Username").setValue(arguments.strUsername);
            nodePassword = nodeUserToken.addChildElement("wsse:Password");
            nodePassword.setAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0##PasswordText");
            nodePassword.setValue(strPassword);
            nodeUserToken.addChildElement("wsse:Nonce").setValue(strNonce);
            nodeUserToken.addChildElement("wsu:Created").setValue(strCreated);
        </cfscript>
        <cfreturn objHeader />
    </cffunction>

    <cfscript>
        objHeader = head1("test", "emails@3");
        objService = CreateObject("webservice", "https://webservice.exacttarget.com/etframework.wsdl");
        objService.setHeader(objHeader);

                                definitionRequest =  createObject("java", "com.et.client.ObjectDefinitionRequest").init();
                                definitionRequest.setObjectType("Account");
                               
                                DefinitionRequestMsg  = StructNew();                               
                                defre = arraynew(1);
                                defre[1] =definitionRequest;
                               
                                DefinitionRequestMsg.DescribeRequests = JavaCast("com.et.client.ObjectDefinitionRequest[]",defre);
   </cfscript>

</cfsilent>
</br>
SubKey ::: <cfdump var="#sub.SubscriberKey#">
<br/>
<p>
Type ::: <cfdump var="#definitionRequest.getObjectType()#">
<br/>
<p>
DefinitionRequestMsg ::: <cfdump var="#DefinitionRequestMsg.DescribeRequests[1].ObjectType#">
<br/>

<p>
Methods ::: <cfdump var="#objService#">
<br/>
<cfscript>
objService.Describe(DefinitionRequestMsg);
resp = getSOAPResponse(objService);



OutPut:

SubKey :::  Jon_Doe 

Type :::  Account

DefinitionRequestMsg :::  Account

Methods ::: 

object of com.exacttarget.wsdl.partnerAPI.SoapBindingStub
Class Namecom.exacttarget.wsdl.partnerAPI.SoapBindingStub
Methods
MethodReturn Type
configure(com.exacttarget.wsdl.partnerAPI.ConfigureRequestMsg)com.exacttarget.wsdl.partnerAPI.ConfigureResponseMsg
create(com.exacttarget.wsdl.partnerAPI.CreateRequest)com.exacttarget.wsdl.partnerAPI.CreateResponse
delete(com.exacttarget.wsdl.partnerAPI.DeleteRequest)com.exacttarget.wsdl.partnerAPI.DeleteResponse
describe(com.exacttarget.wsdl.partnerAPI.DefinitionRequestMsg)com.exacttarget.wsdl.partnerAPI.DefinitionResponseMsg
execute(com.exacttarget.wsdl.partnerAPI.ExecuteRequest[])com.exacttarget.wsdl.partnerAPI.ExecuteResponseMsg
extract(com.exacttarget.wsdl.partnerAPI.ExtractRequest[])com.exacttarget.wsdl.partnerAPI.ExtractResponseMsg
getSystemStatus(com.exacttarget.wsdl.partnerAPI.SystemStatusRequestMsg)com.exacttarget.wsdl.partnerAPI.SystemStatusResponseMsg
perform(com.exacttarget.wsdl.partnerAPI.PerformRequestMsg)com.exacttarget.wsdl.partnerAPI.PerformResponseMsg
query(com.exacttarget.wsdl.partnerAPI.QueryRequestMsg)com.exacttarget.wsdl.partnerAPI.QueryResponseMsg
retrieve(com.exacttarget.wsdl.partnerAPI.RetrieveRequestMsg)com.exacttarget.wsdl.partnerAPI.RetrieveResponseMsg
schedule(com.exacttarget.wsdl.partnerAPI.ScheduleRequestMsg)com.exacttarget.wsdl.partnerAPI.ScheduleResponseMsg
update(com.exacttarget.wsdl.partnerAPI.UpdateRequest)com.exacttarget.wsdl.partnerAPI.UpdateResponse
versionInfo(com.exacttarget.wsdl.partnerAPI.VersionInfoRequestMsg)com.exacttarget.wsdl.partnerAPI.VersionInfoResponseMsg
Fields
FieldValue
java.lang.String ENDPOINT_ADDRESS_PROPERTYjavax.xml.rpc.service.endpoint.address
java.lang.String PASSWORD_PROPERTYjavax.xml.rpc.security.auth.password
java.lang.String SESSION_MAINTAIN_PROPERTYjavax.xml.rpc.session.maintain
java.lang.String USERNAME_PROPERTYjavax.xml.rpc.security.auth.username
Parent Class
object org.apache.axis.client.Stub
Class Nameorg.apache.axis.client.Stub
Methods
MethodReturn Type
_createCall()org.apache.axis.client.Call
_getCall()org.apache.axis.client.Call
_getProperty(java.lang.String)java.lang.Object
_getPropertyNames()java.util.Iterator
_getService()javax.xml.rpc.Service
_setProperty(java.lang.String, java.lang.Object)void
addAttachment(java.lang.Object)void
clearAttachments()void
clearHeaders()void
extractAttachments(org.apache.axis.client.Call)void
getAttachments()java.lang.Object[]
getHeader(java.lang.String, java.lang.String)org.apache.axis.message.SOAPHeaderElement
getHeaders()org.apache.axis.message.SOAPHeaderElement[]
getPassword()java.lang.String
getPortName()javax.xml.namespace.QName
getResponseHeader(java.lang.String, java.lang.String)org.apache.axis.message.SOAPHeaderElement
getResponseHeaders()org.apache.axis.message.SOAPHeaderElement[]
getTimeout()int
getUsername()java.lang.String
removeProperty(java.lang.String)java.lang.Object
setHeader(java.lang.String, java.lang.String, java.lang.Object)void
setHeader(org.apache.axis.message.SOAPHeaderElement)void
setMaintainSession(boolean)void
setPassword(java.lang.String)void
setPortName(javax.xml.namespace.QName)void
setPortName(java.lang.String)void
setTimeout(int)void
setUsername(java.lang.String)void



The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.


The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request

Web service operation Describe with parameters {{DESCRIBEREQUESTS={[Lcom.et.client.ObjectDefinitionRequest;@78b0e1}}} cannot be found.

The error occurred in /Users/bgogineni/ColdFusion/wwwroot/ET/index2.cfm: line 84
82 : <br/> 83 : <cfscript> 
84 :  objService.Describe(DefinitionRequestMsg); 85 :  resp = getSOAPResponse(objService); 86 :

Resources:  
Browser Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
Remote Address 127.0.0.1
Referrer 
Date/Time 13-May-10 10:27 PM
Stack Trace
at cfindex22ecfm949006999.runPage(/Users/bgogineni/ColdFusion/wwwroot/ET/index2.cfm:84)                 

coldfusion.xml.rpc.ServiceProxy$ServiceMethodNotFoundException: Web service operation Describe with parameters {{DESCRIBEREQUESTS={[Lcom.et.client.ObjectDefinitionRequest;@78b0e1}}} cannot be found. at coldfusion.xml.rpc.ServiceProxy.invokeImpl(ServiceProxy.java:256) at coldfusion.xml.rpc.ServiceProxy.invoke(ServiceProxy.java:154) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cfindex22ecfm949006999.runPage(/Users/bgogineni/ColdFusion/wwwroot/ET/index2.cfm:84) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:363) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:87) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


Debugging Information
ColdFusion Server Enterprise9,0,0,251028
Template/ET/index2.cfm
Time Stamp13-May-10 10:27 PM
LocaleEnglish (US)
User AgentMozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9
Remote IP127.0.0.1
Host Namelocalhost


Execution Time

Total TimeAvg TimeCountTemplate
15 ms15 ms1top level /Users/bgogineni/ColdFusion/wwwroot/ET/index2.cfm
14 msSTARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
29 msTOTAL EXECUTION TIME
red = over 250 ms average execution time 


Exceptions

22:27:34.034 - Application Exception - in /Users/bgogineni/ColdFusion/wwwroot/ET/index2.cfm : line 84
    Web service operation Describe with parameters {{DESCRIBEREQUESTS={[Lcom.et.client.ObjectDefinitionRequest;@78b0e1}}} cannot be found.    



Thanks

-GBK



    This topic has been closed for replies.

    3 replies

    Known Participant
    December 1, 2014

    Dear All Technology Expert's,

    I have a query related to Coldfusion SOAP services, that is most commonly asked in all the forum's but NONE of them has got answer.

    If there is NO solution so I think Adobe has to come up with some patches so developer can able to do some customization.

    I like to share with you all, in all other language ( PHP, JAVA, .NET etc) this option is available and you can customize the error.

    Ok let me again explain the very basic error:

    SOAP Request:

    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

       <soapenv:Header/>

       <soapenv:Body>

        

       </soapenv:Body>

    </soapenv:Envelope>

    SOAP Response:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

       <soapenv:Body>

          <soapenv:Fault>

             <faultcode>soapenv:Server.userException</faultcode>

             <faultstring>java.lang.Exception: Body not found.</faultstring>

             <detail>

                <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.lang.Exception: Body not found.

      at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)...</ns1:stackTrace>

                <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">Coldfusion Error</ns2:hostname>

             </detail>

          </soapenv:Fault>

       </soapenv:Body>

    </soapenv:Envelope>

    HOW we can customize the error, in all other languages you can simple customize the error like

    Other languages SOAP response:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

       <soapenv:Body>

          <soapenv:Fault>

             <faultcode>BODY_NOT_FOUND</faultcode>

             <faultstring>Body is missing in your request</faultstring>

            

          </soapenv:Fault>

       </soapenv:Body>

    </soapenv:Envelope>

    But the same is NOT possible in Coldfusion, right?

    AS you know it is vulnerability to display exception messages in the response.

    We are developing this web service to access  from other language website (PHP, .NET).

    We are also planning to upgrade server the Coldfusion 11, but do you think there is any solution with latest Coldfusion version.

    Please response only if you know about these issue's or solution. 

    Thanks

    Niyaz

    BKBK
    Community Expert
    December 1, 2014

    @Niyaz

    You will gain little by asking the same question in multiple places in the forum. In fact, many might consider it annoying or even spam.

    This question is being discussed in the thread that HaroonTyagi started. (Are you HaroonTyagi, by chance?) I will post an answer there shortly.

    August 3, 2010

    Heya,

    I've just commenced work on an integration project requiring ExactTarget API access to a CRM application built in CF. Decided to do a quick online search for code examples before tackling it myself and came across this post. I haven't given the following page's example code a test run myself but will be in the next day or so. Until then, check this page out and see if that sheds some light on the matter.

    Off the top my head and based on the ExactTarget API documentation I've read thus far I'd say its safe to conclude you're problem can be fixed since there is no reason for ColdFusion to be unable to communicate with ExactTarget's API. The API supports Apache AXIS and Java, both of which are already built-in to ColdFusion. Apache AXIS is the Java based webservice implementation ColdFusion uses for serving and connecting webservices so in theory it shouldn't be a battle getting the two to cooperate. You're not using CF's <CFINVOKE> or createObject() method of handling webservices but instead going for a Java based SOAP method which may be the cause of your issues as I don't know if that way would be going through AXIS but I'd assume it would. I'll post back here if the linked page below doesn't work and I'm able to work it out.

    http://paulalkema.com/post.cfm/how-to-subscribe-a-user-in-exact-target-via-their-api

    A workaround option would be to focus on the Apache AXIS version used in your CF9 installation and ensure it is a supported build, otherwise you can update CF9's Apache AXIS installation yourself. I'll be giving this a go if I run into problems so will let you know.

    Cheers,

    Pete - googleitics @ RIAForge.com

    New Participant
    June 27, 2011

    Hi,

    Any success on implementing Exact Target API using Coldfusion.

    I have no luck on this, would highly appreciate if I get any help.

    Thanks

    Balbir

    Participating Frequently
    June 27, 2011

    I did not but someone else at the same company did - I believe he did find a

    way with Javi to do the authentication piece and then is using soap

    envelopes to do the other part.

    Where are you stuck at?

    Dan

    Dan O'Keefe

    Tripoint Technologies

    Participating Frequently
    May 24, 2010

    Did you find a solution to this issue?

    Was wondering if your authentication is working, and if it is, are you using the native version of AXIS that ships with CF9? What version is that?

    Gbk_ETAuthor
    New Participant
    June 1, 2010

    No, I spent lot of time with no sucess.

    Now I understand why Adobe Coldfusion is less adapative. No one from coldfusion product team attempted to answer.

    Also there is no documentation on authentication and error codes. If Coldfusion team is looking into it, please open your heart/time and provide some guidence.

    Thanks,

    -GBK