Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

soap requests

Status
Not open for further replies.

boboost

Programmer
Apr 1, 2005
3
NL
Hello i want to do a soaprequest but i can't get it to work,

I can do simple soap-request in coldfusion using cfscript and webservices. For example:



<cfscript>

ws = createObject("webservice",

"
ws.GetPngMap1("#xcor#","#ycor#","#zoom#","350","350");

resp = getSOAPResponse(ws);

</cfscript>



But now I have I more complicated request, the Soap-request should be sent like this:



<soap:Body>

<Convert xmlns="url">

<x>297</x>

<y>156</y>

<center xsi:type="Coordinate">

<X>171106</X>

<Y>376811</Y>

</center>

<zoomlevel>4</zoomlevel>

<bmSize>

<Width>709</Width>

<Height>469</Height>

</bmSize>

</Convert>

</soap:Body>

Do you know how I can call this in coldfusion? The problem is with the center tag that has an X and a Y and the bmSize tag that has a width and a height.

I hope you can help me out with this.

K.R.



Rolf Oosting
 
What values should be passed for X and Y and bmSize? Form vars? dB vars? Show us some code you have so far.

I used <cfxml> when I submitted my requests in SOAP. I can post some snippets of my code, if I know more of what you're trying to accomplish.


____________________________________
Just Imagine.
 
the center x and y values are the center of a map (integer, those i get from a soaprequest. the bmSize widht and height are integers from a picture map <img scr="#url#" ISMAP>

 
So you get the X and Y values from the client as a SOAP REQUEST, right? Do you submit anything to client firsthand?
This is what my situation was like: submit zipcode to the client to see if its a valid lead, capture the request header and if the zip is accepted submit the lead, otherwise don't.
I set my code up like this:
Code:
	<!--- START: First Step: Send ZipCode to client to check for availability as a CFXML var --->
	<cfxml VARIABLE="ftPostXML"> 
		<soap:Envelope xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/">[/URL]
		  <soap:Body>
			<Ping xmlns="[URL unfurl="true"]http://services.companyABC.com/123/Leads/1.0.0.0/">[/URL]
			  <user_Username>#user_Username#</user_Username>
			  <user_Password>#user_Password#</user_Password>
			  <primary_CurrentPostalCode>#Zip#</primary_CurrentPostalCode>
			</Ping>
		  </soap:Body>
		</soap:Envelope>
	</cfxml>
	<!--- END: First Step: Send ZipCode to client to check for availability as a CFXML var  --->
	
	<!--- START: Second Step: Send the 'ftPostXML' XML var to the client 2 c if the lead is accepted or rejected --->
	<cfhttp url="[URL unfurl="true"]http://web.services.companyABC.com/Leads.asmx"[/URL] username="#user_Username#" password="#user_Password#" METHOD="post">
	    <cfhttpparam name="SOAPAction" type="HEADER" value="[URL unfurl="true"]http://services.companyABC.com/123/Leads/AutoLeads/Ping">[/URL]
		<cfhttpparam name="body" TYPE="xml" VALUE="#ToString(ftPostXML)#">
	</cfhttp>
	<!--- END: Second Step: Send the 'ftPostXML' XML var to the client 2 c if the lead is accepted or rejected --->
		
	<!--- START: Thrid Step: If 'coverage' is yes send leads, otherwise do not send anything as a CFXML var --->	  
	  <cfif cfhttp.FileContent contains 'coverage="yes"' and authcredit = "true">
		<cfxml variable="send_leads">
			<soap:Envelope xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/">[/URL]
			  <soap:Body>
				<Post xmlns="[URL unfurl="true"]http://services.companyABC.com/123/Leads/1.0.0.0/">[/URL]
				  <user_Username>#user_Username#</user_Username>
				  <user_Password>#user_Password#</user_Password>
				  <user_Reservation>#user_Reservation#</user_Reservation>
				  <user_IPAddress>#IPAddress#</user_IPAddress>
				</Post>
			  </soap:Body>
			</soap:Envelope>
		</cfxml>
			
	    <!--- Submit leads if 'send_leads' CFXML var returns coverage=yes --->
	    <cfhttp url="[URL unfurl="true"]http://web.services.companyABC.com/Leads.asmx"[/URL] username="#user_Username#" password="#user_Password#" METHOD="post">
	      <cfhttpparam name="SOAPAction" type="HEADER" value="[URL unfurl="true"]http://services.companyABC.com/123/Leads/AutoLeads/Post">[/URL]
		  <cfhttpparam name="body" TYPE="XML" VALUE="#ToString(send_leads)#">
	    </cfhttp>
	  </cfif>
	  <!--- END: Thrid Step: If 'coverage' is yes send leads, otherwise do not send anything --->

The gist is set all the info you want to submit as a CFXML var then submit that var to the client, capture their request, and resubmit any/all info if the criteria is successful.

Does this make sense?


____________________________________
Just Imagine.
 
Ok, i'll try if it works, thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top