locked
Webservice Connection problem in Visual Studio 2010 RRS feed

  • Question

  • I want to connect to this web service with Visual Studio 2010:

    http://81.31.224.155/jboss-net/services/EKICardManager?wsdl

    and i got this problem:

    ----------------------------------------------------------------------------------------------------------------------------

    The document at the url http://81.31.224.155/jboss-net/services/EKICardManager?wsdl was not recognized as a known document type.
    The error message from each known type may help you fix the problem:
    - Report from 'XML Schema' is 'The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.
    - Report from 'DISCO Document' is 'Discovery document at the URL http://81.31.224.155/jboss-net/services/EKICardManager?wsdl could not be found.'.
      - The document format is not recognized.
    - Report from 'WSDL Document' is 'There is an error in XML document (2, 12915).'.
      - The element was not expected in this context: <simpleContent xmlns='http://www.w3.org/2001/XMLSchema'>..</simpleContent>. Expected elements: http://www.w3.org/2001/XMLSchema:annotation, http://www.w3.org/2001/XMLSchema:list, http://www.w3.org/2001/XMLSchema:restriction, http://www.w3.org/2001/XMLSchema:union.
    Metadata contains a reference that cannot be resolved: 'http://81.31.224.155/jboss-net/services/EKICardManager?wsdl'.
    The content type text/xml; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 459 bytes of the response were: '<?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <soapenv:Body>
      <soapenv:Fault>
       <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
       <faultstring>no SOAPAction header!</faultstring>
       <detail/>
      </soapenv:Fault>
     </soapenv:Body>
    </soapenv:Envelope>'.
    The remote server returned an error: (500) Internal Server Error.
    If the service is defined in the current solution, try building the solution and adding the service reference again.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------

    i don't have any idea why this happens but SOAP testers can invoke the methods of this service.can anyone help?

    Thanks

    • Moved by Lisa Zhu Thursday, December 6, 2012 2:23 AM not C# related (From:Visual C# General)
    • Moved by Sheng Jiang 蒋晟 Friday, December 7, 2012 12:37 AM WSDL related (From:Where is the Forum For…?)
    Tuesday, December 4, 2012 9:10 AM

All replies

  • The XML file is not valid.  You need a 2nd line which is a ROOT.  The current 2nd line starts with a dash character which is an element.

    You can use visual Studio to validate a XML file by checking the schema doin gthe following

    1) Put the xml into a file with an xml extension

    2) From VS Start Page menu File - Open browse for the file

    3) Select menu XML - Schema.

    4) Check in the USE column for the row with "xml.xsd" the option "Use this schema"

    5) Select Menu - View : Error List (location variaes with different versions of VS).


    jdweng

    Tuesday, December 4, 2012 12:15 PM
  • Hi Hossein,

     

    Thank you for visiting the MSDN forum. I’m afraid that it is not the correct forum about this issue. I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.

    Thanks for your understanding.

    Regards,


    Lisa Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 6, 2012 2:21 AM
  • All  you have to do to find the errors is open the WSDL in Visual Studio, as an XML file. When I do that, I receive the following errors:

    Namespace 'http://model.jsa.objectj.com' is not available to be referenced in this schema.
    Namespace 'http://model.jsa.objectj.com' is not available to be referenced in this schema.
    Namespace 'http://81.31.224.155/jboss-net/services/EKICardManager' is not available to be referenced in this schema.
    Namespace 'http://81.31.224.155/jboss-net/services/EKICardManager' is not available to be referenced in this schema.
    Namespace 'http://model.jsa.objectj.com' is not available to be referenced in this schema.
    Undefined complexType 'http://model.jsa.objectj.com:BaseValueObject' is used as a base for complex type extension.
    Undefined complexType 'http://model.jsa.objectj.com:BaseValueObject' is used as a base for complex type extension.
    Undefined complexType 'http://model.jsa.objectj.com:BaseValueObject' is used as a base for complex type extension.
    The 'http://www.w3.org/2001/XMLSchema:simpleContent' element is not supported in this context.
    Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is used as a base for complex type restriction.
    Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is used as a base for complex type restriction.
    Namespace 'http://model.jsa.objectj.com' is not available to be referenced in this schema.
    Namespace 'http://model.jsa.objectj.com' is not available to be referenced in this schema.
    Namespace 'http://81.31.224.155/jboss-net/services/EKICardManager' is not available to be referenced in this schema.
    Namespace 'http://81.31.224.155/jboss-net/services/EKICardManager' is not available to be referenced in this schema.
    Namespace 'http://model.jsa.objectj.com' is not available to be referenced in this schema.
    Imported schema for namespace 'http://schemas.xmlsoap.org/soap/encoding/' was not resolved.
    Imported schema for namespace 'http://schemas.xmlsoap.org/soap/encoding/' was not resolved.
    Imported schema for namespace 'http://schemas.xmlsoap.org/soap/encoding/' was not resolved.



    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Friday, December 7, 2012 3:49 AM
    Moderator
  • I believe all the schema issues where yellow colored warning (not red errors) which are acceptable.  I am concerned with the dump errors also showing the http://81.31.224.155/jboss-net/services/EKICardManager warning message.  I don't think this file is accesible.  A schema normally has an extension xsd (or equivalent).  I would make sure the folder is valid by putting the URL into a webbrowser and make sure you can see the file.

    jdweng

    Friday, December 7, 2012 7:03 AM
  • I disagree. The "undefined complexType" errors will likely prevent correct creation of properties, as the tool will not know what to use for a base type.

    FYI, "http://81.31.224.155/jboss-net/services/EKICardManager is not a path to an XSD file. That's simply a namespace. Don't worry about the fact that you can't find a file there - that's normal.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Saturday, December 8, 2012 12:04 AM
    Moderator