Solved

how do I post two vars to a SOAP web service? What do I need to know in order to proce

Posted on 2004-04-15
15
292 Views
Last Modified: 2013-12-24
What do I need to know in order to process a cfinvoke if this is the approach. Please do no copy and paste the Macromedia user's guide with this tag. I have that. I need to be sure what's the best tag I can use:  cfhttp, cfinvoke, or  cfx_rawsocket (custom tag)

How do I use the tag? What do I need from the other end?
0
Comment
Question by:gaby22
  • 7
  • 6
  • 2
15 Comments
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10836080
What service are you trying to use? What are they returning once you query that service? Does that service have a valide WSDL?
0
 

Author Comment

by:gaby22
ID: 10836302

I'm using CF posting to SOAP service. the service has a
http://admin.server01.com/prodwebservice/prodsaleImport.asmx?WSDL


returning var: SubmitProdResponse

0
 
LVL 6

Accepted Solution

by:
PE_CF_DEV earned 500 total points
ID: 10836536
Well I couldn't view the WSDL..maybe I am not allowed to access it? But I would assume you would use the invoke tag like this:

<cfinvoke    webservice = "http://admin.server01.com/prodwebservice/prodsaleImport.asmx?WSDL"    
method = "operation_name"  
NameoifVar1=valuesofVar1
NameofVar2=var2
 returnVariable = "the name you want to reference">

Cfinvoke is the best way to consume a webservice. Some webtools though like USPS don't provide a nice WSDL so you would have to use cfhttp. I don't know why you would want to use something else unless the webservice requires some wierd transport protocol or something.

as for the method name...this would be the part I would have gotten from the WSDL, it would be the serivce/function/method you want to use...a WSDL could house more than one operation like a calculator webservice where you could call add or subtract as the method with 2 varabiles being sent number1=2 and number2 = 2 and it would add  them together and return 4 or subtract  and return 0, depending on the value I put in method. If I need to explain something more let me know.
0
 
LVL 1

Expert Comment

by:MediaStorm
ID: 10837544
CFInvoke should work for most applications. CFHTTP is also an option if you can't / don't want to use invocation (IE- Non-MX version of CF)
For stuff that is a bit more esoteric like the UPS XML stuff you will need to use a socket tag or the java factory in MX 6.1. CFHTTP will not work with UPS.

Also, if you are trying to invoke a .NET service from CFMX, you need to make sure you have updated to MX 6.1 to make it work properly.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10841688
You can use cfhttp to send info to UPS and USPS.
0
 

Author Comment

by:gaby22
ID: 10842693
Thank you PE_CF_DEV ..very clear answer
0
 
LVL 1

Expert Comment

by:MediaStorm
ID: 10843139
PE_CF_DEV-

I'd love to see a working example of using CFHTTP in CFMX to post and retrieve results to the UPS XML service using CFHTTP. Not the UPS HTML server, the UPS XML server. Since no one else has been able to do it to date,  I'd like to see what magic you can display to make it work using CFHTTP.

USPS yes, UPS HTML yes, UPS XML no. I think you might be have jumped into the deep end of the pool making this claim. Prove me wrong and I will give you 500 points as well.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10843412
Build your XML request and just send it like this to UPS:

<cfhttp url="https://wwwcie.ups.com/ups.app/xml/Rate" method="post">
      <cfhttpparam name="Content-Type" type="HEADER" value="content-type: text/xml; charset='UTF-8';">
      <cfhttpparam type="body" value=#upsxml#>
</cfhttp>
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10843618
Sorry I had to modify some code so it would work on a public server. But here is a link you can use to see the UPS code in action:

http://www.thewayjg.com/showups.html
0
 
LVL 1

Expert Comment

by:MediaStorm
ID: 10843869
Off-Topic:

PE_CF_DEV-

What is your average response time back from the UPS server for tracking results? The rate lookup example from your link has a very quick return for rate info. For tracking we're seeing a huge lag from UPS in the neighborhood from 2,500 ms to over 15,000+ ms and anywhere in between.

Ping times between us and them are good and the delay appears to simply be waiting on query results from their server.

The responses were considerably faster in the past but I was curious if anyone else was seeing lags in tracking results as well.

I'll check out your CFHTTP code and let you know how I fair. We've been using a java factory object to do the RAW posts per Macromedia's recommendation but I would prefer to simplify it and use only CFHTTP if possible.

Thx.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10843941
Well in all our testing the page has a load time of about 650-730 milliseconds.  USPS is slower sometimes due to thier bloated response for international shipping with all the restrictions, prohibitions, and disclaimers. I am actually in the process right now building our completed Shipping Matrix which will utlimately quote rates for UPS USPS and FedEx (FedEx if I get time), as a query bean which will then be displayed to our customers.
0
 
LVL 1

Expert Comment

by:MediaStorm
ID: 10844023
Wow-

We're not seeing tracking query responses anywhere close to those ranges. We're not getting anything back from tracking in under 2 seconds. We don't use the rate queries currently as rate queries are done locally on our backend via the ERP on the AS/400 so I didn't have anything to compare tracking results with.

If you're getting UPS tracking back in those timeframes then something is definately weird on our end and I need to start digging around to find the cause.

I'm measuring the query response times using a getTickCount() before and immediately after the post to UPS so it's likely network related. I'll try the same code off of a different network and let you know if I see a difference.
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 10844138
Humm I have not setup the tracking information yet I would imagine it is slightly slower. But Amazon uses UPS online tools to display tracking on thier website If I recall and they don't seem to have slow page times... I will look into it later if i get a chance.
0
 
LVL 1

Expert Comment

by:MediaStorm
ID: 10844176
I'd be interested in what you find. I just tried it from a completely different server on a completely different network and got similar results.

I'll try a rate inquiry for comparison as well.
0
 
LVL 1

Expert Comment

by:MediaStorm
ID: 10844581
PE_CF_DEV-

I checked the rate inquiry vs tracking inquiry and I am indeed getting rate results back in the sub 600ms range so the delay is definately on the UPS end.

Also, I promised you 500 points for demonstrating UPS XML working with CFHTTP and I'm happy to eat me words. I'll post a question to get your points to you.

The last attempt I made at trying to get CFMX to work with UPS XML still had problems due to the SSL layer and would always return the invalid request message from UPS. I'm glad to see that MM finally got that resolved and everything is in good order now.

Look for a question post from me in a few minutes to get your points to you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now