Skip to main content
Participant
January 13, 2009
Question

Web Service doesn't respond if accessed publicly

  • January 13, 2009
  • 3 replies
  • 583 views
Hi,

I have created a web service that returns a simple XML file. There is a private IP assigned to it as well as a public IP. When I try to invoke it with the private IP, the XML file gets returned correctly. However using the public IP fails to give a response. The 2 IP addresses point to the same location and I was able to get the WSDL file using either IP address. I was wondering if anyone has encountered this problem before?

The web service:
<cffunction
name="getCustomer"
returntype="XML"
output="false"
access="remote"
hint="get CanadaPharmacy customer"
>

<cfargument name="PartnerGateway" type="string" required="yes">

<cfxml variable="customerXML" casesensitive="no">
<cfoutput>
<?xml version="1.0" encoding="UTF-8"?>
<PartnerGateway>
<ErrorMessageDetails>testing 123</ErrorMessageDetails>
</PartnerGateway>
</cfoutput>
</cfxml>

<cfreturn customerXML>

</cffunction>

</cfcomponent>

The <cfinvoke> call:

<cfinvoke webservice=" http://(IP address)/cfc/CustomerRequest_test.cfc?wsdl"
method="getCustomer"
returnvariable="customerInfo"
refreshWSDL="yes">
<cfinvokeargument name="PartnerGateway" value="#PartGate#"/>
</cfinvoke>

The web service is in a file named "CustomerRequest_test.cfc" while the variable "PartGate" is an XML file.

Sincerely,

Jason

This topic has been closed for replies.

3 replies

BKBK
Community Expert
Community Expert
January 24, 2009
XML and Webservices are not a trivial combination. We've tackled that problem before. You have to convert the return variable customerXML into a SOAP response. The BEA Weblogic client should have no trouble calling the service as a SOAP request. here are some references:

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=1376324

http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:52942

Inspiring
January 13, 2009
jason_y wrote:
> Hi,
>
> I have created a web service that returns a simple XML file. There is a
> private IP assigned to it as well as a public IP. When I try to invoke it with
> the private IP, the XML file gets returned correctly. However using the public
> IP fails to give a response.

What does it mean "fails to give a response" ? (it times out after x
seconds, it returns nothing, it returns something but it's not xml, etc)

--
Mack
jason_yAuthor
Participant
January 24, 2009
Hi,

I figured out what the problem was. It was an issue with the virtual mappings setup on the ColdFusion server. However, I'm running into another problem which I can't figure out.

The web service works as intended when I try to comsume it using <cfinvoke>, but when someone on the outside, they get an "Exception thrown: null" error. They're trying to use BEA WebLogic to connect to the web service.

The web service has the structure:
<cffunction
name="getCustomer"
returntype="XML"
output="false"
access="remote"
hint="get CanadaPharmacy customer"
>

<cfargument name="PartnerGateway" type="string" required="yes">
<cfset PartnerGatewayXML = XmlParse(PartnerGateway)>

<cfset PartnerID = PartnerGatewayXML.XmlRoot.Partner.PartnerID.XmlText>
<cfset PartnerPwd = PartnerGatewayXML.XmlRoot.Partner.PartnerPwd.XmlText>

<cfset customerid = PartnerGatewayXML.XmlRoot.AffinionCustomerInfo.XmlAttributes.Token>
<cfset RefCode = PartnerGatewayXML.XmlRoot.AffinionCustomerInfo.XmlAttributes.RefCode>

<!--- code that generates an XML file based on the data "PartnerGateway" ("PartnerGateway" is an XML file as well) --->

<cfreturn customerXML>


</cffunction>

</cfcomponent>

When I access it, I type in:
<cfinvoke webservice=" http://(publicIP)/cfc/CustomerRequest2.cfc?wsdl"
method="getCustomer"
returnvariable="customerInfo"
refreshWSDL="yes">
<cfinvokeargument name="PartnerGateway" value="#PartGate#"/>
</cfinvoke>

"PartGate" is equal to an XML file with the content:
<?xml version="1.0" encoding="UTF-8"?>
<PartnerGateway><Partner><PartnerID>aaa</PartnerID><PartnerPwd>bbb</PartnerPwd></Partner><AffinionCustomerInfo Version="1.0" RefCode="GF21CPHARDP0001" Token="90210"/></PartnerGateway>


When they access it, they get a very big error message. The beginning of it is:

java.lang.Exception: Exception in SOAP call https://affinion.canadapharmacy.com/cfc/CustomerRequest2.cfc. Exception thrown: null

at datapass.workflow.controls.callout.soap.SoapImpl.soapCall(SoapImpl.jcs:187)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:371)

at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)

at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)

at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:381)

at $Proxy60.soapCall(Unknown Source)

I was wondering if anyone knows what this error message means?

Sincerely,

Jason
MercuryNewt
Participating Frequently
January 13, 2009
Are you getting any sort of error response from the web server? If so, what is it?