Skip to main content
Known Participant
October 9, 2008
Question

Proxy Generator

  • October 9, 2008
  • 10 replies
  • 1186 views
Greetings,

Our company utilizes Vovici survey solutions. I am attempting to integrate the reporting using their API into out KM analytics reporting dashboard. I can connect using the CFMX proxy generator, but I could not pull data back. I contacted them and this was the response from one of their developers...

quote:

You need to ensure that the CookieContainer property of the proxy class you're using to call the web service has been set to a valid CookieContainer object. This is how the EFM Community web service API maintains state between method invocations. If this property isn't set, you'll be able to login but the very next function you attempt to call will result in an "Invalid Access" exception because--as far as EFM Community is concerned--you haven't logged in.

Here's how this is done in C#:


using System;using System.Collections.Generic;using System.Net;namespace exampleapp{ class Program { static void Main(string[] args) { ProjectData projectData = new ProjectData(); projectData.CookieContainer = new CookieContainer(); projectData.Login("myuserid", "mypassword"); ...


I am not a C# developer and our site is done in CF anyway. Does anyone know how to accomplish this? I could not find anything in any of the documentation beyond the basics.

Thanks,

~Clay
This topic has been closed for replies.

10 replies

fs22Author
Known Participant
December 13, 2008
I have not quite figured out how to do this. Anyone have any other thoughts/ideas?
Inspiring
October 9, 2008
Ian Skinner wrote:
> You may want to check other links this search returns.
>

Having said that, I looked at the results again and found this
ColdFusion live docs link.

http://livedocs.adobe.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/webservices4.htm

It is for version 6, but I am sure it all still applies, and that there
is a 7 and 8 equivalent livedocs pages. But it gives a good comparison
between the <cfinvoke...> and createObject() syntax that may help you
translate the two forms.
Inspiring
October 9, 2008
fs22 wrote:
> ok...thanks for the tip...other than the link you su[plied earlier...do you have any other areas where perhaps I could read up and learn more?

Nothing off the top of my head. I'm not a web service expert. But I
have always, eventually, sometimes with much hair pulling, gotten
ColdFusion to work with any web service I have needed to use.

I just found that link by searching Google for "coldfusion consume web
service cookies". You may want to check other links this search returns.

fs22Author
Known Participant
October 9, 2008
ok...thanks for the tip...other than the link you su[plied earlier...do you have any other areas where perhaps I could read up and learn more?
Inspiring
October 9, 2008
fs22 wrote:
> Not really because I am using the CFMX proxy and not the Apache one.

No you are using the Apache one, because that is what ColdFusion uses.
That is why I asked for the code, because I'm not used to calling these
'proxies'. But you are just invoking a web service.

Your code used <cfinovke...>

The example code uses createObject().

Other then that, you are doing the same thing.

It sounds like you are using a Dreamweaver wizard and that is masking
what goes on in the actual code. This can not be done with the proxy
wizard. You will need to extend that code to accommodate this requirement.

The first question to absolutely answer, is are you passing an HTTP
cookie, not SOAP header. Looking at the example code I would say yes,
but it is important to be sure.
fs22Author
Known Participant
October 9, 2008
Not really because I am using the CFMX proxy and not the Apache one.
Inspiring
October 9, 2008
fs22 wrote:
> Here is the code you asked for...

Does the link help? Or do you have questions on it?
fs22Author
Known Participant
October 9, 2008
Here is the code you asked for...

<cfinvoke
webservice=" http://efm.activant.com/ws/projectdata.asmx?wsdl"
method="login"
returnvariable="aString">
<cfinvokeargument name="userName" value="Yada"/>
<cfinvokeargument name="password" value="Yada"/>
</cfinvoke>
<cfinvoke
webservice=" http://efm.activant.com/ws/projectdata.asmx?wsdl"
method="getSurveyList"
returnvariable="a_GetSurveyListResponse_GetSurveyListResult">
<cfinvokeargument name="sharingType" value="0"/>
</cfinvoke>

Survey List - <cfoutput>#a_GetSurveyListResponse_GetSurveyListResult#</cfoutput>
Inspiring
October 9, 2008
Did a bit of Googling around and found this blog that might apply to
your scenario.

http://tjordahl.blogspot.com/2006/06/how-to-set-cookies-in-coldfusion-soap.html
Inspiring
October 9, 2008
fs22 wrote:
> Greetings,

Can you show the code actually generated with that wizard?