Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
John_Edwards #1
Consuming Web Service that Imports Other Services
Has anyone had any success in consuming a web service that imports other web
services? I'm consuming a web service that imports 4 other web services. I'm
currently only able to successfully call methods from the first web service
that was imported into the parent web service. Seems to me that I read
somewhere that there this was a known bug in CFMX 6.1 but had been fixed in
CFMX 7. Unfortunately I've loaded CFMX 7 (Developer edition) and I'm
experiencing this problem. Has anyone else expereinced this or had success in
consuming web services that import other services? Thanks, John
John_Edwards Guest
-
consuming web services
hey this is a brief description of my problem. there is this web service which i want to use.i want to use this web service or rather consume this... -
Consuming Java Web Services
We are developing a client in C# that uses Web Services writtenin Java. These typically return simple arrays of objects. Incertain cases we'd like... -
consuming web services record set
I'm trying to consume a web service and use xslt transformation to display a simple HTML table with a record set from a SQL database. I have put... -
Consuming Java Web Services with .NET
I am not able to consume Java web services from .NET client. In an attempt to debug the problem, I created a simple HelloWorld web service that... -
Consuming Web Services using other editor than VS.NET
Hi all! I've created a simple web service on server 1 that I wish to test from ASP.NET on server 2. Now, I don't use VS.NET (I use Macromedia... -
Tom Jordahl #2
Re: Consuming Web Service that Imports Other Services
John,
If you are talking about a WSDL file that has (after imports) more than one
service element, in CFMX 7 the cfinvoke tag will now let you select the name
of the service you want to use.
See the manual for cfinvoke and/or CreateObject("webservice",..) for
details.
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
John_Edwards #3
Re: Consuming Web Service that Imports Other Services
Tom, Thanks for the response. Yes that is exactly what I'm trying to do.
When the attached code is executed all of the calls are successful except the
call to FileService which is not the first service in the main web service.
Here is the error message that I'm getting. Thanks for any help you may be
able to provide.......JOHN Could not perform web service invocation
'getPermissions'. Here is the fault returned when invoking the web service
operation: AxisFault faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString:
No port for method 'getPermissions:[url]http://content-services.org/cm/2.0/filesys[/url]'
with SOAPAction '''' found faultActor: faultNode: faultDetail:
{http://xml.apache.org/axis/}stackTrace:No port for method
'getPermissions:[url]http://content-services.org/cm/2.0/filesys[/url]' with SOAPAction
'''' found at
org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:221)
at
org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:128)
at
org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContex
t.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown
Source) at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anEndElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.
dispatch(Unknown Source) at
org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scan...
<cfscript>
cssdk_Access =
CreateObject("webservice","http://vhaiswwbdt/iw/services/cm/2.0/contentservices/
ContentServices.wsdl","AccessService");
cssdk_File =
CreateObject("webservice","http://vhaiswwbdt/iw/services/cm/2.0/contentservices/
ContentServices.wsdl","FileService");
cssdk_Util =
CreateObject("webservice","http://vhaiswwbdt/iw/services/cm/2.0/contentservices/
ContentServices.wsdl","UtilService");
cssdk_Workflow =
CreateObject("webservice","http://vhaiswwbdt/iw/services/cm/2.0/contentservices/
ContentServices.wsdl","WorkflowService");
beg_ses =
cssdk_Access.beginSessionUsingPassword("vhadomain\ vhauser","editor","Password","
en","wpTS","vhaiswwbdt");
tsUser = cssdk_Access.isUser(beg_ses.getContext(), "vhamaster\vhaiswedwarj");
domains = cssdk_Access.getDomains("VA","wpTS");
perms = cssdk_File.getPermissions(beg_ses.getContext(),"/default/main/VA");
cssdk_Access.endSession(beg_ses.getContext());
</cfscript>
John_Edwards Guest
-
John_Edwards #4
Re: Consuming Web Service that Imports Other Services
Well I tried to call the web service using CFINVOKE instead and encountered the
same problem. The calls to methods contained in the web service which is the
first one imported into TS_ContentServices (AccessService) all completed
successfully. Calls to any other service which is imported into
TS_ContentServices encounter a diagnostic. Below is the code and error. CODE
<cfset variables.cssdkInput = structNew()> <cfset variables.cssdkInput.userName
= 'vhadomain\vhauser'> <cfset variables.cssdkInput.roleName = 'editor'> <cfset
variables.cssdkInput.password = 'password'> <cfset variables.cssdkInput.locale
= 'en'> <cfset variables.cssdkInput.appContext = 'wpTS'> <cfset
variables.cssdkInput.serverName = 'vhaiswwbdt'> <cfinvoke webservice =
'TS_ContentServices' method = 'beginSessionUsingPassword' timeout = '30'
servicePort = 'AccessService' argumentCollection = '#variables.cssdkInput#'
returnVariable = 'beg_ses' /> <cfdump var='#beg_ses#'> <cfset
StructDelete(variables, 'cssdkInput')> <cfset variables.cssdkInput =
structNew()> <cfset variables.cssdkInput.context = beg_ses.getContext()> <cfset
variables.cssdkInput.userName = 'vhadomain\vhauser'> <cfinvoke webservice
= 'TS_ContentServices' method = 'isUser' timeout = '30' servicePort =
'AccessService' argumentCollection = '#variables.cssdkInput#' returnVariable
= 'tsUser' /> <cfdump var='#tsUser#'> <cfset StructDelete(variables,
'cssdkInput')> <cfset variables.cssdkInput = structNew()> <cfset
variables.cssdkInput.context = beg_ses.getContext()> <cfset
variables.cssdkInput.branchVPath = 'default/main/VA'> <cfinvoke
webservice = 'TS_ContentServices' method = 'getSubBranches' timeout =
'30' servicePort = 'FileService' argumentCollection =
'#variables.cssdkInput#' returnVariable = 'branches' /> <cfdump
var='#branches#'> <cfset StructDelete(variables, 'cssdkInput')> ERROR Error
Occurred While Processing Request Could not perform web service invocation
'getSubBranches'. Here is the fault returned when invoking the web service
operation: AxisFault faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString:
No port for method 'getSubBranches:[url]http://content-services.org/cm/2.0/filesys[/url]'
with SOAPAction '''' found faultActor: faultNode: faultDetail:
{http://xml.apache.org/axis/}stackTrace:No port for method
'getSubBranches:[url]http://content-services.org/cm/2.0/filesys[/url]' with SOAPAction
'''' found at
org.apache.axis.message.SOAPFaultBuilder.createFau lt(SOAPFaultBuilder.java:221)
at
org.apache.axis.message.SOAPFaultBuilder.endElemen t(SOAPFaultBuilder.java:128)
at
org.apache.axis.encoding.DeserializationContext.en dElement(DeserializationContex
t.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown
Source) at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.sc anEndElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.
dispatch(Unknown Source) at
org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scan... The error
occurred in C:\Inetpub\wwwroot\john\ts_cssdk_old.cfm: line 43 41 : <cfinvoke
42 : webservice = 'TS_ContentServices' 43 : method = 'getSubBranches'
44 : timeout = '30' 45 : servicePort = 'FileService'
John_Edwards Guest
-
John_Edwards #5
Re: Consuming Web Service that Imports Other Services
Also, I've been stuck on this error for a few days and I wanted to start ruling
things out so I asked a co-worker if he could write a Perl script to consume
the same methods from the same 2 sub-services (AccessService and FileService)
that I called in the code above. He was able to call the web service
successfully using Perl. Even methods that are not in the first imported web
service. Thanks again for any help you can offer, John
John_Edwards Guest
-
John_Edwards #6
Re: Consuming Web Service that Imports Other Services
When I try to call each web service directly by using it's own WSDL URL
(instead of going through the main web service which then imports the 4 other
services) I receive a java.lang.NullPointerException. Thanks
John_Edwards Guest
-
Tom Jordahl #7
Re: Consuming Web Service that Imports Other Services
John,
You can't select from multiple services in CFMX 6.1, you have to use CFMX 7.
In 6.1 you must have a single service per WSDL file that CF sees. You
should be able to easily make local copies that only have 1 service per
file.
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
John_Edwards #8
Re: Consuming Web Service that Imports Other Services
Tom, Thanks for the response. That is what I thought. Unfortunately I'm
already running CFMX 7. I updated CFMX 6.1 to CFMX 7 (Developer Edition)
before I tried the code above. Obviously this is not a known bug in CFMX 7
then. Do you think it would be worthwhile to perform a clean install of CFMX
Enterprise and try to execute my code from there? Thanks, John
John_Edwards Guest
-
Tom Jordahl #9
Re: Consuming Web Service that Imports Other Services
John,
I don't understand, you used the new servicePort attribute on cfinvoke in
CFMX7 and it didn't work? What was the error?
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
John_Edwards #10
Re: Consuming Web Service that Imports Other Services
Tom, If I use CFOBJECT I can create the object for the web service. I can
then use CFDUMP to view all of the methods in the web service. However, when I
attempt to call one of the methods in any of the web services other than the
first one defined in the main service, I get something like: Could not
perform web service invocation 'getPermissions'. Here is the fault returned
when invoking the web service operation: AxisFault faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString:
No port for method 'getPermissions:[url]http://content-services.org/cm/2.0/filesys[/url]'
with SOAPAction '''' found I can successfully call all of the methods in the
first web service. I then tried using CFINVOKE with the servicePort parameter.
I get the same result. It works fine when I call methods in the first
imported web service but generates the error listed above whenever I try to
call a method from on of the other imported web service. Thanks, John
John_Edwards Guest
-
John_Edwards #11
Re: Consuming Web Service that Imports Other Services
I'm getting getting a server ready for a new install of CFMX 7. Once that is complete I'll copy my code over to that server and try again.
John
John_Edwards Guest
-
Tom Jordahl #12
Re: Consuming Web Service that Imports Other Services
You should get a different set of methods in the web service when you
specify a different servicePort attribute. Try specifying something like
"foo" as the service port, the error message will tell you which ports you
have to choose from.
When I say service port, I am talking about the name attribute of the <port>
element in the <service> element of the WSDL:
<wsdl:service name="RoundtripPortTypeService">
<wsdl:port binding="impl:RoundtripTestSoapBinding" name="RoundtripTest2">
<wsdlsoap:address location="http://localhost:8500/test/RoundtripTest2"/>
</wsdl:port>
<wsdl:port binding="impl:RoundtripTestSoapBinding" name="RoundtripTest">
<wsdlsoap:address location="http://localhost:8500/test/RoundtripTest"/>
</wsdl:port>
</wsdl:service>
You could select between "RoundtripTest" and "RoundtripTest2" in the above
example.
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
John_Edwards #13
Re: Consuming Web Service that Imports Other Services
Tom, Thanks again for the response. That is what I have done. Below is the
main WSDL file. You will see that it import 4 support services. They are
AccessService, FileService, UtilService and WorkflowService. Those are the
servicePort names that I'm specifying as you can see in the code that I've
already posted. If I use the CreateObject function I can even create an object
of each of these services. When I use CFDUMP on that object I can see all of
the methods that make up each of those services. However, when I try to call
any of the methods in any service other than AccessService (which is the first
one defined below), I get an error message stating No port for method
method_name As I indicated above, I can successfully call all of the methods
in the AccessService web service. - <definitions
targetNamespace='http://content-services.org/services2.0.wsdl'
xmlns:impl='http://content-services.org/services2.0.wsdl'
xmlns:access='http://content-services.org/access/services2.0.wsdl'
xmlns:filesys='http://content-services.org/filesys/services2.0.wsdl'
xmlns:workflow='http://content-services.org/workflow/services2.0.wsdl'
xmlns:util='http://content-services.org/util/services2.0.wsdl'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdlsoap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns='http://schemas.xmlsoap.org/wsdl/'> <import
location='AccessService.wsdl'
namespace='http://content-services.org/access/services2.0.wsdl' /> <import
location='FileSys.wsdl'
namespace='http://content-services.org/filesys/services2.0.wsdl' /> <import
location='Workflow.wsdl'
namespace='http://content-services.org/workflow/services2.0.wsdl' /> <import
location='Util.wsdl'
namespace='http://content-services.org/util/services2.0.wsdl' /> - <service
name='AccessServiceService'> - <port binding='access:AccessServiceBinding'
name='AccessService'> <wsdlsoap:address
location='http://vaww.cms.webapp.va.gov:80/iw/services/cm/2.0/contentservices'
/> </port> </service> - <service name='FileServiceService'> - <port
binding='filesys:FileServiceBinding' name='FileService'> <wsdlsoap:address
location='http://vaww.cms.webapp.va.gov:80/iw/services/cm/2.0/contentservices'
/> </port> </service> - <service name='WorkflowServiceService'> - <port
binding='workflow:WorkflowServiceBinding' name='WorkflowService'>
<wsdlsoap:address
location='http://vaww.cms.webapp.va.gov:80/iw/services/cm/2.0/contentservices'
/> </port> </service> - <service name='UtilServiceService'> - <port
binding='util:UtilServiceBinding' name='UtilService'> <wsdlsoap:address
location='http://vaww.cms.webapp.va.gov:80/iw/services/cm/2.0/contentservices'
/> </port> </service> </definitions>
John_Edwards Guest
-
Tom Jordahl #14
Re: Consuming Web Service that Imports Other Services
Humm. This is either a bug or a misunderstanding of how the wsdl:import
works (which is real easy since it is non-obvious).
Can you Email the complete set of WSDL files so I can take a closer look at
what CF is doing (or not doing)?
Thanks.
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
John_Edwards #15
Re: Consuming Web Service that Imports Other Services
Tom, I've Email the WSDL files to what I think is your Macromedia Email
address based on what I saw on another thread. If you do not get them, please
EMail me at [email]john.edwards2@va.gov[/email] and I will resend them. Thanks, John
John_Edwards Guest
-
Tom Jordahl #16
Re: Consuming Web Service that Imports Other Services
This is confirmed as bug 60009.
We will be creating a hotfix for this bug in the next few weeks.
Thanks to John for all his patience and help!
--
Tom Jordahl
Macromedia Server Development
Tom Jordahl Guest
-
John_Edwards #17
Re: Consuming Web Service that Imports Other Services
Thanks Tom.
I appreciate you sticking with this thread and we look forward to the hotfix.
John
John_Edwards Guest



Reply With Quote

