m_nille

Hi everyone,

I did some searching via google but didn't find a solution or answer to the following problem
(http://blogs.sun.com/arungupta/entry/resolved_wsit_and_wcf_jun was a similiar error message but not the same).

I only have a wsdl file here and want to create the client proxy classes with svcutil. Unfortunately, I get the following error a few times:

---snip---
Warning: The optional WSDL extension element 'header' from namespace 'xxx' was not handled. XPath://wsdl:definitions[@targetNamespace='xxx']
/wsdl:binding[@name='xxx']/wsdl:operation[@name='zzz']/wsdl:input
---snap---

I replaced the original names of the namespace etc. The wsdl is created by a third party tool.

I don't have access to the implementation to the webservice and therefore can not change anything in the wsdl file. Does anyone has similiar problems or know what I can do

I should mention, that this is my first experience in WCF.

Thanks a lot in advance.

NM

edit
I think the responsible part of the wsdl file is

---snip---
...
<wsdl:operation name="OperationA">
            <soap:operation style="document" soapAction="OperationA"/>
            <wsdl:input>
                <soap:body parts="body" use="literal" namespace="xxx"/>
                <soap:header part="head" message="tns:yyy_requestHeader" use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body parts="body" use="literal" namespace="xxx"/>
                <soap:header part="head" message="tns:yyy_responseHeader" use="literal"/>
            </wsdl:output>
        </wsdl:operation>
...
---snap---
And svcutil  is version 3.0.4506.30



Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

Jeff Cao

Does the wsdl file imports other wsdl/xsd files If so, to generate the proxy file from command line you will need to list all files required on the command line like this:

svcutil.exe /t:code main.wsdl sub1.wsdl sub2.wsdl extra.xsd...

If that does not help with your problem, please email it to me at ######## and I will see if I can repro here as well...

Thanks.





Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

m_nille

Unfortunately, no other files are imported, so that this is not the reason. I sent you an email, to which I attached the wsdl file.

Thanks a lot for your offer and your reply.





Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

Jeff Cao

Okay, the reason you are seeing those warning message is that youe wsdl contains Customer schema type with lots of attributes, so the DataContractSerializer by default can't handle it - that's why you don't see them generated in the final proxy file. If you specify another switch /ixt, you will see the correct service generated, but the Customer schema type becomes an IXmlSerializanle type.

The correct command to generate your proxy is this:

svcutil.exe /serializer:DataContractSerializer /ixt /dconly MetaOMNIConnect_v72.wsdl

You can read more on DataContract Schemas here: http://msdn2.microsoft.com/en-us/library/ms733112.aspx

Hope this resolves your problem.

Thanks.





Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

m_nille

First of all: Thanks a lot for your help.

I'm really sorry but I have another question.

With your help I'm now able to generate some classes, but no classes are generated, to create a client. Maybe because of the '/dconly' option The generated classes seem to refer to the 'xs' elements in the wsdl files and therefore contains mainly information about the 'data types'. My big remaining questions is, how can I create a client, which can connect to the web service, which is specified by the wsdl file

Sorry again for these probably stupid questions.






Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

Jeff Cao

No problem.  If you use the regular command line: svcutil.exe /t:code *.wsdl

You will see a long list of warnings, plus the interfact and class info generated in the proxy file at the end.  The info in that proxy file is the one you needed to invoke the service on the server side.  You are seeing those warning messages becasue your wsdl file contains customer schema type that comes with attributes and can't be handled by neither XmlSerializer nor DataContractSerializer that used by svcutil.exe as default settings.

with the new command line and /ixt serializer you can now generate those missing schemas in a second file.  Between those two you should have all the data you need from the wsdl.





Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

m_nille

Great, thanks a lot for your help.

I'm struggling a bit with the serialization but that's my problem :-).

Thanks again, you helped me very much.




Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

Jeff Cao

Glad I could be of help. The support for third party wsdl has always been hard since our own wsdl will never have these attributes in a custom schema type. We are trying to ask everybody to switch to using DataContracts and take advantage of the DataContractSerializer that comes with WCF, but in your case, it might be out of your control.

Good luck.





Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

m_nille

Hi,

Sorry, I do have three more questions.

1.) The first is concerning the produced SOAP message. The message starts with:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

Is it possible to insert a line before (< xml version="1.0" encoding="UTF-8" >) that I already readt this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1138584&SiteID=1
It seems to be very complicated. Unfortunately, the server side expects this.

2) Is it possible to edit the SOAP envelope/body The client creates something like <s:body> and the server side possibly expects <SOAP-ENV:Envelope> Could that be Or are these two versions compatible

3) When a Object is seriarlized, every XmlNode in the XmlNodes[], gets an empty namespace attribute (xmlns=""). The class - generated with svcutil - implements System.Xml.Serialization.IXmlSerializable. Is there a way to prohibit this

The starts of the message now looks like this:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><MetaOMNIConnect xmlns="http://www.omnimoving.com/OMNIConnect"><OMNIConnectMessage xmlns=""><BulkMessageHeader>.....

...and should look like this:

< xml version="1.0" encoding="UTF-8" >
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><MetaOMNIConnect xmlns="http://www.omnimoving.com/OMNIConnect"><OMNIConnectMessage><BulkMessageHeader>...


These questions are quite off-topic in regard of the subject. Should I rather post them in a new thread

Kind Regards




Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

Jeff Cao

Unfortunately, Brian's answer in this post http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=908657&SiteID=1 is the only way for you to get this done currently. issue number 3 you listed above was a known bug that currently breaks BP conformance, but the bug is not in our code, so I don't know when a fix can become available.



Re: Windows Communication Foundation (Indigo) Warning: the optional WSDl...svcutil and Java web service

m_nille

Many thanks once more again. So, I'll implement something like the 'demo code' to match the web service expectations. Sorry for having bothered you constantly.

Kind Regards,
NM