我们有一个传统的coldfusion(web)应用程序,可以调用在coldfusion中实现的webservice API。我们目前正计划将所有这些API web服务迁移到基于java的API Web服务(JAX-WS)。
我已将coldfusion Web应用程序的Application.cfc文件中的端点url配置到基于java的API Web服务的端点。
但是,现在服务调用失败,下面有例外。 我之前从未使用过coldfusion代码,所以我不确定 何时抛出此异常。任何帮助表示赞赏!
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.AbortException : null]</faultstring>
<detail>
<ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">
coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.AbortException : null]
at coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
at coldfusion.xml.rpc.CFComponentSkeleton.__invoke(CFComponentSkeleton.java:671)
at CMC.changeEmail(/var/www/CMC/html/CMC.cfc)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
调用的CFC代码:
<cfif LoginResult AND VARIABLES.AllowEmail>
<cfset StartTime = getTickCount() />
<cftry>
<cfinvoke webservice="#VARIABLES.EmailWSDL#" method="changeEmail" returnvariable="returnStruct">
<cfinvokeargument name="Email" value="#ARGUMENTS.Email#" />
<cfinvokeargument name="NewEmail" value="#ARGUMENTS.NewEmail#" />
<cfinvokeargument name="Password" value="#ARGUMENTS.Password#" />
<cfinvokeargument name="FirstName" value="#ARGUMENTS.FirstName#" />
<cfinvokeargument name="LastName" value="#ARGUMENTS.LastName#" />
</cfinvoke>
<cfcatch type="any">
<cfif isDefined("CFCATCH")>
<cfinvoke method="LogError">
<cfinvokeargument name="LogID" value="#myLogID#">
<cfinvokeargument name="Error" value="#duplicate(CFCATCH)#">
</cfinvoke>
</cfif>
<cfinclude template="_error.cfm" />
</cfcatch>
</cftry>
VARIABLES.EmailWSDL的值在Application.cfc文件中设置如下:
<cfset APPLICATION.EmailWSDL = "http://XX.XX.XX.XX:XXXX/TESTAPI/http/Email/EmailProxy?wsdl" />
Webservice wsdl(SOAP xml)按比例缩小以仅显示1条消息和相应的标记:
<wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:esb="http://DefaultNamespace" xmlns:impl="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:part name="changeEmailReturn" type="apachesoap:Map"/>
<wsdl:part name="Email" type="xsd:string"/>
<wsdl:part name="NewEmail" type="xsd:string"/>
<wsdl:part name="Password" type="xsd:string"/>
<wsdl:part name="FirstName" type="xsd:string"/>
<wsdl:part name="LastName" type="xsd:string"/>
<wsdl:operation name="changeEmail" parameterOrder="Email NewEmail LoginTokenUUID OpenID eSAN Password FirstName LastName">
<wsdl:input message="impl:changeEmailRequest" name="changeEmailRequest"/>
<wsdl:output message="impl:changeEmailResponse" name="changeEmailResponse"/>
<wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/>
</wsdl:operation>
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="changeEmail">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="changeEmailRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:input>
<wsdl:output name="changeEmailResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:output>
<wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://DefaultNamespace" use="encoded"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:port binding="impl:email.cfcSoapBinding" name="email.cfc">
<wsdlsoap:address location="http://XX.XX.XX.XX:XXXX/TESTAPI/http/Email/EmailProxy"/>
</wsdl:port>