Question

Soap Coldfusion

Asked by: da_squire

Lost am i......

This is what i have:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.somesite.com/Wsdl/services/HitNoHit" xmlns:types="http://www.somesite.com/Wsdl/services/HitNoHit/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:getHitNoHit>
<in0 href="#id1" />
</tns:getHitNoHit>
<tns:HitNoHitData id="id1" xsi:type="tns:HitNoHitData">
<birthDay xsi:type="xsd:dateTime">1980-04-14T02:00:00.0000000+02:00</birthDay>
<firstname xsi:type="xsd:string">Luc</firstname>
<name xsi:type="xsd:string">Skywalker</name>
</tns:HitNoHitData>
</soap:Body>
</soap:Envelope>

I have added the webservice......via the components panel.

Now i think this will send me back a variable called "result".....how do i send this SOAP envelope with coldfusion.....I'm on coldfusion 7...dreamweaver latest version.....

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-02-01 at 05:28:49ID21718401
Tags

coldfusion

,

soap

Topics

ColdFusion Application Server

,

ColdFusion Studio

Participating Experts
1
Points
500
Comments
16

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Soap
    hi, I'm new here and new to soap programming. Can anyone direct me to places where I can find some examples. Thanks
  2. Soap - 'soapenv:' versus 'soap:'
    I've got a .NET web service that I have to connect to using Java. The .NET service specifies the following as an example SOAP call: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&qu...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: RCorfmanPosted on 2006-02-05 at 12:48:29ID: 15878389

I use CFINVOKE to make web service calls.
For instance, if you have a service, GetHitNoHit available at http://www.somesite.com/Wsdl/services/HitNoHit that takes three parameters, Birthday, firstname and name (case sensitivity is IMPORTANT here), the you could try

<cfinvoke webservice="http://www.somesite.com/Wsdl/services/HitNoHit" method="GetHitNoHit" result="MyReturnVar">
 <cfinvokeargument name="Birthday" value="#datevar#">
 <cfinvokeargument name="firstname" value="#firstnamevar#">
 <cfinvokeargument name="firstname" value="#firstnamevar#">
</cfinvoke>

I just do 'straight' cold fusion without any tools (just notepad), so I'm not sure about the componenet registration piece, but I'm pretty sure you can just code the above call to invoke the service.

 

by: da_squirePosted on 2006-02-06 at 00:26:36ID: 15881045

Thi si what i did

<cfinvoke
 webservice="http://www.somesite.com/flashg/epis.wsdl" method="getHitNoHit" returnvariable="aHitNoHitData">
 <cfinvokeargument name="birthDay" value="1980-04-14T02:00:00.0000000+02:00">
 <cfinvokeargument name="firstname" value="luc">
 <cfinvokeargument name="name" value="Van Eeckhaute">
</cfinvoke>

this is my error:

Web service operation "getHitNoHit" with parameters {birthDay={1955-04-14T02:00:00.0000000+02:00},firstname={luc},name={Van Eeckhaute}} could not be found.  
 
 
The error occurred in D:\Inetpub\flashg\details.cfm: line 17
 
15 :  <cfinvokeargument name="birthDay" value="1955-04-14T02:00:00.0000000+02:00">
16 :  <cfinvokeargument name="firstname" value="luc">
17 :  <cfinvokeargument name="name" value="Van Eeckhaute">
18 : </cfinvoke>
 

Not Sure what is wrong here seems like it should be straight forward..but i aint seeing it.

Do you know what this error means?


 

by: RCorfmanPosted on 2006-02-06 at 01:21:10ID: 15881216

can you post the wsdl? or a link to the wsdl that is accessible from the internet?

 

by: da_squirePosted on 2006-02-06 at 01:44:29ID: 15881307

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" xmlns:intf="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2
Built on May 03, 2005 (02:20:24 EDT)-->
 <wsdl:types>
  <schema targetNamespace="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="HitNoHitData">
    <sequence>
     <element name="birthDay" nillable="true" type="xsd:dateTime"/>
     <element name="firstname" nillable="true" type="xsd:string"/>
     <element name="idCard" nillable="true" type="xsd:string"/>
     <element name="name" nillable="true" type="xsd:string"/>
     <element name="natRegNum" nillable="true" type="xsd:string"/>
     <element name="nationality" nillable="true" type="xsd:string"/>
     <element name="passport" nillable="true" type="xsd:string"/>
     <element name="result" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="getHitNoHitRequest">

      <wsdl:part name="in0" type="impl:HitNoHitData"/>

   </wsdl:message>

   <wsdl:message name="getHitNoHitResponse">

      <wsdl:part name="getHitNoHitReturn" type="impl:HitNoHitData"/>

   </wsdl:message>

   <wsdl:portType name="HitNoHit">

      <wsdl:operation name="getHitNoHit" parameterOrder="in0">

         <wsdl:input message="impl:getHitNoHitRequest" name="getHitNoHitRequest"/>

         <wsdl:output message="impl:getHitNoHitResponse" name="getHitNoHitResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="HitNoHitSoapBinding" type="impl:HitNoHit">

      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="getHitNoHit">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getHitNoHitRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="getHitNoHitResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="HitNoHitService">

      <wsdl:port binding="impl:HitNoHitSoapBinding" name="HitNoHit">

         <wsdlsoap:address location="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions

 

by: da_squirePosted on 2006-02-06 at 04:20:33ID: 15882013

I have been playing but no luck yet......

I appreciate you helping me out here.....

 

by: RCorfmanPosted on 2006-02-06 at 06:58:35ID: 15883074

I'm not sure why it isn't working either, but I'd try two more items. First, I'd try passing a date variable into the birthDate arguement to see if that works.  If that doesn't help, I know all the types show nillable in the wsdl, but you might try specifying them all none-the-less, in order. I know I've run into problems calling cfc's as a webservice without all the elements, and that could be it (thought that is documented on macromedia's website as a cfc requirement).

 

by: da_squirePosted on 2006-02-09 at 02:20:44ID: 15911128

Hi RC,

I have trying to get it right.....


this is what i ahve so far:

<cfsavecontent variable="thesoap">
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit" xmlns:types="http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:getHitNoHit>
<in0 href="#id1" />
</tns:getHitNoHit>
<tns:HitNoHitData id="id1" xsi:type="tns:HitNoHitData">
<birthDay xsi:type="xsd:dateTime">1955-04-14T02:00:00.0000000+02:00</birthDay>
<firstname xsi:type="xsd:string">Luc</firstname>
<name xsi:type="xsd:string">Van Eeckhaute</name>
</tns:HitNoHitData>
</soap:Body>
</soap:Envelope>
</cfsavecontent>

<cfhttp url="http://a2s/EPISService/Service1.asmx" method="post" delimiter="," resolveurl="yes" >    
<cfhttpparam type="header" name="result" value="http://a2s/EPISService/Service1.asmx">
  <cfhttpparam type="xml" name="body" value="#theSoap#">
</cfhttp>

<cfdump var="#cfhttp.FileContent#">

And this what i seee on my page....

<?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> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope>


How do i get the result to display?

 

by: RCorfmanPosted on 2006-02-09 at 06:16:42ID: 15912722

So I take it you couldn't get the <cfinvoke> tag to work? Unfortunate. That is the way I've called webservices in the past. I'm out of town so I don't have all my reference materials with me. I believe, before your <cfhttpparam> that you are sending, you need to send another with a header variable specifying the soap action. In a raw html header it would be something like
SOAPAction: ""
(note that the wsdl shows that the soapaction is <wsdlsoap:operation soapAction=""/>)
I'm not exactly sure what the format is for the <cfhttpparam>, but likely something like:

<cfhttp url="http://a2s/EPISService/Service1.asmx" method="post" delimiter="," resolveurl="yes" >    
  <cfhttpparam type="header" name="result" value="http://a2s/EPISService/Service1.asmx">
  <cfhttpparam type="header" name="SOAPAction" value="SOAPAction """"">
  <cfhttpparam type="xml" name="body" value="#theSoap#">
</cfhttp>

I'm not sure that you need the other header call that you have of name="result". But without access to my reference materials and development environment, I'm afraid I can't play with it myself.

 

by: da_squirePosted on 2006-02-10 at 01:13:33ID: 15920523

I did try the <invoke> tags and for me that seeems like the best bet. but it did not work...its at the top of this post.

We tried to connect using Visual Basic sand all worked perfectly then through flash and that worked well, but coldfusion has us a bit stumped.

This is what i get with the latest code you posted:

<?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> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>Server did not recognize the value of HTTP Header SOAPAction: SOAPAction=&amp;quot;&amp;quot;.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope>

So i started playing around a bit but again no luck.........I will have to use ASp and somehow intergrate the two......CF and ASP should not be too difficult. but if you could keep trying to help me here that would be great.....

i can wait for this to be resolved so when you are back in town we can try fix it....hope you have a good trip
Cheers

 

by: RCorfmanPosted on 2006-02-10 at 01:48:38ID: 15920659

Looks like coldfusion is escaping the "'s when it send the header. Maybe someone else can come up with further help. I've been able to call with cfinvoke without problems.  Soap is suppose to be easy, but It never seems to work out that way until it is actually working, then it's easy ;)

I'd give one last thing to try.  Instead of
<cfhttpparam type="header" name="SOAPAction" value="SOAPAction """"">
how about
<cfhttpparam type="header" name="SOAPAction" value="SOAPAction ">
or
<cfhttpparam type="header" name="SOAPAction" value="SOAPAction ''">  (note, two single quotes followed by a double quote).

I'm not sure either will work, I'm grasping at straws now. The proper way to do it is with cfinvoke.

 

by: RCorfmanPosted on 2006-02-10 at 02:02:10ID: 15920722

actually, I think I found the answer.
http://hcc.musc.edu/research/shared_resources/xml_complex_types_to_cf_structure_notes.cfm

This is a sample from the above website that uses a different approach. I think the wdsl snippet they show in the referenced url above is similar to the one you are calling (except different names).  I think an approach like below may be worth pursuing.
<cfscript>
   stUser = structNew();
   stUser.fname = "John";
   stUser.lname = "Smith";
   stUser.age = 23;
   ws = createObject("webservice", "http://somehost/echosimple.asmx?wsdl");
   ws.echoStruct(stUser);
</cfscript>

Maybe looks something like
<cfscript>
 stHit = structNew();
 stHit.birthDay = "1955-04-14T02:00:00.0000000+02:00";
 stHit.firstname = "Luc";
 stHit.name = "Van Eeckhaute";
  ws = createObject("webservice", "http://www.gamingcommission.fgov.be/episWsdl/services/HitNoHit");
 ws.echoStruct(stHit);
</cfscript>

You may need to provide all the parameters. I'd also consider changing the birthDay string type to an actual cold fusion date.  But, it gives you another direction to try...

 

by: da_squirePosted on 2006-02-10 at 02:04:46ID: 15920733

hi i tired that and that and every straw i could think of.....and no luck.......It should have been so straight forward.

I will leave the question open for a while if no one comes up with a solution you can have the points..........

Thanks anyway...

 

by: da_squirePosted on 2006-02-10 at 02:05:42ID: 15920738

k let me try...i will let you know....

 

by: da_squirePosted on 2006-02-10 at 04:25:20ID: 15921902

i played around and eventually got here, ok so this:

<cfscript>
 stHit = structNew();
 stHit.birthDay = "1955-04-14T02:00:00.0000000+02:00";
 stHit.firstname = "Luc";
 stHit.idCard = "";
 stHit.name = "Van Eeckhaute";
 stHit.natRegNum = "";
 stHit.nationality = "";
 stHit.passport = "";
 stHit.result = "";
 
 ws = createObject("webservice", "http://a2s/EPISService/Service1.asmx?WSDL");
 ws.echoStruct(stHit);
</cfscript>


give sme this error:

Web service operation "aHitNoHitData" with parameters {{BIRTHDAY={1955-04-14T02:00:00.0000000+02:00},RESULT={},IDCARD={},PASSPORT={},NAME={Van Eeckhaute},NATIONALITY={},FIRSTNAME={Luc},NATREGNUM={}}} could not be found.  
 
 
The error occurred in D:\Inetpub\flashg\details.cfm: line 21
 
19 :  
20 :  ws = createObject("webservice", "http://a2s/EPISService/Service1.asmx?WSDL");
21 :  ws.aHitNoHitData(stHit);
22 : </cfscript>
23 :
 

And this is somewhat positive no error but:

<cfhttp url="http://a2s/EPISService/Service1.asmx?WDSL" method="post" delimiter="," resolveurl="yes">    
  <cfhttpparam type="header" name="result" value="http://a2s/EPISService/Service1.asmx">
<cfhttpparam type="header" name="SOAPAction" value="SOAPAction """"">
  <cfhttpparam type="xml" name="body" value="#theSoap#">
</cfhttp>



<cfdump var="#cfhttp.errorDetail#">

It give me an empty string:      [empty string]

Hmmmmm....it's close, we can't be far off.....

 

by: da_squirePosted on 2006-02-14 at 04:10:59ID: 15950149

ok....

I have managed to get it working through flash...the strange thing is that if i run the flash through a local html file so just double clicking on the file...it works.

BUT when i run the HTML file through IIS so i browse to a site, setup through IIS the flash does not work.

So i am guessing it is a problem in the actual Coldfusion Setup, perhaps something in the coldfusion administrator that is preventing the soap from sending corretly it could also be IIS. I am not sure. If you have encountered a situation like this previuosly what was your solution?

Please help!

 

by: da_squirePosted on 2006-02-21 at 05:11:40ID: 16008262

Final Answer we had to create a new webservice......RC these points are all yours.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...