0
votes

I just ported a project from Visual Studio 2005 format to Visual Studio 2008. This project makes heavy use of consuming web services.

We use our own custom parent class for the generated proxy classes (Reference.cs) that Visual Studio generates up.

I added a new web reference using Visual Studio 2008, and it did not generate the proxy class, just a reference.map file. It appears that perhaps it builds these on the fly. This won't work for my needs, as I need to modify the code to fit our framework.

Note, this is Web References, not service references.

Does anyone know of a way to make VS2k8 work like 2k5 for me?

2

2 Answers

1
votes

Perhaps you ought to use svcutil.exe or wsdl.exe to generate proxy class files.

1
votes

After a bit of mucking about, I found this post on the internet.

Turns out that the WSDL provided had a snippet like:

<wsdl:message name="someMessageRequest">
    <wsdl:part name="parameters" element="ns0:someMessageRequest"/>
</wsdl:message>
<wsdl:message name="someMessageResponse">
    <wsdl:part name="parameters" element="ns0:someMessageResponse"/>
</wsdl:message>

... SNIP ...

<soap:operation style="document" soapAction="someMessage"/>
<wsdl:input>
     <soap:body use="literal" parts="parameters"/>
</wsdl:input>
<wsdl:output>
     <soap:body use="literal" parts="parameters"/>
</wsdl:output>

Because it uses the same name for both request and response parameters, wsdl.exe is unable to resolve it and dies.

My fix:

<wsdl:message name="someMessageRequest">
    <wsdl:part name="parametersRequest" element="ns0:someMessageRequest"/>
</wsdl:message>
<wsdl:message name="someMessageResponse">
    <wsdl:part name="parametersResponse" element="ns0:someMessageResponse"/>
</wsdl:message>

... SNIP ...

<soap:operation style="document" soapAction="someMessage"/>
<wsdl:input>
     <soap:body use="literal" parts="parametersRequest"/>
</wsdl:input>
<wsdl:output>
     <soap:body use="literal" parts="parametersResponse"/>
</wsdl:output>

Now the proxy is generated.

Part of the fun of SoA is that you can never trust the WSDL's you are provided to work :)