[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

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

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
gaby22
Asked:
gaby22
  • 7
  • 6
  • 2
1 Solution
 
PE_CF_DEVCommented:
What service are you trying to use? What are they returning once you query that service? Does that service have a valide WSDL?
0
 
gaby22Author Commented:

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


returning var: SubmitProdResponse

0
 
PE_CF_DEVCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
MediaStormCommented:
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
 
PE_CF_DEVCommented:
You can use cfhttp to send info to UPS and USPS.
0
 
gaby22Author Commented:
Thank you PE_CF_DEV ..very clear answer
0
 
MediaStormCommented:
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
 
PE_CF_DEVCommented:
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
 
PE_CF_DEVCommented:
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
 
MediaStormCommented:
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
 
PE_CF_DEVCommented:
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
 
MediaStormCommented:
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
 
PE_CF_DEVCommented:
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
 
MediaStormCommented:
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
 
MediaStormCommented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now