Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
tftrandy #1
Webservice (Urgent Issue)
I am at ropes end. Have tried every possible combination of CFtags and have
Googled till I am blind. Below are examples of code tried as well as full
WSDL. I continue to receive the following message when trying to initialize
the service:
Web service operation ""getUpdates"" with parameters
{PARAMETERS={{START={2005-03-01T14:38:03.000-05:00},CURRENTTIME={2005-03-23T02:2
7:14.000-05:00},VSE={3},SIGNATURE={MC0CFHbMRkbkvC1Sl8ZSvnlO fmNpg1STAhUAkCK0trEI9
nb9aRns6M5cq3oPzsU=},}},} could not be found.
I can refresh the service in CFadmin so no question as to connectivity to
service. I can also from the server pull back the wsdl into a file. Any help
you can provide would be valued greatly as I am ready to give up and write the
code in .net just to be done with it but am trying to keep consistency with
remainder of our cf applications. This work is being done for a Fortune 50
company that is looking at CF for internal app development so really need to
get CF to function as it should. We are running 6.1 with updates installed.
The WSDL is sitting behind a firewall but through a tunnel have confirmed
accessibility by pulling back the wsdl that is provided below. Webservice
manager does not see any SOAP activity when we attempt to access the service.
This is a critical problem that is going to require writing interface in
different language if we can not resolve even though we want to keep in
coldfusion to be consistent with associated applications. I definitely
appreciate any assistance as I am pulling my hair out. Following is the
different methods that I have used in trying to utilize this service:
1.
<cfscript>
ws =
createObject("webservice","http://168.244.2.22:9001/vsmRepLogin1/services/VSESer
vice?wsdl");
xlatstring = ws.getUpdates(
start = "2005-03-01T14:38:03.000-05:00",
currentTime = "2005-03-19T10:19:36.000-05:00", signature =
"MC0CFBn8E80xyDrgSI6dJgHbGuzxQyWtAhUApvrWBC3BVAiZn ytE2qsy1bUdIXI=",
vse = "3"
);
</cfscript>
2.
<cfscript>
stArgs = structNew();
stArgs.vse = "3";
stArgs.start = "2005-03-01T14:38:03.000-05:00";
stArgs.currentTime = "2005-03-23T02:27:14.000-05:00";
stArgs.signature =
"MC0CFHbMRkbkvC1Sl8ZSvnlOfmNpg1STAhUAkCK0trEI9nb9a Rns6M5cq3oPzsU=";
</cfscript>
<cfobject
webservice="http://168.244.2.22:9001/vsmRepLogin1/services/VSEService?wsdl"
name="ws_lsmService">
<cfinvoke webservice="#ws_lsmService#"
method="getUpdates"
parameters="#stArgs#"
returnvariable="variables.repUpdate">
<cfdump var="#variables.repUpdate#">
3.
<cfobject
webservice="http://168.244.2.22:9001/vsmRepLogin1/services/VSEService?wsdl"
name="ws_lsmService">
<cfinvoke
webservice="#ws_lsmService#"
method="getUpdates"
returnvariable="test">
<cfinvokeargument name="vse" value="3" />
<cfinvokeargument name="currentTime" value="2005-03-23T02:27:14.000-05:00" />
<cfinvokeargument name="start" value="2005-03-01T14:38:03.000-05:00" />
<cfinvokeargument name="signature"
value="MC0CFHbMRkbkvC1Sl8ZSvnlOfmNpg1STAhUAkCK0trE I9nb9aRns6M5cq3oPzsU=" />
</cfinvoke>
Following is full WSDL for your review:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://storeperform.com/vsm/vse-io"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:intf="http://storeperform.com/vsm/vse-io"
xmlns:impl="http://storeperform.com/vsm/vse-io"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types/>
<wsdl:message name="getUpdatesResponse">
<wsdl:part name="result" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getUpdatesRequest">
<wsdl:part name="vse" type="xsd:string"/>
<wsdl:part name="currentTime" type="xsd:dateTime"/>
<wsdl:part name="start" type="xsd:dateTime"/>
<wsdl:part name="signature" type="xsd:base64Binary"/>
</wsdl:message>
<wsdl:message name="putUpdatesRequest">
<wsdl:part name="vse" type="xsd:string"/>
<wsdl:part name="currentTime" type="xsd:dateTime"/>
<wsdl:part name="xmlData" type="xsd:string"/>
<wsdl:part name="signature" type="xsd:base64Binary"/>
</wsdl:message>
<wsdl:message name="putUpdatesResponse">
<wsdl:part name="result" type="xsd:boolean"/>
</wsdl:message>
<wsdl:portType name="VSEService">
<wsdl:operation name="getUpdates" parameterOrder="vse currentTime start
signature">
<wsdl:input name="getUpdatesRequest" message="intf:getUpdatesRequest"/>
<wsdl:output name="getUpdatesResponse"
message="intf:getUpdatesResponse"/>
</wsdl:operation>
<wsdl:operation name="putUpdates" parameterOrder="vse currentTime xmlData
signature">
<wsdl:input name="putUpdatesRequest" message="intf:putUpdatesRequest"/>
<wsdl:output name="putUpdatesResponse"
message="intf:putUpdatesResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="VSEServiceSoapBinding" type="intf:VSEService">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getUpdates">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUpdatesRequest">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://storeperform.com/vsm/vse-io"/>
</wsdl:input>
<wsdl:output name="getUpdatesResponse">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://storeperform.com/vsm/vse-io"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="putUpdates">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="putUpdatesRequest">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://storeperform.com/vsm/vse-io"/>
</wsdl:input>
<wsdl:output name="putUpdatesResponse">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://storeperform.com/vsm/vse-io"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="VSEServiceService">
<wsdl:port name="VSEService" binding="intf:VSEServiceSoapBinding">
<wsdlsoap:address
location="http://168.244.2.22:9001/vsmRepLogin1/services/VSEService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
tftrandy Guest
-
WSDL Webservice Problem - Urgent Help!!!
I have setup a Flash form to use the WebServiceConnector to do credit card authorizations. The connector works when running inside Flash but when I... -
Urgent text and 3D issue
Hello everyone! I'm quite a newbie in Director but I admire it's 3d capabilities, and that's exactly what I need. OK, so I dont need any fancy... -
Urgent question regarding Session state in webservice
hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the... -
Urgent!!..regarding Session management in WebService
hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the... -
<<Urgent>> HttpModule, WebService
Hi, I have a DLL that does something with the network interface. When My Web Service receives a request, a function of this DLL will be called,... -
Tom Jordahl #2
Re: Webservice (Urgent Issue)
Here is code that works. You have to use ColdFusion dates and the
base64binary argument (signature) must be created with toBinary().
<cfset n = Now()>
<cfset st = "March 1, 2005 14:38">
<cfset sig =
toBinary("MC0CFHbMRkbkvC1Sl8ZSvnlOfmNpg1STAhUAkCK0 trEI9nb9aRns6M5cq3oPzsU=")<cfinvoke>
webservice="#ws_lsmService#"
method="getUpdates"
returnvariable="test">
<cfinvokeargument name="vse" value="3" />
<cfinvokeargument name="currentTime" value="#Now()#" />
<cfinvokeargument name="start" value="#st#" />
<cfinvokeargument name="signature" value="#sig#" />
</cfinvoke>
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
tftrandy #3
Re: Webservice (Urgent Issue)
Tom - Thanks for your help. Converting base64 using toBinary works relative to
the signature but the other data mismatch problem is the date format and the
requirement that it be a true date object. I have not been able to locate
enough information to do a conversion of a current date to UTC ISO 8601 format
which is as follows : 2005-03-19T10:19:36.000-05:00. This WSDL requires dates
in two 8601 formats with T insertion and offset as well as Z (zulu) time. I
have tried using WDDX with no luck. Do you have a simple method to convert
local time to 8601/UTC format so I can pass a verified date object versus
trying to pass a string?
Again thank you much for your help.
Randy
tftrandy Guest
-
Tom Jordahl #4
Re: Webservice (Urgent Issue)
Randy,
The Web Service engine will change the CFML date (which is a Java Date) in
to the right XML Schema dateTime syntax. The date on the wire will always
be in UTC (0 offset). This is just what Axis does to make sure it
interoperates.
You just provide the right value to CFML in the current timezone, everything
else will just work.
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
tftrandy #5
Re: Webservice (Urgent Issue)
Tom - You are correct that UTC conversion is being done behind the scenes but
the problem I have is that to authenticate to the webservice, the two dates
have to be provided in UTC format with local date/time with the offset. Why
client felt the need to design in this fashion I don't understand but that's
the way it is. I've tried parsing, formatting, etc. but can not seem to create
the date/time object correctly. It must be in following format to properly
authenticate:
2005-03-19T10:19:36.000-05:00
I apologize for multiple requests but I really do appreciate your help.
Randy
tftrandy Guest
-
Tom Jordahl #6
Re: Webservice (Urgent Issue)
You will not be able to get the web service support in CFMX to change the
way that dates are serialized in to XML on the wire. You are 3 layers of
software away from that kind of control. Sorry.
Two choices:
- Get the service to change, it clearly isn't interoperable.
- Use cfhttp and post the XML/SOAP manually.
Both are icky.
I may be misunderstanding you however, are you passing a STRING in to the
web service that must be formatted correctly? If that is the case then you
should be able to do DateFormat() without too much problem and make it the
right format. But your WSDL says it is a XML Schema "dateTime".
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
tftrandy #7
Re: Webservice (Urgent Issue)
The data passed must be a valid date object. I tried the ploy of passing as a
string properly formatted but no go. Looks like going to have to write in Java
to accomplish this task as I won't have any success telling these guys to
change the format in webservice. I have used cfhttp before for other things
but have not used it to post and receive or send data to a webservice. Is
there a document somewhere that you know of where I can research this? Do you
believe this could be a valid solution as I would love to keep totally inside
CF if possible for consistency and distribution?
Thanks again.
tftrandy Guest
-
Tom Jordahl #8
Re: Webservice (Urgent Issue)
The fact that the web service is rejecting a properly formatted date/time
will prevent them from interoperating with (for instance) any implementation
using Apache Axis. And I will bet that there are many other toolkits that
do not allow you to "control" how a dateTime is serialized on the wire.
Does .NET allow this control? Or does it just happen to work because they
serialize the date in the timezone of the program sending it?
I can't believe they believe this will interoperate. This flies in the face
of everything that web services are supposed to give you.
If you are going to try to post the XML, you will have to get to know
exactly how to format the SOAP envelope and body. Start with the SOAP 1.1
specification at the W3C.
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest



Reply With Quote

