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

ColdFusion call to .NET webservice gives org.xml.sax.SAXException

Guest
Jun 02, 2009 Jun 02, 2009

Copy link to clipboard

Copied

We are a small team with one ASP.NET web developer and one ColdFusion developer. Neither of us knows the other's environment. I wrote an ASMX webservice using Visual Studio 2005 and a web application project in Visual Studio 2008 that successfully consumes the web service. But now we are trying to have my ColdFusion colleague consume the webservice and we are getting results we cannot interpret (except to surmise that the target webservice is not even being reached but that some "system layer" used by ColdFusion is failing.

EDIT - update: 02 June 2009:

Top most part of the error message seen by CF developer:

"Could not generate stub objects for web service invocation"

Here is the stack trace seen by the CF client:

org.xml.sax.SAXException: Fatal Error: URI=null Line=11: The element type "META" must be terminated by the matching end-tag "</META>".
    at org
.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
    at org
.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org
.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org
.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org
.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    at org
.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
    at org
.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org
.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org
.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org
.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org
.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org
.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org
.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at org
.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
    at org
.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:388)
    at coldfusion
.xml.rpc.XmlRpcServiceImpl.retrieveWSDL(XmlRpcServiceImpl.java:647)
    at coldfusion
.xml.rpc.XmlRpcServiceImpl.access$000(XmlRpcServiceImpl.java:51)
    at coldfusion
.xml.rpc.XmlRpcServiceImpl$1.run(XmlRpcServiceImpl.java:208)
    at java
.security.AccessController.doPrivileged(Native Method)
    at coldfusion
.xml.rpc.XmlRpcServiceImpl.registerWebService(XmlRpcServiceImpl.java:201)
    at coldfusion
.xml.rpc.XmlRpcServiceImpl.getWebService(XmlRpcServiceImpl.java:475)
    at coldfusion
.xml.rpc.XmlRpcServiceImpl.getWebServiceProxy(XmlRpcServiceImpl.java:430)
    at coldfusion
.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:381)
    at cfuploadfileSimple2ecfm1056043715
.runPage(D😕AMTSTEST\webservice\uploadfileSimple.cfm:68)
    at coldfusion
.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion
.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion
.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion
.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
    at coldfusion
.filter.PathFilter.invoke(PathFilter.java:86)
    at coldfusion
.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
    at coldfusion
.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
    at coldfusion
.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.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
.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
    at coldfusion
.CfmServlet.service(CfmServlet.java:107)
    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:541)
    at jrun
.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at jrunx
.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
    at jrunx
.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at jrunx
.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
    at jrunx
.scheduler.WorkerThread.run(WorkerThread.java:66)

Here is the signature of the webmethod we are attempting to call:

[WebMethod]
   
public string UploadFileBasic(string trimURL
       
, byte[] incomingArray
       
, string FileName
       
, string TrimRecordTypeName)

We are quite confused about how to proceed. Tomorrow I could post the CF source code if that would be useful but from what I've seen it is very straightforward and most of the arguments in the CF invoke of the service are constants (strings) at this point in our unit testing.

Any help or suggestions of appropriate CF forums would be appreciated. Thanks.

EDIT-update 02 June 2009:

Here is the CFML code:

<!--- read test.txt file into a binary variable --->
<cffile action="readBinary"   file="#FileName#" variable="objBinaryData">
<!--- convert the binary variable to Base64 ---> 
<cfset b64file = #toBase64(objBinaryData)#>
<!--- invoke .net web service --->
<cfinvoke webservice =  "http://trim/trimbroker/fileservice.asmx?wsdl"
         
method = "UploadFileBasic"     
         
returnVariable = "recordNumber">
   
<cfinvokeargument name="trimURL" value="trim/trimWSdev/trim.asmx" />
   
<cfinvokeargument name="incomingArray" value="#b64file#" />
   
<cfinvokeargument name="FileName" value="#form.FILENAME#" />
   
<cfinvokeargument name="TrimRecordTypeName" value="Document" />
</cfinvoke>

Please note we have simplified this considerably trying to get things working. Arguments 1 and 4 above are simply string constants. Argument 2 is our attempt at the byte array expected by .Net. We believe we are NOT being rejected by the .Net web service; rather, it appears from the stack trace that it is falling into the SAX exception before the message is even being sent across the network. The .Net webservice does NOT log anything to the application log or system log of the server on which it runs.

The ColdFusion release is: ColdFusion MX 7.

TOPICS
Advanced techniques

Views

4.7K

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
Enthusiast ,
Jun 02, 2009 Jun 02, 2009

Copy link to clipboard

Copied

The error message suggest that you're getting plain HTML instead of

WSDL and when CF tries to parse that it fails (and it complains about

the META tag not being closed).

See what you're getting for this URL in a browser:

"http://trim/trimbroker/fileservice.asmx?wsdl" . You should get a XML

document (the description of the web service in xml).

Mack

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
Jun 02, 2009 Jun 02, 2009

Copy link to clipboard

Copied

Here is what is in "View Page Source" when that URI is viewed from a browser:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://cbmiweb.com/TrimBroker/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://cbmiweb.com/TrimBroker/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://cbmiweb.com/TrimBroker/">
      <s:element name="UploadFile">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="trimURL" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="incomingArray" type="s:base64Binary" />
            <s:element minOccurs="0" maxOccurs="1" name="FileName" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="TrimRecordTypeName" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="metaDataArray" type="tns:ArrayOfMetaData" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="ArrayOfMetaData">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="MetaData" nillable="true" type="tns:MetaData" />
        </s:sequence>
      </s:complexType>
      <s:complexType name="MetaData">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="Value" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:element name="UploadFileResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="UploadFileResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="UploadFileBasic">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="trimURL" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="incomingArray" type="s:base64Binary" />
            <s:element minOccurs="0" maxOccurs="1" name="FileName" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="TrimRecordTypeName" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="UploadFileBasicResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="UploadFileBasicResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="DownloadFile">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="recNumString" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="DownloadFileResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="DownloadFileResult" type="s:boolean" />
            <s:element minOccurs="0" maxOccurs="1" name="docContents" type="s:base64Binary" />
            <s:element minOccurs="0" maxOccurs="1" name="returnFiletype" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="UploadFileSoapIn">
    <wsdl:part name="parameters" element="tns:UploadFile" />
  </wsdl:message>
  <wsdl:message name="UploadFileSoapOut">
    <wsdl:part name="parameters" element="tns:UploadFileResponse" />
  </wsdl:message>
  <wsdl:message name="UploadFileBasicSoapIn">
    <wsdl:part name="parameters" element="tns:UploadFileBasic" />
  </wsdl:message>
  <wsdl:message name="UploadFileBasicSoapOut">
    <wsdl:part name="parameters" element="tns:UploadFileBasicResponse" />
  </wsdl:message>
  <wsdl:message name="DownloadFileSoapIn">
    <wsdl:part name="parameters" element="tns:DownloadFile" />
  </wsdl:message>
  <wsdl:message name="DownloadFileSoapOut">
    <wsdl:part name="parameters" element="tns:DownloadFileResponse" />
  </wsdl:message>
  <wsdl:portType name="FileServiceSoap">
    <wsdl:operation name="UploadFile">
      <wsdl:input message="tns:UploadFileSoapIn" />
      <wsdl:output message="tns:UploadFileSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="UploadFileBasic">
      <wsdl:input message="tns:UploadFileBasicSoapIn" />
      <wsdl:output message="tns:UploadFileBasicSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="DownloadFile">
      <wsdl:input message="tns:DownloadFileSoapIn" />
      <wsdl:output message="tns:DownloadFileSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="FileServiceSoap" type="tns:FileServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="UploadFile">
      <soap:operation soapAction="http://cbmiweb.com/TrimBroker/UploadFile" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="UploadFileBasic">
      <soap:operation soapAction="http://cbmiweb.com/TrimBroker/UploadFileBasic" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="DownloadFile">
      <soap:operation soapAction="http://cbmiweb.com/TrimBroker/DownloadFile" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="FileServiceSoap12" type="tns:FileServiceSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="UploadFile">
      <soap12:operation soapAction="http://cbmiweb.com/TrimBroker/UploadFile" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="UploadFileBasic">
      <soap12:operation soapAction="http://cbmiweb.com/TrimBroker/UploadFileBasic" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="DownloadFile">
      <soap12:operation soapAction="http://cbmiweb.com/TrimBroker/DownloadFile" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="FileService">
    <wsdl:port name="FileServiceSoap" binding="tns:FileServiceSoap">
      <soap:address location="http://trim/trimbroker/fileservice.asmx" />
    </wsdl:port>
    <wsdl:port name="FileServiceSoap12" binding="tns:FileServiceSoap12">
      <soap12:address location="http://trim/trimbroker/fileservice.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

The CF people are trying to call the webmethod called FileUploadBasic in the WSDL above which takes 4 arguments. How can we (should we?) verify that proper maintenance (hotfixes, servicepacks, etc.) have been applied to our version of ColdFusion MX 7 part of which is this xerces parser which seems to be involved (see stack trace)?

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
Enthusiast ,
Jun 02, 2009 Jun 02, 2009

Copy link to clipboard

Copied

The error message makes me believe that you're not pointing the

webservice attribute of the cfinvoke tag to the wsdl location but to a

HTML page (the error refers to a meta tag which does not exist in the

wsdl). Check that the CF code really points to the wsdl url.

Mack

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
Advisor ,
Jun 03, 2009 Jun 03, 2009

Copy link to clipboard

Copied

It looks like CF is failing when it tries to create a proxy to consume the ASMX web service.  This is process is analogous to using the .NET wsdl.exe tool to create a proxy class for your .NET project.  It is possible that the underlying Apache Axis web services components don't understand your WSDL.  Try commenting all the public web service methods in your ASMX except UploadFileBasic and see if ColdFusion can understand the simplified web service.  You may need to login to the ColdFusion Administrator and delete and web service references to your WSDL first.

You might also investigate the wsdl2java.exe tool that ColdFusion uses, this is analogous to the wsdl.exe tool.  Running wsdl2java.exe at the command line *might* provide better error messages.

"Creating webservice stubs with wsdl2java in ColdFusion MX 7"
http://kb2.adobe.com/cps/039/eaf0396.html

"WSDL2Java Reference"
http://ws.apache.org/axis/java/reference.html#WSDL2JavaReference


You should also verify that you have the lastest version of CF7, version 7.0.2. 
http://www.adobe.com/support/coldfusion/downloads_updates.html#mx7

I also work in a mixed .NET / ColdFusion environment so I'm curious to find out about your problem.  If you find a solution please post it to this forum.

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
Jun 03, 2009 Jun 03, 2009

Copy link to clipboard

Copied

Thank you for your suggestions. They definitely helped our team discover the trick to making this work.

Here is the "good news" for us:

We ran wsdl2java.exe at the command line, observed what got created, and eventually deduced that ColdFusion Admin could register some webservices but not the one we needed for this project. Then we examined the IIS properties of the target webservice versus the IIS properties of other (.net) webservices we were able to register to CF. The latter webservices were all configured to allow anonymous access or to require "Basic authentication"; all of these we were able to register to CF Admin.

The target webservice which could not be registered to CF was configured with "Integrated Windows Authentication" (anonymous is specifically disallowed). Once we checked the box adding "Basic Authentication" (i.e. credentials passed in clear text across the network), we were then able to successfully register the required webservice by supplying a valid domain username/password in the textboxes provided for this in the CF Admin.

Then we fired up our CF web client application, entered some data on the page, and clicked a button to invoke this target webservice with the data as arguments. This worked properly.

But "the bad news" is:

Our project requires that this webservice be configured as "Integrated Windows Authentication" only. This is part of an INTRAnet app that must use Kerberos and must have the credentials of the "end user" of the web app be passed from the web client page, to the webservice, to another WS called by the first webservice. We already have an ASP.NET web app that calls the first webservice properly passing on the credentials of the windows authenticated user; but we would like to weave the invocation of this webservice into a larger system all written in ColdFusion. So changing the IIS authentication to "Basic" is only a temporary "fix" and one we shall have to abandon.

So, the question for us now becomes: "In ColdFusion MX 7.0.2, how to register a webservice that requires Windows Authentication?"

We are researching this now but I wanted to update this thread with what we learned. Thanks for your help. Any ideas on this latest twist would be appreciated.

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
Valorous Hero ,
Jun 03, 2009 Jun 03, 2009

Copy link to clipboard

Copied

LATEST

Good luck with that search.  If you find something I'm sure we would all love to hear it.

As far as I know, only Microsoft products can pass the required protocols for "Windows Integrated Security", thus the name.

Now, is it really "Windows Integrated Security" that is required or just that security is required?

My understanding, though I have never had to do this, that basic security is quite secure when combined with the HTTPS protocol.  Yes that user name and password are in plain text at the application level, the encryption is handled at the TCP/IP level to protect this information in transit between the servers.

Don't know if that is usefully information, but wanted to throw it out there.

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