none
Consuming a non-WCF Service

    Question

  • I have had luck in the past using "Consume WCF Service" with services that are not actually implemented in WCF (or in some cases I don't know what they were implemented with, which was supposed to be the whole point of SOAP/XML based services). I would much rather use it than the techniques described in consuming web services.

    I am currently attempting to use it to consume a web service hosted in a system called Maximo. It is implemented in Java. I have been able to use the WSDL from this service with soapUI, wsdl.exe, serviceutil.exe, and "Add Service Reference" without those tools complaining.

    If I attempt to use "Consume WCF Service", either by pointing it to the WSDL using HTTP or by using downloaded versions of the WSDL and XSD, I get the infamous error "Error consuming WCF service metadata. Object reference not set to an instance of an object." Using DebugView tells me the problem is here:

    • at Microsoft.BizTalk.Adapter.Wcf.Consuming.Consumer.ProcessSchemas(ServiceDescriptionCollection wsdlServiceDescriptions, XmlSchemaSet xmlSchemaSet, XmlSchemaSet rpcSchemaSet) 
    • at Microsoft.BizTalk.Adapter.Wcf.Consuming.Consumer.Consume(ISynchronizeInvoke synchronizeInvoke, DTE dte, MetadataSet metadataSet, Project project, String importNamespace) 

    However, I don't see anything obvious wrong with the namespaces. The WSDL and XSD both contain a targetNamespace.

    WSDL definitions:

    <definitions xmlns:mx="http://www.ibm.com/maximo" xmlns:mxws="http://www.ibm.com/maximo/wsdl/MXITEM" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="MXITEM" targetNamespace="http://www.ibm.com/maximo/wsdl/MXITEM" xmlns="http://schemas.xmlsoap.org/wsdl/">

    XSD schemas:

    <xsd:schema xmlns="http://www.ibm.com/maximo" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.ibm.com/maximo" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    Is there anything in particular I should be looking for, or some way to coax the actual problem out of the adapter wizard?

    I'm using BizTalk Server 2013 R2 (CU6) with Visual Studio Premium 2013, update 5.

    Thursday, August 31, 2017 3:15 PM

Answers

  • Out of complete desperation, I used a web browser to save the WSDL and XSD files. Then I used a text editor to combine the two of them together into a single file rather than have the WSDL refer to the XSD. And it worked!!!!

    So the problem was not with the WSDL, or any of type types. It was completely a problem with the wizard attempting to follow the <xsd:schema><xsd:import schemaLocation> attribute.

    <sarcasm>How nice of the "Wizard" to give an accurate, useful error message!</sarcasm>

    • Marked as answer by twhensley Friday, September 1, 2017 9:02 PM
    Friday, September 1, 2017 9:02 PM

All replies