Hi All ? We have a web service running on ARSystem ( Remedy) and all we would
like to do is ?
-Invoke this web service from our Coldfusion page
-Send some parameters in a method call for ?Remedy WS?
-This Webservice returns a simple String object.
The WSDL looks like this..
---------------------
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions
targetNamespace="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:s="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xsd:schema elementFormDefault="qualified"
targetNamespace="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2">
<xsd:element name="OpCreate" type="s:CreateInputMap" />
- <xsd:complexType name="CreateInputMap">
- <xsd:sequence>
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Requester_Login_Name" type="xsd:string" />
<xsd:element name="Requester_Name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OpCreateResponse" type="s:CreateOutputMap" />
- <xsd:complexType name="CreateOutputMap">
<xsd:sequence />
</xsd:complexType>
<xsd:element name="AuthenticationInfo" type="s:AuthenticationInfo" />
- <xsd:complexType name="AuthenticationInfo">
- <xsd:sequence>
<xsd:element name="userName" type="xsd:string" />
<xsd:element name="password" type="xsd:string" />
<xsd:element minOccurs="0" name="authentication" type="xsd:string" />
<xsd:element minOccurs="0" name="locale" type="xsd:string" />
<xsd:element minOccurs="0" name="timeZone" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="OpCreateSoapOut">
<wsdl:part element="s:OpCreateResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="ARAuthenticate">
<wsdl:part element="s:AuthenticationInfo" name="parameters" />
</wsdl:message>
- <wsdl:message name="OpCreateSoapIn">
<wsdl:part element="s:OpCreate" name="parameters" />
</wsdl:message>
- <wsdl:portType name="CHG_Change_WebService_OpCreate_DisplayOnly_v2PortType">
- <wsdl:operation name="OpCreate">
<wsdl:input message="s:OpCreateSoapIn" />
<wsdl:output message="s:OpCreateSoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding
name="CHG_Change_WebService_OpCreate_DisplayOnly_v2SoapBinding"
type="s:CHG_Change_WebService_OpCreate_DisplayOnly_v2PortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="OpCreate">
<soap:operation
soapAction="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2/OpCreate"
style="document" />
- <wsdl:input>
<soap:header message="s:ARAuthenticate" part="parameters" use="literal" />
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="CHG_Change_WebService_OpCreate_DisplayOnly_v2Service">
- <wsdl:port
binding="s:CHG_Change_WebService_OpCreate_DisplayOnly_v2SoapBinding"
name="CHG_Change_WebService_OpCreate_DisplayOnly_v2Soap">
<soap:address
location="http://<ServerName>/arsys/services/ARService?server=<ServerName>&webSe
rvice=CHG_Change_WebService_OpCreate_DisplayOnly_v2" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
----------------------------------------
My CF invocation is as given below..
<cfscript>
Ws=CreateObject("webservice","http://<servername>/arsys/WSDL/public/<servername
>/CHG_Change_WebService_OpCreate_DisplayOnly_v2");
result= ws.opCreate("test1","TEST2","test3");
</cfscript>
<cfoutput>|#result#|</cfoutput>
-----------------------------------------
AND I am getting this error below..
Could not generate stub objects for web service invocation.
Name:
http://<servername>/arsys/WSDL/public/<servername>/CHG_Change_WebService_OpCreat
e_DisplayOnly_v2. WSDL: http://
<servername>/arsys/WSDL/public/<servername>/CHG_Change_WebService_OpCreate_Displ
ayOnly_v2. java.lang.NullPointerException 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.
Java Stack trace:
java.lang.NullPointerException
at
org.apache.axis.wsdl.toJava.Utils.getNewQNameWithLastLocalPart(Utils.java:933)
at
org.apache.axis.wsdl.toJava.JavaStubWriter.writeOperationMap(JavaStubWriter.java
:610)
at
org.apache.axis.wsdl.toJava.JavaStubWriter.writeFileBody(JavaStubWriter.java:169
)
at org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:130)
at
org.apache.axis.wsdl.toJava.JavaBindingWriter.generate(JavaBindingWriter.java:14
7)
at
org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorF
actory.java:423)
at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:471)
at org.apache.axis.wsdl.gen.Parser.run(Parser.java:395)
at org.apache.axis.wsdl.toJava.Emitter.run(Emitter.java:611)
at coldfusion.xml.rpc.XmlRpcServiceImpl$1.run(XmlRpcServiceImpl.java:213)
at java.security.AccessController.doPrivileged(Native Method)
at
coldfusion.xml.rpc.XmlRpcServiceImpl.registerWebService(XmlRpcServiceImpl.java:1
98)
at
coldfusion.xml.rpc.XmlRpcServiceImpl.getWebService(XmlRpcServiceImpl.java:472)
at
coldfusion.xml.rpc.XmlRpcServiceImpl.getWebServiceProxy(XmlRpcServiceImpl.java:4
27)
at
coldfusion.xml.rpc.XmlRpcServiceImpl.getWebServiceProxy(XmlRpcServiceImpl.java:4
09)
at coldfusion.runtime.CFPage.createObject(CFPage.java:5993)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5848)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:5813)
at
cftest1252ecfm1199621501.runPage(D:\Inetpub\wwwroot\Pearsontc\sandytest\test125.
cfm:11)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:343)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:50)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilt
er.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:105)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
----------------------------------
Would be sincerely thankful to ALL who could help me in resolving my problem
as it?s a deadline for me today and I have some testing left to be done on some
other modules as well.
PLEASE PLEASE HELP!!
Thanks.
-S
Ian Skinner - 17 Jul 2006 21:32 GMT
Starting with the basics, can you type the URI to the WSDL file and get
the WSDL to display in a browser? If so, you copied this URI into your
createOject code and it fails?
What OS?
Is there any security involved in the system generating the WSDL?
> Hi All ? We have a web service running on ARSystem ( Remedy) and all we would
> like to do is ?
SandyVohra - 17 Jul 2006 22:06 GMT
Thanks ian for prompt reply.
Yes I am getting the wsdl and thats what I pasted in my original request.
Exactly - The same URI in createObject or CFINVOKE does not work.
My CF MX 7.0 is on Windows 2k3.
I have been trying hard to make this work using CFINVOKE or CFHTTP invoking
operation name by passing it as a URI but no luck.
Any help will be highly appreciated..
Thanks.
Ian Skinner - 17 Jul 2006 22:27 GMT
A first guess would be that this could be a permission issue. The
default user that the ColdFusion service runs under has very basic
permissions beyond it's own server. If maybe that the CF user does not
have permission to access this resource.
If you can play with the user the the CF service logs on under and set
it to yourself, then see if this changes anything. If it does, this is
not a permanant solution. You will want to create a user just for the
coldfusion service that has just the permissions that it needs and use
this instead of your personal creditionals.
> Thanks ian for prompt reply.
>
[quoted text clipped - 9 lines]
>
> Thanks.
SandyVohra - 17 Jul 2006 22:53 GMT
Ian, Thanks but service is running on REMEDY system and is written in Java. The
new wsdl looks like this..( Please check the complex type input and return
parameter). I cannot change the service permissions as its not in our control
--------------------------------
http://oldtas184/arsys/WSDL/ <?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions
targetNamespace="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:s="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xsd:schema elementFormDefault="qualified"
targetNamespace="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2">
<xsd:element name="OpCreate" type="s:CreateInputMap" />
- <xsd:complexType name="CreateInputMap">
- <xsd:sequence>
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Requester_Login_Name" type="xsd:string" />
<xsd:element name="Requester_Name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OpCreateResponse" type="s:CreateOutputMap" />
- <xsd:complexType name="CreateOutputMap">
- <xsd:sequence>
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Requester_Login_Name" type="xsd:string" />
<xsd:element name="Requester_Name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="AuthenticationInfo" type="s:AuthenticationInfo" />
- <xsd:complexType name="AuthenticationInfo">
- <xsd:sequence>
<xsd:element name="userName" type="xsd:string" />
<xsd:element name="password" type="xsd:string" />
<xsd:element minOccurs="0" name="authentication" type="xsd:string" />
<xsd:element minOccurs="0" name="locale" type="xsd:string" />
<xsd:element minOccurs="0" name="timeZone" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="OpCreateSoapOut">
<wsdl:part element="s:OpCreateResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="ARAuthenticate">
<wsdl:part element="s:AuthenticationInfo" name="parameters" />
</wsdl:message>
- <wsdl:message name="OpCreateSoapIn">
<wsdl:part element="s:OpCreate" name="parameters" />
</wsdl:message>
- <wsdl:portType name="CHG_Change_WebService_OpCreate_DisplayOnly_v2PortType">
- <wsdl:operation name="OpCreate">
<wsdl:input message="s:OpCreateSoapIn" />
<wsdl:output message="s:OpCreateSoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding
name="CHG_Change_WebService_OpCreate_DisplayOnly_v2SoapBinding"
type="s:CHG_Change_WebService_OpCreate_DisplayOnly_v2PortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="OpCreate">
<soap:operation
soapAction="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2/OpCreate"
style="document" />
- <wsdl:input>
<soap:header message="s:ARAuthenticate" part="parameters" use="literal" />
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="CHG_Change_WebService_OpCreate_DisplayOnly_v2Service">
- <wsdl:port
binding="s:CHG_Change_WebService_OpCreate_DisplayOnly_v2SoapBinding"
name="CHG_Change_WebService_OpCreate_DisplayOnly_v2Soap">
<soap:address
location="http://oldtas184/arsys/services/ARService?server=OLDTAS184&webService=
CHG_Change_WebService_OpCreate_DisplayOnly_v2" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
--------------------------------------------------------------------------------
-----------------------------
I have modified my code a little to use a struct object and the code looks as
below..
---------------
<cfscript> CreateInputMap1 = structNew();
CreateInputMap1.Description = "test";
CreateInputMap1.Requester_Login_Name = "xxxxxx";
CreateInputMap1.Requester_Name = "yyyyyyy";
ws=CreateObject("webservice","http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_C
hange_WebService_OpCreate_DisplayOnly_v2?wsdl");
result= ws.opCreate(CreateInputMap1);
</cfscript>
<cfoutput>#result#</cfoutput>
-----------------
But I still receive the same error..
---------------------
Error Occurred While Processing Request
Could not generate stub objects for web service invocation.
Name:
http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_Change_WebService_OpCreate_Disp
layOnly_v2?wsdl. WSDL:
http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_Change_WebService_OpCreate_Disp
layOnly_v2?wsdl. java.lang.NullPointerException 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:\Inetpub\wwwroot\Pearsontc\sandytest\test125.cfm: line
18
16 : CreateInputMap1.Requester_Name = "Vohra";
17 :
18 :
ws=CreateObject("webservice","http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_
Change_WebService_OpCreate_DisplayOnly_v2?wsdl");
19 : // addSOAPRequestHeader(ws,
"http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_Change_WebService_OpCreate_Dis
playOnly_v2/", "Description", "test", false);
20 : // addSOAPRequestHeader(ws,
"http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_Change_WebService_OpCreate_Dis
playOnly_v2/", "Requester_Login_Name", "John", false);
Stack Trace (click to expand)
at
cftest1252ecfm1199621501.runPage(D:\Inetpub\wwwroot\Pearsontc\sandytest\test125.
cfm:18) at
cftest1252ecfm1199621501.runPage(D:\Inetpub\wwwroot\Pearsontc\sandytest\test125.
cfm:18)
java.lang.NullPointerException
at
org.apache.axis.wsdl.toJava.Utils.getNewQNameWithLastLocalPart(Utils.java:933)
at
org.apache.axis.wsdl.toJava.JavaStubWriter.writeOperationMap(JavaStubWriter.java
:610)
at
org.apache.axis.wsdl.toJava.JavaStubWriter.writeFileBody(JavaStubWriter.java:169
)
at org.apache.axis.wsdl.toJava.JavaWriter.generate
-----------------
The REMEDY logs has this message - "Required element expected in the input
XML document":
Ian Skinner - 18 Jul 2006 00:02 GMT
Here is an example on how to type parameters and create complex
parameters. HTH.
<cfparam name="WAVEH" default = false type="boolean">
<cfparam name="maxt" default = true type="boolean">
<cfparam name="mint" default = true type="boolean">
<cfparam name="tempx" default = false type="boolean">
<cfparam name="dew" default = false type="boolean">
<cfparam name="pop12" default = false type="boolean">
<cfparam name="qpf" default = false type="boolean">
<cfparam name="snow" default = false type="boolean">
<cfparam name="sky" default = false type="boolean">
<cfparam name="wspd" default = false type="boolean">
<cfparam name="wdir" default = false type="boolean">
<cfparam name="wx" default = false type="boolean">
<cfparam name="icons" default = false type="boolean">
<cfparam name="waveh" default = false type="boolean">
<cfparam name="startDate" default="#now()#" type="date">
<cfparam name="numDays" default="7" type="numeric">
<cfparam name="format" default="24 hourly" type="string">
<cfset strWeatherParameters = STRUCTNEW() />
<cfset strWeatherParameters.WAVEH = WAVEH />
<cfset strWeatherParameters.maxt = maxt />
<cfset strWeatherParameters.mint = mint />
<cfset strWeatherParameters.temp = tempx />
<cfset strWeatherParameters.dew = dew />
<cfset strWeatherParameters.pop12 = pop12 />
<cfset strWeatherParameters.qpf = qpf />
<cfset strWeatherParameters.snow = snow />
<cfset strWeatherParameters.sky = sky />
<cfset strWeatherParameters.wspd = wspd />
<cfset strWeatherParameters.wdir = wdir />
<cfset strWeatherParameters.wx = wx />
<cfset strWeatherParameters.icons = icons />
<cfset strWeatherParameters.waveh = waveh />
<cfinvoke webservice =
"http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"
method = "NDFDgenByDay"
returnvariable = "xmlWeatherData">
<cfinvokeargument name="latitude" value="38.697054"/>
<cfinvokeargument name="longitude" value="-121.3582"/>
<cfinvokeargument name="startDate" value="#startDate#"/>
<cfinvokeargument name="numDays" value="#numDays#"/>
<cfinvokeargument name="format" value="#format#"/>
</cfinvoke>
<cfset NDFDgenByDayData = XMLParse(xmlWeatherData) />
<cfinvoke webservice =
"http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"
method = "NDFDgen"
returnvariable = "xmlWeatherData">
<cfinvokeargument name="latitude" value="42.3485"/>
<cfinvokeargument name="longitude" value="-71.0733"/>
<cfinvokeargument name="product" value="time-series"/>
<cfinvokeargument name="startTime" value="#now()#"/>
<cfinvokeargument name="endTime" value="#dateAdd('d',7,now())#"/>
<cfinvokeargument name="weatherParameters" value="#strWeatherParameters#"/>
</cfinvoke>
<cfset NDFDgenData = XMLParse(xmlWeatherData) />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<cfdump var="#server#">
<cfdump var="#NDFDgenByDayData#">
<cfdump var="#NDFDgenData#">
</body>
</html>
> Ian, Thanks but service is running on REMEDY system and is written in Java. The
> new wsdl looks like this..( Please check the complex type input and return
> parameter).
SandyVohra - 18 Jul 2006 22:21 GMT
Hey Ian - The code you sent worked perfectly as it is supposed to do and I am
creating the structs in a similar fashion in my code as well. But the problem
is still with invoking this Java Web Service. Looking at the wsdl which I have
pasted again below.. what do you think should be a straight CF Code which
should be able to invoke this web service. I have my CFSCRIPT and CFINVOKE code
below that as well..Do you see any need of SOAP Headers and stuff..
I would owe you one if this is resolved.
---------------
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions
targetNamespace="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:s="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xsd:schema elementFormDefault="qualified"
targetNamespace="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2">
<xsd:element name="OpCreate" type="s:CreateInputMap" />
- <xsd:complexType name="CreateInputMap">
- <xsd:sequence>
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Requester_Login_Name" type="xsd:string" />
<xsd:element name="Requester_Name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="OpCreateResponse" type="s:CreateOutputMap" />
- <xsd:complexType name="CreateOutputMap">
- <xsd:sequence>
<xsd:element name="Description" type="xsd:string" />
<xsd:element name="Requester_Login_Name" type="xsd:string" />
<xsd:element name="Requester_Name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="AuthenticationInfo" type="s:AuthenticationInfo" />
- <xsd:complexType name="AuthenticationInfo">
- <xsd:sequence>
<xsd:element name="userName" type="xsd:string" />
<xsd:element name="password" type="xsd:string" />
<xsd:element minOccurs="0" name="authentication" type="xsd:string" />
<xsd:element minOccurs="0" name="locale" type="xsd:string" />
<xsd:element minOccurs="0" name="timeZone" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="OpCreateSoapOut">
<wsdl:part element="s:OpCreateResponse" name="parameters" />
</wsdl:message>
- <wsdl:message name="ARAuthenticate">
<wsdl:part element="s:AuthenticationInfo" name="parameters" />
</wsdl:message>
- <wsdl:message name="OpCreateSoapIn">
<wsdl:part element="s:OpCreate" name="parameters" />
</wsdl:message>
- <wsdl:portType name="CHG_Change_WebService_OpCreate_DisplayOnly_v2PortType">
- <wsdl:operation name="OpCreate">
<wsdl:input message="s:OpCreateSoapIn" />
<wsdl:output message="s:OpCreateSoapOut" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding
name="CHG_Change_WebService_OpCreate_DisplayOnly_v2SoapBinding"
type="s:CHG_Change_WebService_OpCreate_DisplayOnly_v2PortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="OpCreate">
<soap:operation
soapAction="urn:CHG_Change_WebService_OpCreate_DisplayOnly_v2/OpCreate"
style="document" />
- <wsdl:input>
<soap:header message="s:ARAuthenticate" part="parameters" use="literal" />
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="CHG_Change_WebService_OpCreate_DisplayOnly_v2Service">
- <wsdl:port
binding="s:CHG_Change_WebService_OpCreate_DisplayOnly_v2SoapBinding"
name="CHG_Change_WebService_OpCreate_DisplayOnly_v2Soap">
<soap:address
location="http://oldtas184/arsys/services/ARService?server=OLDTAS184&webService=
CHG_Change_WebService_OpCreate_DisplayOnly_v2" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-----------------------
<cfinvoke
webservice="http://oldtas184/arsys/WSDL/public/OLDTAS184/CHG_Change_WebService_O
pCreate_DisplayOnly_v2?wsdl" method="opCreate" returnvariable="aString">
<cfinvokeargument name="Description" value="test"/>
<cfinvokeargument name="Requester_Login_Name" value="testLogin"/>
<cfinvokeargument name="Requester_Name" value="testRequester"/>
</cfinvoke>
<cfoutput>#aString#</cfoutput>
OR
<cfscript>
Ws=CreateObject("webservice","http://oldtas184/arsys/WSDL/public/oldtas184/CHG_C
hange_WebService_OpCreate_DisplayOnly_v2");
result= ws.opCreate("test1","TEST2","test3");
</cfscript>
<cfoutput>|#result#|</cfoutput>
Ian Skinner - 18 Jul 2006 23:55 GMT
I am afraid I am not much of an expert at web services myself. Each
time I create and|or use one, I have to pull much hair and their isn't
much left to pull.
Maybe SOAP headers might help, but I have never used them.
One piece of advice I can give you is to just invoke the object and then
dump it. If you can get this far then you can proceed with using the
methods.
Ws=CreateObject("webservice","http://oldtas184/arsys/WSDL/public/oldtas184/CHG_C
hange_WebService_OpCreate_DisplayOnly_v2?wsdl");
<cfdump var="#Ws#">
I believe you always want the "wsdl" parameter in your URI.
> Hey Ian - The code you sent worked perfectly as it is supposed to do and I am
> creating the structs in a similar fashion in my code as well. But the problem
[quoted text clipped - 4 lines]
>
> I would owe you one if this is resolved.
Ian Skinner - 18 Jul 2006 23:58 GMT
You may want to try the HouseOfFusion CF-Talk list.
(http://www.houseoffusion.com/groups/cf-talk/). The smart people who
use that list provided me much help when I was working out the weather
web services
SandyVohra - 27 Aug 2006 00:58 GMT
Thanks All Guys!!
But try using CFHTTP in case you face this kinda problem again. Code below:
-----------------------------------------------------------------
<cfsavecontent variable="testwsSoapRequest">
<cfoutput>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<Test xmlns="urn:testwebservice">
<Assigned_To>Demo</Assigned_To>
<Short_Description>Testing SOAP Post via HTTP</Short_Description>
<Submitter>Demo</Submitter>
</Test>
</soapenv:Body>
</soapenv:Envelope>
</cfoutput>
</cfsavecontent>
<cfhttp url="http://<url to web service" method="post">
<cfhttpparam name="SOAPAction" type="HEADER"
value="urn:testwebservice"
<!--- send SOAP request in body --->
<cfhttpparam name="attachedDocument" type="body"
value="#testwsSoapRequest#">
</cfhttp>
disay_ - 04 Sep 2007 21:40 GMT
Hi SandyVohra;
Did you ever find a solution to this issue? I am having the same problem.
Thanks.
Matt.
tomj - 06 Sep 2007 20:33 GMT
Note that the problem reported in the original posting was that the Apache Axis
WSDL2Java tool/library used by ColdFusion MX was throwing an error when trying
to generate the code that ColdFusion uses to consume the web service.
This generally indicates a badly formed WSDL (use a WSDL 1.1 validation tool)
or a bug in the code generator or both.