Coldfusion web services
Hi all,
I built a simple web service that inserts some content into
the database, however if the content has been pasted from a word
doc or outlook and contains some print characters...etc its
breaking the web service when I try to display it. its going into
the database successfully but causing an error when i try to get it
via the web service. Is there a technique to make the web service
work with any kind of content ?
Thanks
Thank you for your replies and help, appreciate it.
I will try cfqueryparam and Xmlformat and see it that will
solve the problem. I'll try both in the insert statement.
My code goes like this: putting parts of the code only...
<cfinvoke webservice ="mywebservice_url"
<cfinvokeargument name="description"
value="#ReReplace(form.description,'[^[:print:]]','','ALL')#"/>
Then:
<cffunction name="add_description" output="false"
access="remote" returntype="boolean" hint="Add description">
<cfargument name="description" required="true"
type="string">
AND:
INSERT INTO mytable...'#arguments.description#',...etc
Similar Messages
-
The core of our business logic is in ColdFusion Web Services. These services have been in use for some time and can be used in other ColdFusion apps with no problems. I am now trying to leverage these services with HTMLDB v2.0.0.00.49. I have been able to add them into the app as a web service, however, when I create a form on a simple service (a return value only, no input parameter) and run the form I get the following error:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "FLOWS_020000.WWV_FLOW_WEB_SERVICES", line 707 ORA-30625: method dispatch on NULL SELF argument is disallowed
I have looked through this forum and others for a couple of days now and have not been able to find a solution. Can anyone point be in the right direction?
Thanks,
-RussRuss,
Did you find a solution to this issue? All of a sudden we are getting a similar message with a web service we've been using in production for some time now.
Thanks,
Noelle -
Publish ColdFusion Web Service with Complex Return Type
Hi,
I am working on a project to publish couple ColdFusion
webservices. The cosumer of those webservices is a Java
application.
One of my webservice need return an object. Here are demo
codes:
The returned ojbect is AddressRespond
AddressRespond.cfc:
<cfcomponent>
<cfproperty name="addresses" type="Address[]" />
<cfproperty name="myLearnException" type="MyException"
/>
</cfcomponent>
Address.cfc:
<cfcomponent>
<cfproperty name="city" type="string" />
<cfproperty name="state" type="string" />
</cfcomponent>
MyException.cfc:
<cfcomponent>
<cfproperty name="code" type="string" />
<cfproperty name="reason" type="string" />
</cfcomponent>
If the webservice "cosumer" is a ColdFusion application,
there is no any problems. But the Java application doesn't
understand the type of addresses in the WSDL file which is
gernerated by ColdFusion:
<complexType name="Address">
<sequence>
<element name="city" nillable="true"
type="xsd:string"/>
<element name="state" nillable="true"
type="xsd:string"/>
</sequence>
</complexType>
<complexType name="MyException">
<sequence>
<element name="code" nillable="true"
type="xsd:string"/>
<element name="reason" nillable="true"
type="xsd:string"/>
</sequence>
</complexType>
<complexType name="AddressRespond">
<sequence>
<element name="addresses" nillable="true"
type="tns1:ArrayOf_xsd_anyType"/>
<element name="MyException" nillable="true"
type="impl:MyException"/>
</sequence>
</complexType>
Could anybody give me any idea on how to resolve this
problem?
Thanks!The web service is actually the function, not the cfc and you
didn't show a function.
My own opinion is that since webservices by definition should
be available to any calling app (cold fusion, .net, flash, etc),
whatever gets returned from the method should be as universally
recognizable as possible. This generally means text, numbers,
boolean, or xml. -
Flex and ColdFusion web services
I have a simple CFC created that encompasses a function that
has a query. I want to be able to use the web service in my Flex
app, but I am having issues with getting the information from the
CFC.
My function is simple:
<cffunction name="listBySubject" access="remote"
returntype="query" output="false" hint="I grab the newest
stories">
<cfargument name="subject" type="string"
required="yes">
<cfquery name="list" datasource="#myDataSource#">
SELECT linktext, story, photo
FROM pressreleases
WHERE rss_feed = <cfqueryparam
value="#arguments.subject#" />
OR rss_feed2 = <cfqueryparam value="#arguments.subject#"
/>
ORDER BY releaseDate DESC
</cfquery>
<cfreturn list>
</cffunction>
How can I modify that to use in a Flex app's
<mx:WebService>? Do I have to use cfsavecontent and return
XML or can I keep it a query and use it with an ArrayCollection?
Something like:
<cffunction name="listBySubject" access="remote"
returntype="xml" output="false" hint="I grab the newest
stories">
<cfargument name="subject" type="string"
required="yes">
<cfquery name="list" datasource="prmc-media">
SELECT linktext, story, photo
FROM pressreleases
WHERE rss_feed = <cfqueryparam
value="#arguments.subject#" />
OR rss_feed2 = <cfqueryparam value="#arguments.subject#"
/>
ORDER BY releaseDate DESC
</cfquery>
<cfsavecontent variable="storyList">
<magStories>
<cfoutput query="list">
<magStory id="#ISBN#">
<linkURL>#XMLFormat(linkURL)#</booktitle>
<story>#XMLFormat(story)#</teaser>
<photo>#XMLFormat(photo)#</price>
</magStory>
</cfoutput>
</magStories>
</cfsavecontent>
<cfreturn storyList>
</cffunction>
Locally I can use RemoteObject all day with the way it is
normally, but since UofMichigan has BlueDragon, I am forced to
convert my apps to WebServices.Hi,
Here is how to do the web services in coldfsuion.
http://www.quackit.com/coldfusion/tutorial/coldfusion_web_services.cfm
No in flex you call the webservices like:
<mx:WebService id="webService"
wsdl="
http://www.flash-mx.com/ws/months.cfc?wsdl">
<mx:operation name="getMonths"
resultFormat="object"
result="getMonths_result(event);"
fault="getMonths_fault(event);" />
</mx:WebService>
http://blog.flexexamples.com/2008/04/14/calling-a-simple-web-service-from-flex-using-the-w ebservice-class/
I hope this give you the idea.
Rgds
JFB -
1. I need to find out how I can start using web services at
my company.
2. I'd like to be able to start sharing web services with my
coworkers.
3. I'd also like to be able to lock them down so that only
people from our company can use them. (maybe like a username and
password lockdown)
4. Do I set this up on the windows 2003 server or on the
coldfusion server?
5. Also, I see there is a web services section on the
ColdFusion Administration Site. If I add my web service here how do
I consume it from here?
Thanks!
JamesYou could try this. Turn off the power to both the router and the printer, then power the router on, then the printer and you should see the blue printers wireless light blinking, when it goes solid its connected to the router. Then try it agian . What printer and router make/model do you have?
I was an HP employee
If I have helped you solve your issue please mark it as solved
**Say Thanks By Clicking on the Kudos Star** -
Cfc component with readonly properties and web services
I want to transfer a cfc component across coldfusion web
services as a data transfer object. This cfc component is received
when calling a load web service, and then supplied to an update web
service. Some properties within the cfc need to be readonly since
the update web service would ignore them.
In java I would have my data transfer object with only public
set methods for those properties which are not readonly. How can I
achieve this in coldfusion?Hi,
Please check note 1004108.
Methods of Application and/or Entity Services (Business Objects) of CAF of SAP NetWeaver CE 7.1 cannot be exposed in document style, only RPC/literal is possible. Sorry.
It's a restriction that is planned to be solved in one of the next releases.
Regards,
Jan -
Consuming Java Web Service with complex return types
Hi,
I'm consuming a Java Web Service and the return I get in
ColdFusion is a typed Java Object (with custom Java classes like
com.company.project.JavaClass ...)
Within this object I don't get direct accessible properties
as when I'm consuming ColdFusion Web Services, instead I get a
getPROPERTYNAME and setPROPERTYNAME method for each property.
How can I handle this? I don't want to call this methods for
each property (and there are nested objects with arrays of custom
classes below, which would really make this complicated).
What's the best way to cope up with this?
Thanks a lot,
FritzThe web service is actually the function, not the cfc and you
didn't show a function.
My own opinion is that since webservices by definition should
be available to any calling app (cold fusion, .net, flash, etc),
whatever gets returned from the method should be as universally
recognizable as possible. This generally means text, numbers,
boolean, or xml. -
OnError() function in web service: impossible?
Hi,
Context: A ColdFusion web service with application.cfc and OnError() function.
I want the OnError function to log and email me when exceptions occur in web service but for some reason OnError() is never fired in such a case.
It's weird because it works if a .cfm page is called instead of a .cfc!
Is it a standard behaviour with CF webservice? Is there a workaround?
ThanksHi Dan,
Thank you for reading and suggesting. The fact is I would like to use onError() for what it is supposed to provide - and also to understand the mechanism.
My onRequestStart() sets request variables to bar.cfc so application.cfc globally plays fine with the webservice cfcs. Well... except for error handling
I found that if exception occurs in application.cfc it is actually caught by onError().
But if exception occurs in webservice cfcs then it is not caught by onError() and a ugly SOAP error is sent to consumer instead.
Here are my application.cfc and bar.cfc webservice components. They are pretty simple so I don't see why onError() is not fired:
<cfcomponent displayname="Application" output="false">
<cfscript>
this.Name = "foo";
this.applicationTimeOut = CreateTimeSpan(0,1,0,0);
this.sessionManagement = false;
this.setClientCookies = false;
this.clientManagement = false;
this.scriptProtect = "all";
</cfscript>
<cffunction name="onApplicationStart" access="public" output="false">
<cfset application.foo= "foo" />
</cffunction>
<cffunction name="onRequestStart" access="public" output="true">
<cfargument name="targetPage" type="string" required="true" />
</cffunction>
<cffunction name="onError" access="public" returnType="void" output="true">
<cfargument name="Exception" required="true" />
<cfargument name="EventName" type="string" required="true" />
<cfmail from="toto" to="[email protected]" subject="error">
error
</cfmail>
</cffunction>
</cfcomponent>
<cfcomponent displayname="bar">
<cffunction name="test" access="remote" returntype="cpTest" output="false">
<!--- Throws an exception as b does not exist. This must be caught by onError() but it is not --->
<cfset a = b />
</cffunction>
</cfcomponent>
Any clue?
-Salvo -
how to maintain a session with coldfusion web service?
Many sites handle this by generating a transaction key on the
intial web service contact and then forcing the client to echo the
transaction key back for every web service method called. You could
then store your CF variables in a database using the transaction
key as the way to store/retrieve them. Easiest way would be to
serialize a CF structure using <cfwddx>. Given, you wouldn't
be using your typical coldfusion session variables (which I don't
think you could use anyway via webservice as there is no way to id
the session) - but it should work about the same. You would just
need to schedule a task to go through and remove old data on a
regular basis, as the "session" data would eventually fill your
DB. -
Web Service is not working in COldfusion 8
Hi,
I am using the following code for creating the web service.
this code was perfectly working in Coldfusion 7,
however not working in Coldfusion 8.
<cfscript>
try {
ws = CreateObject("webservice", CurrentURL & "IntouchDataService.cfc?wsdl");
} catch (any e) {
WriteOutput("Error occured while invoking the Web Service at: ");
WriteOutput('<a href="#CurrentURL#IntouchDataService.cfc?wsdl">#CurrentURL#IntouchDataService.cfc?wsdl </a>');
WriteOutput('<hr /><h2>');
WriteOutput(e.message);
WriteOutput('</h2><hr />');
WriteOutput(e.detail);
WriteOutput('<hr />');
WriteOutput(e.StackTrace);
</cfscript>
Follwoing error i got:
coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 1 semantic error compiling "E:/ColdFusion8/stubs/WS-2123243560/coldfusion/xml/rpc/CFCInvocationException.java": < 10. public class CFCInvocationException extends org.apache.axis.AxisFault implements java.io.Serializable { . . . 88. } > *** Semantic Error: A class file was not generated for the type "coldfusion.xml.rpc.CFCInvocationException" because a library method that it depends on was not found. See system messages for more information. Found 1 semantic error compiling "E:/ColdFusion8/stubs/WS-2123243560/com/intouchsupport/www/IntouchDataService/TestWebServ iceLocator.java": < 10. public class TestWebServiceLocator extends org.apache.axis.client.Service implements com.intouchsupport.www.IntouchDataService.TestWebSe
Also i did lot of googling to solve this issue but no luck.
also i found following blog about this issue also and i did the give steps however problem not solved.
http://tjordahl.blogspot.com/2007/09/coldfusion-8-getting-started-code.html
Can somebody help me to sort out this issue?
thanks
Prashant GuptaHi,
I got solution to my problem of webservice is not working in CF8.
the problem was
we have already a "rt.jar" file in a location and we defined this location in CF Admin >> java jvm >> classpath
so this file was conflicting.
i simply removes this file path from CF Admin.
and restart the CF services.
and my web service start working. -
ColdFusion 9 suddenly won't consume Web Services...
Ok, the weirdest problem has cropped up, and I'm hoping someone will have a solution...
Suddenly none of the Web Services we're consuming will work from our production server...
Our test-server, locally-hosted, will consume all these web-services just fine. But when we try to consume the very same web-services on our production server, it'll just hang forever. No time-out, no error of any kind; just hangs there forever...
We do not publish these web-services, we're just consuming them... These web-services are being published by several different companies (our clients), so it's not that they're all coming from one source and it's the source that has the problem... Every last web-service we consume has suddenly quit working when we try to access them from our production server...
So why would we be able to consume them on one server, but not on another? I've gone through the ColdFusion administrator line-by-line and both the test-server and the production-server are set up precisely the same way... The only difference between the two servers is the OS and the fact that the production server is quite a bit more powerful... Test server: 2-core AMD CPU, 4GB RAM, Windows 2003, IIS6, ColdFusion 9; Production server: 4-core Intel Xeon CPU, 8GB RAM, Windows Server 2008, IIS 7, ColdFusion 9...
I'm really confused about this -- it's almost like the production server has had all outgoing requests blocked somehow... But even if we completely turn off the firewall, we still can't consume any Web Services...
Has anyone had a problem remotely like this? I'd appreciate any kind of help you can offer...
Thanks,The only other thing that I can think of would be permissions.
^_^ -
I am trying to invoke a web service and I'm getting an error.
Error 401 Unauthorized. Unable to read WSDL from URL: http://servername/generation/bj/TestCalculation.wsdl. An exception occurred while invoking an event handler method from Application.cfc. The method name is: onRequest.
I can put the URL in the browser and it will pull up the WSDL. I can call this from a flex program and it will work fine. I don't know much about Flex and I'm just learning it so I wanted to see if I could get it to work with ColdFusion.
Here is the CFC I created:
<cffunction name="myCalcFunction" access="remote" returntype="any">
<cfinvoke
webservice="http://servername/generation/bj/TestCalculation.wsdl"
method="TestCalculation"
returnvariable="response">
<cfinvokeargument name="number1" value="#arguments.number1#"/>
<cfinvokeargument name="number2" value="#arguments.number2#"/>
</cfinvoke>
<cfreturn response>
</cffunction>
Can anyone point me in the right direction of what I can do?
thanks for the support.
BJBKBK -
I'm new to SOA/web services so maybe I'm not saying it right but I don't think we are on the same page. In the defintion, the WSDL is just an XML based file used to describe the functionality offered by a web service. I don't need to know anything about the service except the inputs and outputs and the URL to call the WSDL.
I created a service to calculate two numbers and return the result using a software called NextAxiom that my company has. This service is not sitting on our web server but on one of our machines on our network. See below for the WSDL file I have listed. I was just trying to use some of the standards that I read about and was using a CFC to invoke the web service so any CFM program would be able to call the CFC and not put it in the CFM program. But for now I can just put in the invoke tag in my CFM code:
<cfinvoke
webservice="http://localhost/TestCalculation.wsdl?wsdl"
method="TestCalculation" refreshwsdl="true"
returnvariable="response">
<cfinvokeargument name="number1" value="5"/>
<cfinvokeargument name="number2" value="6"/>
</cfinvoke>
<cfdump var="#response#">
Doing this, I can run the CFM program and it will come back with 11. This works great on my local CF server. When I try and run it on my dev machine I get the 401 unauthorized error. (yes I change the path of the wsdl to the path that the WSDL is on my dev web server.)
So it looks like some type of permission problem. My question is where do I look?
thanks for all replys,
BJ
Here is my WSDL file. If you notice the bold line at the bottom, that is the server where my service is.
<!--
Automatically generated 09/23/2011 by Hyperservice Business Platform, NextAxiom Technology, Inc.
-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:tns="http://www.nextaxiom.com/soapservice/TrainingBJ.TestCalc.TestCalculation/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsd1="http://www.nextaxiom.com/soapservice/xsd1" name="TrainingBJ.TestCalc.TestCalculation"targetNamespace="http://www.nextaxiom.com/soapservice/TrainingBJ.TestCalc.TestCalculation/wsdl">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"targetNamespace="http://www.nextaxiom.com/soapservice/xsd1">
<element name="TestCalculation">
<complexType>
<sequence>
<element name="number1" type="long"/>
<element name="number2" type="long"/>
</sequence>
</complexType>
</element>
<element name="TestCalculationResult">
<complexType>
<sequence>
<element name="result" type="long"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="TestCalculationRequest">
<part element="xsd1:TestCalculation" name="TestCalculation"/>
</message>
<message name="TestCalculationResponse">
<part element="xsd1:TestCalculationResult" name="TestCalculationResult"/>
</message>
<portType name="TrainingBJ.TestCalc.TestCalculationSoapPort">
<operation name="TestCalculation">
<input message="tns:TestCalculationRequest"/>
<output message="tns:TestCalculationResponse"/>
</operation>
</portType>
<binding name="TrainingBJ.TestCalc.TestCalculationSoapBinding" type="tns:TrainingBJ.TestCalc.TestCalculationSoapPort">
<soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="TestCalculation">
<soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:doc?in=TestCalculation?out=TestCalculationResult?path=TrainingBJ.TestCalc.TestCalculat ion"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TrainingBJ.TestCalc.TestCalculation">
<port binding="tns:TrainingBJ.TestCalc.TestCalculationSoapBinding" name="TrainingBJ.TestCalc.TestCalculationPort">
<soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://nextaxb:7777/NXAServer/NextAxiomServer"/>
</port>
</service>
</definitions> -
ColdFusion Developer version and web services
Hi,
Does anyone know if there is a known issue about Web Services
not running on
ColdFusion developer version?
I have been testing the most simple web services on 3
different live servers
and 3 different localhost servers with the same files and got
successful
results on all the live servers, but the same errors on all
the local
servers running on ColdFusion latest developer version. All 6
servers are
running on IIS either on Windows XP or 2000. Below is the
error I get when
I tested it locally:
Could not generate stub objects for web service invocation.
Name:
http://tutorial/ColdFusion/template/webservices/helloworld/helloworld.cfc?wsdl.
WSDL:
http://tutorial/ColdFusion/template/webservices/helloworld/helloworld.cfc?wsdl.
java.net.UnknownHostException: tutorial: tutorial It is
recommended that you
use a web browser to retrieve and examine the requested WSDL
document for
correctness. If the requested WSDL document can't be
retrieved or it is
dynamically generated, it is likely that the target web
service has
programming errors. The error occurred in
D:\tutorial\ColdFusion\template\webservices\helloworld\helloworld.cfm:
line
6
4 : method="getMessage"
5 : returnvariable="aString">
6 : <cfinvokeargument name="name" value="Rob"/>
7 : </cfinvoke>
8 :
Please let me know if you know anything about this.YCIf your developer edition is on your own machine you might be
having proxy server issues.
Find out what your proxy server is and enter it using the
proxyserver="" attribute in cfinvoke -
Web Services with ColdFusion and PHP mixed
Hi,
We need to used web services provided by remote server. The
problem is the
remote server is on PHP and our server is on ColdFusion. Is
there a way to
use the web services on PHP server with our ColdFusion
server?
I understand ColdFusion automatically generate the WSDL by
adding ?wsdl
after the CFC, but I can't do the same thing because the
remote server is
not on ColdFusion. They have given us the wsdl web address,
but it seems
using the wsdl address directly without CFC is not working.
Is that right?
Please let me know.
YCFrom the coldfusion side of things, it all seems okay what
you are doing. It
is an issue with the php/wsdl side of things. I can access
the wsdl ok, but
got the same error as PaulH just then when I tried to use web
service in
cf..
"YC" <[email protected]> wrote in message
news:[email protected]...
> OK, I learned a good thing. I tired the Dreamweaver +
icon with a
> ColdFusion CFC file and it works fine. Now I learned I
don't have to code
> the <cfinvoke> tag, but just drag and drop. But
when I tried the WSDL
file:
>
http://cyfernet.ces.ncsu.edu/ws/resources.wsdl,
and "ColdFusion MX" as the
> proxy generator, I had an error. Do I need any other
option to choose
from?
> It seems "Edit Proxy Generator list" doesn't provide a
sufficient answer.
>
> I know the URL of the WSDL file is correct because I
used it to create a
web
> service in PHP locally on my laptop, and it works. From
the previous
> answers of you and PaulH, it seems if the WSDL works
with PHP, it should
> also work with any other language, right?
>
> Have you tried yourself? Did it work?
>
> YC
>
> "Eric" <[email protected]> wrote in message
> news:[email protected]...
> >
> >
> > An easy way to do this is to use the dreaweaver
'components' palette.
> > Select
> > 'web services' from the drop down list and then
click the '+' icon to
> > create
> > the call to the web service. (this uses the
cfinvoke tag)
> >
> >
> > "YC" <[email protected]> wrote in message
> > news:[email protected]...
> >> I feel very sorry to keep asking this
apparently very basic question,
but
> >> please be patient with me.
> >>
> >> Yes, it is right that I just need to consume
the pre-existing web
> >> service.
> >> This is the WSDL page:
http://cyfernet.ces.ncsu.edu/ws/resources.wsdl
and
> >> this is the web service page on the server
using it:
> >>
http://cyfernet.ces.ncsu.edu/ws/getresources-client.php,
provided as an
> >> example.
> >>
> >> So in order to have the page run in ColdFusion,
at least the following
> >> tag
> >> below should come up without an error?
> >> <cfset
> >>
> >
ws=createObject("webservice","
http://cyfernet.ces.ncsu.edu/ws/getresources-c
> > lient.php")>
> >>
> >> Sorry, but I still get an error message.
> >> I need to provide "getResourcesByCatid" as the
method and "catid" as
the
> >> parameter, but it should work only if the
previous tag works without an
> >> error, right?
> >>
> >> YC
> >>
> >>
> >> "Eric" <[email protected]> wrote in
message
> >> news:[email protected]...
> >> >>>We need to used web services
provided by remote server.
> >> >
> >> > Right, so the web service already exists -
you just want to consume
it?
> >> >
> >> >>Is there a
> >> >> >> way to use the web services
on PHP server with our ColdFusion
> > server?
> >> >
> >> > Yes - thats the whole point of web
services, you can create them in
one
> >> > language/platform and consume them in
another.
> >> >
> >> >> Whey you say "create a web service,"
do you mean I need to create a
> >> >> <cfcomponent> tag in CFC format?
Creating a CFC is not a problem,
but
> >> >> how
> >> >> can I place it on the remote server
because it is running with PHP,
> >> >> not
> >> > with
> >> >> ColdFusion?
> >> >
> >> > Sorry if I am not understanding the
question clearly, but it seems to
> >> > me
> >> > that you want to make use of an existing
php based web service. Why
do
> > you
> >> > you need to place a CFC on the php server?
You just need to execute
the
> >> > web
> >> > service from the coldfusion server using
cfml. As Paulh says:
> >> >
> >> > <cfset
ws=createObject("webservice","url to the php based web service
> >> > here")>
> >> >
> >> > The variable 'ws' being your hook into the
php web service from
within
> >> > your
> >> > cfml code.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > "YC" <[email protected]> wrote in
message
> >> > news:[email protected]...
> >> >> Eric,
> >> >> Whey you say "create a web service,"
do you mean I need to create a
> >> >> <cfcomponent> tag in CFC format?
Creating a CFC is not a problem,
but
> >> >> how
> >> >> can I place it on the remote server
because it is running with PHP,
> >> >> not
> >> > with
> >> >> ColdFusion?
> >> >>
> >> >> YC
> >> >>
> >> >> "Eric" <[email protected]>
wrote in message
> >> >>
news:[email protected]...
> >> >> > >We need to used web services
provided by remote server. The
> >> >> > >problem
> >> >> > >is
> >> >> > >the
> >> >> > remote server is on PHP and our
server is on ColdFusion.
> >> >> >
> >> >> > Thats one of the main nenefits of
web services - this does not
> > matter.
> >> >> >
> >> >> >>> I understand ColdFusion
automatically generate the WSDL by
adding
> >> > ?wsdl
> >> >> >> after the CFC, but I can't do
the same thing because the remote
> > server
> >> > is
> >> >> >> not on ColdFusion.
> >> >> >
> >> >> > Sounds like you want to consume a
web service, not create one. You
> > can
> >> >> > create the call in Dreamweaver,
just look up help on calling a web
> >> >> > service. Also see Adobe site
using search for 'using web services
in
> >> >> > coldfusion'
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > "YC" <[email protected]>
wrote in message
> >> >> >
news:[email protected]...
> >> >> >> Hi,
> >> >> >> We need to used web services
provided by remote server. The
> >> >> >> problem
> >> >> >> is
> >> >> >> the remote server is on PHP
and our server is on ColdFusion. Is
> > there
> >> > a
> >> >> >> way to use the web services
on PHP server with our ColdFusion
> > server?
> >> >> >>
> >> >> >> I understand ColdFusion
automatically generate the WSDL by adding
> >> >> >> ?wsdl
> >> >> >> after the CFC, but I can't do
the same thing because the remote
> > server
> >> > is
> >> >> >> not on ColdFusion. They have
given us the wsdl web address, but
it
> >> > seems
> >> >> >> using the wsdl address
directly without CFC is not working. Is
> >> >> >> that
> >> >> >> right?
> >> >> >>
> >> >> >> Please let me know.
> >> >> >>
> >> >> >> YC
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
> -
ColdFusion failed security in invoking a WebSphere web service
Hello,
I tried to call a web service hosted in a IBM WebSphere
server, but could not pass WebSphere's security framework. After
some talking with the guys in the WebSphere side, I'm not sure
whether this is possible in ColdFusion because they ask for a
<wsse:UsernameToken> in the SOAP envelope header. We did some
testing, and they confirmed that ColdFusion could talk to the web
service, by could not pass security validation. Would someone help
me here? Must it be done in Java?
Here is my calling syntax in ColdFusion:
<cfinvoke webservice="https://WebServiceURL?wsdl"
method="myMethod" username="myUserName" password="myPassword"
returnVariable="ReturnCode">
<cfinvokeargument name="ParaName"
value="ParameterValue">
</cfinvoke>
The web service is locked down, so the calling client must
issue a SOAP message containing VALID security extensions:
<soapenv:Envelope
xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ws="
http://somedomain"
xmlns:wsse="
http://schemas.xmlsoap.org/ws/2002/07/secext">
<soapenv:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>myUserName</wsse:Username>
<wsse:Password>myPassword</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
... REMOVED as this depends on your individual SOAP service
</soapenv:Body>
</soapenv:Envelope>
The guys at WebSphere said that my ColdFusion SOAP call
probably did not have the envelope security header. IIs there a way
to capture the underlying actual SOAP call format? Here is the
error msg:
AxisFault
faultCode: {
http://schemas.xmlsoap.org/ws/2003/06/secext}FailedAuthentication
faultSubcode:
faultString: WSEC5075E: No security token found which
satisfies any one of AuthMethods.
faultActor:
faultNode:
faultDetail:
http://xml.apache.org/axis/}stackTrace:WSEC5075E:
No security token found which satisfies any one of AuthMethods.
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
at org.apache.axis
LarrySadly, byrning's reply ended with just "how to use CF with stupid WSSE security", which leads readers to wonder if he meant to share more. For instance, was that supposed to be a link to a blog entry?
I did some digging, and I found an old google cache of another version of this forum, and it showed that he had included the following code, which somehow never made it into the message here:
<cfset myUsername = "yourUsername" />
<cfset myPassword = "yourPassword" />
<cfset myDate = DateFormat(DateConvert("local2Utc", now()),
"yyyy-mm-ddThh:mm:ssZ")>
<cfset myNonce = createPIN(33)> <!--- this is just a random alpha numeric
string 33 chars long - got the function at cflib.org --->
<cfset myPasswordDigest = ToBase64(Hash(myNonce & myDate & myPassword ))>
<cfscript>
myObj = createObject("webservice", "http://urltoYourService?wsdl");
headerElement = createObject("java",
"org.apache.axis.message.SOAPHeaderElement");
headerElement.init("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
ecurity-secext-1.0.xsd", "wsse:Security");
headerElement.addChildElement("wsse:UsernameToken");
headerElement.getFirstChild().addChildElement("wsse:Username").setValue(myUsern
ame);
mypass = headerElement.getFirstChild().addChildElement("wsse:Password");
mypass.setValue(myPasswordDigest);
mypass.setAttribute("Type", "wsse:PasswordDigest");
headerElement.getFirstChild().addChildElement("wsse:Nonce").setValue(
ToBase64(Hash(myNonce, "SHA")) );
myCreated = headerElement.getFirstChild().addChildElement("wsu:Created");
myCreated.setValue(myDate);
myCreated.setAttribute("xmlns:wsu",
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut....
xsd");
headerElement.setMustUnderstand(1);
headerElement.setActor("");
myObj.setHeader(headerElement);
result = myObj.methodtoCall(param1="yadda", param2="yadda")
</cfscript>
Maybe you are looking for
-
what is the best way to handle errors in BizTalk ? We are using web services, databases. Is ESB Exception handling preferred to others ? any better suggestions please ? MBH
-
is Apple going bankrupt again, they seem to not wanna be bothered, is there a way to EMAIL, im not into calling and it says my calls have expired....why cant Apple be a little helpful, im a little upset with them and wanna throw my ipod touch across
-
Classic Scenario change Material Group on PR
In a classic scenario can the material group be changed on PR created from approved SC. We are unable to change it in our enviornment. Please confirm if it is standard SAP behaviour . Thanks.
-
Delivery date to be pricing date
Is it possible in SAP standard configuration to have the billing date to be the actual delivery date as per the schedule line (automatically without carrying out new pricing) apart from it being the req. deliv. date.
-
In a continuously running Pro*c program has one statement as shown below: EXEC SQL UPDATE TABLE_MAP SET LAST_TIME = TO_CHAR(SYSDATE,'YYYYMMDDHH24MISS'); This statement is executing more than 5 times every minute. But for every execution it is going f