question

Gopi2105-6172 avatar image
0 Votes"
Gopi2105-6172 asked cooldadtx commented

renaming porttype & binding name in wsdl is not leads to exception, is server considering as different version?

Hi,

I have a WSDL downloaded from the from the server, I made following changes to the WSDL without changing the soapAction. but still I am able to consume the service without any issues. is this because of the server is considering changed WSDL as new version and allowing backward compatibility. Anyone please clarify why its working even through WSDL has changed.

  1. renamed PortType

  2. renamed Binding Name and Binding Type



    WSDL 1:-
    <s2:portType name="sampleApplication">
    <s2:binding name="sampleApplicationBiniding" type="s3:sampleApplication">
    <s2:operation name:"GetNamelist">
    s4:operation soapAction="http://www.example.com/sampleApplication/GetNamelist"
    WSDL 2:-

    <s2:portType name="sampleApplication1">
    <s2:binding name="sampleApplicationBiniding1" type="s3:sampleApplication1">
    s4:operation soapAction="http://www.example.com/sampleApplication/GetNamelist"



windows-wcf
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered cooldadtx commented

Not really sure what you mean by "changing the WSDL" as a WSDL is just a metadata description of a service. Assuming you are using WCF service client then when you connected to the WSDL it would have auto-generated a .NET type from the WSDL. From that point on the WSDL is irrelevant and isn't used. The only time it would be used again is if you opted to update the auto-generated code.

As for the names they are mostly irrelevant for the actual WSDL. They are just identifiers and can be called whatever you want without actually impacting the generated code or how you communicate with the service. They do play a role in hooking things up so, for example, if you were to change the name of a binding configuration without also updating any references (within the WSDL) to that name then it would fail when it validated the WSDL but, again, this doesn't have any impact at runtime since it only impacts code gen.

The other impact name has for most code gen situations is the name of the generated code types. So if you rename a resource it might impact the generated name as well but, again, no impact at runtime, just code generation. For the most part the only thing that matters at runtime is the namespaces, actions, endpoints and data structure that is defined in the WSDL.

Are you having a specific problem or are you just surprised it didn't break anything? Did you regenerate the code after changing the WSDL? If not then I wouldn't expect anything to change as the WSDL isn't needed at runtime.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

i Thanks for your reply, you meant to say, renaming the PortType and binding name doesn't impact anything at runtime. I wonder how this is not giving any exception

0 Votes 0 ·

The WSDL isn't used at runtime so why would it. Did you generate a service reference into your project code? If so did you update the service reference after changing the WSDL? That is the only time the WSDL will be used. You can delete the WSDL, in fact, and it wouldn't change anything on the client side. WSDLs simply act as a contract for generating a language-specific client in .NET.

0 Votes 0 ·