• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
.NET Framework Developer Center
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
.NET Framework Developer Center > .NET Development Forums > Windows Communication Foundation > Problem creating proxy for java webservice with svcutil
Ask a questionAsk a question
Search Forums:
  • Search Windows Communication Foundation Forum Search Windows Communication Foundation Forum
  • Search All .NET Development Forums Search All .NET Development Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerProblem creating proxy for java webservice with svcutil

  • Monday, March 12, 2007 8:50 AMmsteinle Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Hello,

    I tried to create a proxy for a java web service using svcutil.exe.
    Svcutil.exe fails with the message
    Error: Cannot import wsdl:portType
    Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
    Error: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager']/wsdl:portType[@name='AccessControl']

    The wsdl is as follows:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <definitions name="de.itinformatik.SOAMetaModel.Services.SecurityManager.AccessControl" targetNamespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager"
        xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager/types"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <types>
            <schema targetNamespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager/types"
                xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:tns="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager/types"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <complexType name="ServiceException">
                    <sequence>
                        <element name="domainClass" nillable="true" type="string" />
                        <element name="message" nillable="true" type="string" />
                    </sequence>
                </complexType>
                <complexType name="InternalException">
                    <complexContent>
                        <extension base="tns:ServiceException">
                            <sequence />
                        </extension>
                    </complexContent>
                </complexType>
                <complexType name="PersistenceException">
                    <complexContent>
                        <extension base="tns:ServiceException">
                            <sequence />
                        </extension>
                    </complexContent>
                </complexType>
                <complexType name="AuthenticationFailedException">
                    <complexContent>
                        <extension base="tns:ServiceException">
                            <sequence />
                        </extension>
                    </complexContent>
                </complexType>
                <complexType name="TransactionException">
                    <complexContent>
                        <extension base="tns:ServiceException">
                            <sequence />
                        </extension>
                    </complexContent>
                </complexType>
                <complexType name="EnlistmentFailedException">
                    <complexContent>
                        <extension base="tns:TransactionException">
                            <sequence />
                        </extension>
                    </complexContent>
                </complexType>
                <complexType name="StringArray">
                    <sequence>
                        <element maxOccurs="unbounded" minOccurs="0" name="content" nillable="true" type="string" />
                    </sequence>
                </complexType>
                <complexType name="BooleanArray">
                    <sequence>
                        <element maxOccurs="unbounded" minOccurs="0" name="content" type="boolean" />
                    </sequence>
                </complexType>
                <element name="PersistenceException" type="tns:PersistenceException" />
                <element name="TransactionException" type="tns:TransactionException" />
                <element name="InternalException" type="tns:InternalException" />
                <element name="EnlistmentFailedException" type="tns:EnlistmentFailedException" />
            </schema>
        </types>
        <message name="TransactionException">
            <part element="ns2:TransactionException" name="TransactionException" />
        </message>
        <message name="AccessControl_isAuthorizedForUseCases">
            <part name="String_1" type="xsd:string" />
            <part name="StringArray_2" type="ns2:StringArray" />
        </message>
        <message name="PersistenceException">
            <part element="ns2:PersistenceException" name="PersistenceException" />
        </message>
        <message name="AccessControl_isAuthorizedForUseCasesResponse">
            <part name="result" type="ns2:BooleanArray" />
        </message>
        <message name="InternalException">
            <part element="ns2:InternalException" name="InternalException" />
        </message>
        <message name="EnlistmentFailedException">
            <part element="ns2:EnlistmentFailedException" name="EnlistmentFailedException" />
        </message>
        <portType name="AccessControl">
            <operation name="isAuthorizedForUseCases" parameterOrder="String_1 StringArray_2">
                <input message="tns:AccessControl_isAuthorizedForUseCases" />
                <output message="tns:AccessControl_isAuthorizedForUseCasesResponse" />
                <fault message="tns:InternalException" name="InternalException" />
                <fault message="tns:PersistenceException" name="PersistenceException" />
                <fault message="tns:TransactionException" name="TransactionException" />
                <fault message="tns:EnlistmentFailedException" name="EnlistmentFailedException" />
            </operation>
        </portType>
        <binding name="AccessControlBinding" type="tns:AccessControl">
            <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
            <operation name="isAuthorizedForUseCases">
                <soap:operation soapAction="" />
                <input>
                    <soap:body namespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager" use="literal" />
                </input>
                <output>
                    <soap:body namespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager" use="literal" />
                </output>
                <fault name="InternalException">
                    <soap:fault name="InternalException" use="literal" />
                </fault>
                <fault name="PersistenceException">
                    <soap:fault name="PersistenceException" use="literal" />
                </fault>
                <fault name="TransactionException">
                    <soap:fault name="TransactionException" use="literal" />
                </fault>
                <fault name="EnlistmentFailedException">
                    <soap:fault name="EnlistmentFailedException" use="literal" />
                </fault>
            </operation>
        </binding>
        <service name="De.itinformatik.SOAMetaModel.Services.SecurityManager.AccessControl">
            <port binding="tns:AccessControlBinding" name="AccessControlPort">
                <soap:address location="http://it1srv19:8080/SecurityManager/AccessControl" />
            </port>
        </service>
    </definitions>

    Using .NET2.0/WSE3.0, there was no problem to create the proxy.
    Any suggestions?
    Regards, Martin
    • ReplyReply
    • QuoteQuote
     

Answers

  • Friday, March 16, 2007 9:11 PMHao Xu - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0
    Sorry, my bad. It turned out to be the differences between XmlSerializer and XmlFormatter. If you use XmlSerializer (use SvcUtil option /serializer:XmlSerializer), it should work fine.
    • ReplyReply
    • QuoteQuote
     

All Replies

  • Monday, March 12, 2007 7:20 PMQuantum00MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Is that error message in German??
    • ReplyReply
    • QuoteQuote
     
  • Tuesday, March 13, 2007 3:27 PMmsteinle Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    It is in german, the english translation is "Object reference not set to an instance of an object.". The standard message of a NullReferenceException.

    • ReplyReply
    • QuoteQuote
     
  • Friday, March 16, 2007 5:05 PMHao Xu - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    I don't see the soap:binding element in the AccessControl portType. Could that be the cause? Is it possible for you to update the WSDL and see if it fixes the problem?
    • ReplyReply
    • QuoteQuote
     
  • Friday, March 16, 2007 5:24 PMmsteinle Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    I've never seen a portType with soap:binding element. The soap:binding element is in the binding.

    To be sure, I looked at the wsdl of a .NET WSE web service. It does not have a soap:binding element in its portType, but in the wsdl:binding element, just like my java web service.

    Greetings, Martin

    • ReplyReply
    • QuoteQuote
     
  • Monday, March 19, 2007 1:26 PMmsteinle Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Thank you for your reply. I tried this, and svcutil completed without exception.
    But now, the generated proxy code does not compile.
    In the generated interface, the method is annotated with some FaultContract attributes, which refer to classes svcutil did not generate.
    The attributes look the following:
        [System.ServiceModel.FaultContractAttribute(typeof(www.itinformatik.de.de1.itinformatik1.SOAMetaModel.Services.SecurityManager.types.InternalException), Action="", Name="InternalException", Namespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager" +
            "/types")]
        [System.ServiceModel.FaultContractAttribute(typeof(www.itinformatik.de.de1.itinformatik1.SOAMetaModel.Services.SecurityManager.types.PersistenceException), Action="", Name="PersistenceException", Namespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager" +
            "/types")]
        [System.ServiceModel.FaultContractAttribute(typeof(www.itinformatik.de.de1.itinformatik1.SOAMetaModel.Services.SecurityManager.types.TransactionException), Action="", Name="TransactionException", Namespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager" +
            "/types")]
        [System.ServiceModel.FaultContractAttribute(typeof(www.itinformatik.de.de1.itinformatik1.SOAMetaModel.Services.SecurityManager.types.EnlistmentFailedException), Action="", Name="EnlistmentFailedException", Namespace="http://www.it-informatik.de/de/itinformatik/SOAMetaModel/Services/SecurityManager" +
            "/types")]

    I had to remove those attributes to make the proxy work.
    Could you tell me if Microsoft is planning to improve svcutil for better support of Java web services?

    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement