• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion generated WSDL showing wrong targetNameSpace

New Here ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

We recently migration our application from CF 8 to CF 11 Update 3. There is a ColdFusion web service that is being consumed by a .NET application. The cfcomponent tag is specified with the following attributes

<cfcomponent

style = "rpc"

bindingname = "component1.cfcSoapBinding"

namespace="http://#cgi.host_name#/<webservicefolder>/component1.cfc"

serviceaddress="http://#cgi.host_name#/<webservicefolder>/component1.cfc"

porttypename = "component1"

serviceportname = "component1.cfc"

>

In Our Test server (same CF version), the webservice is invoked by the .NET application successfully. However, in Production server, the .NET application is getting error when trying to invoke the service. The error information at .NET end is :

 

There is an error in XML document (31, 31).

at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)     at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)     at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)     at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)....

When we compared the WSDL generated from QA & Prod server, we noticed difference in tns1 and targetNamespace.

QA WSDL (which is working)

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions targetNamespace="serviceaddress" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="serviceaddress" xmlns:intf="serviceaddress" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://<webservicefolder>" xmlns:tns2="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:types>

   <schema targetNamespace="http://<webservicefolder>" xmlns="http://www.w3.org/2001/XMLSchema">

Prod WSDL (not working)

<?xml version="1.0" encoding="UTF-8"?>

wsdl:definitions targetNamespace="serviceaddress" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="serviceaddress" xmlns:intf="serviceaddress" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1=http://<webservicefolder>.<rootfolder>  xmlns:tns2="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:types>

<schema targetNamespace="http://<webservicefolder>.<rootfolder>" xmlns="http://www.w3.org/2001/XMLSchema">

You can see the difference in the tns2, targetNamespace value. We do not understand how this namespace is getting generated and why it is different in the 2 servers with same code & same CF version.

Any help on this will be greatly appreciated.

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

In the CF admin under Data & Services > Web Services change the web service version to 1.  See if that fixes your issue.

--Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

Hi,  The Web service version is 1 in both QA and Prod currently.

Any idea on what determines the targetNamespace value when ColdFusion generates the WSDL and how we can control it in code (apart from what we have already done by specifying above mentioned attributes in <cfcomponent> tag) ?.

I also need to mention that we tried saving the correct WSDL (from QA)  in the server and referring to it in <cfcomponent> tag as < cfcomponent wsdlfile = wsdlfilepath > . Even then, in the response, the tns1 value is set wrongly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

Also, correction to my first query. The difference between QA & Prod WSDLs is in values tns1, targetNamespace values. QA (correct one) values are http://webservicefolder  name  & Prod (not working) is http://webservicefolder.rootfolder.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 08, 2015 Dec 08, 2015

Copy link to clipboard

Copied

LATEST

I have a similar issue in that we use the default targetNamespace="http://ws.apache.org/axis2" however when we added a mapping in our Application.cfc ( this.mappings["/webroot"] = "/var/www/mywebsite"; ) the targetnamespace of all our webservice wsdls got rewritten to targetNamespace="http://<webservicefolder>.webroot". Have you had any success in getting to the bottom of this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation