Re: WSDL / XML / String help

2010-09-24 Thread Dave Watts

 I am trying to use this WSDL/web service: (the following has been edited for 
 security) ;-)

 cfinvoke webservice=myURL/my_api.cfc?wsdl method=GetUserProfile
 returnvariable=temp1
     cfinvokeargument name=wsID value=1
     cfinvokeargument name=customerid value=1
     cfinvokeargument name=userid value=1
 /cfinvoke

 And when I do this:  cfdump var=#temp1#

 I get this:

 ?xml version=1.0 encoding=utf-8?
 soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:xsd=http://www.w3.org/2001/XMLSchema;

        soap:Body
                GetUserProfileResponse xmlns=http://tempuri.org/;
                        GetUserProfileResult
                                user
                                        UserID1/UserID
                                        firstNameA/firstName
                                        lastNameA/lastName
                                        emaila...@blah.com/email
                                /user
                        /GetUserProfileResult
                /GetUserProfileResponse
        /soap:Body
 /soap:Envelope


 When it gets returned to me, it's a string.
 Any attempts to loop over it like an array gives me errors messages.

 When I just output it, I just get the info found in the user section.

 Is there a process, method, or something that allows me to pull apart that 
 text, and grab the
 pieces I need out of it?

 Is there anyway to say cfset fn = temp1.GetUserProfileResult.user.firstname

 When I try that it fails.

You shouldn't have to manipulate the SOAP XML response directly. You
should just have a single variable (presumably a structure) that
contains UserID, firstName, lastName and email.

Can you post your CFC code?

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337472
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-24 Thread Leigh

 You shouldn't have to manipulate the SOAP XML response
 directly. 

Hmm.. you are right. I had cfhttp on the brain yesterday and skidded right past 
the fact they are using cfinvoke. 

-Leigh



  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337477
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-24 Thread Doug Ford

Hi Dave - 

I haven't put it into any CFC code yet.  I usually work in a simple file to 
test the results, and make sure things work before adding additional overhead.

The only code on the page is this (and then attempts to print out the results): 
 

  cfinvoke webservice=myURL/my_api.cfc?wsdl 
 method=GetUserProfile
  returnvariable=temp1
      cfinvokeargument name=wsID value=1
      cfinvokeargument name=customerid value=1
      cfinvokeargument name=userid value=1
  /cfinvoke
 

Thanks,

Doug

___


 Can you post your CFC code?
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 http://training.figleaf.com/
 
 Fig Leaf 
Software

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337481
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-24 Thread James Holmes

Dave means the cfc at myURL/my_api.cfc

There must be some code there, right?

--
WSS4CF - WS-Security framework for CF
http://wss4cf.riaforge.org/



On 24 September 2010 22:54, Doug Ford doug.e.f...@gmail.com wrote:

 Hi Dave -

 I haven't put it into any CFC code yet.  I usually work in a simple file to 
 test the results, and make sure things work before adding additional overhead.

 The only code on the page is this (and then attempts to print out the 
 results):

  cfinvoke webservice=myURL/my_api.cfc?wsdl
 method=GetUserProfile
  returnvariable=temp1
      cfinvokeargument name=wsID value=1
      cfinvokeargument name=customerid value=1
      cfinvokeargument name=userid value=1
  /cfinvoke

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337484
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-24 Thread Doug Ford

Hi folks - 

It looks like Leigh might be the winner in this contest...

When I did this:

cfset resultXML = xmlParse(trim(temp1)) 

I was able to do this:

cfdump var=#resultXML#

And actually see some XML code.

Thank you all for trying to help.

Dave as for the CFC of the SOAP service, I don't have direct access to it.

Thank you again for giving me ideas!

If I have problems, I will be back... as always!

Doug 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337493
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-23 Thread Leigh

Use xmlParse() to convert the string to an xml document. The results will be 
under envelope.body 

cfset resultXML = xmlParse(temp1)
cfset baseXML = resultXML.Envelope.body
cfoutput
#baseXML.GetUserProfileResponse.GetUserProfileResult.user.firstname.xmlText#
/cfoutput



  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337433
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-23 Thread Doug Ford

 Use xmlParse() to convert the string to an xml document. The results 
 will be under envelope.body 
 
 cfset resultXML = xmlParse(temp1)
 cfset baseXML = resultXML.Envelope.body
 cfoutput
 #baseXML.GetUserProfileResponse.GetUserProfileResult.user.firstname.
 xmlText#
 /cfoutput
 
 
 

Hi Leigh - 

Thanks for your suggestion, but that's what I thought also.

Since the info that I get back into temp1 is a string, most if not all XML 
functions don't work.

I cut and pasted your text and got this:

 An error occured while Parsing an XML document.
The processing instruction target matching [xX][mM][lL] is not allowed. 


Thanks,

Doug


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337434
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: WSDL / XML / String help

2010-09-23 Thread Leigh

Make sure you trim() the string first. Excess white space often makes 
xmlParse() choke.



  

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337436
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm