Example of using Static wsdl in a .net web service

Discussion in 'ASP .Net Web Services' started by Geir Forsmo, Feb 27, 2008.

  1. Geir Forsmo

    Geir Forsmo Guest

    Hi!

    I am trying to create a web service from a wsdl from a external part.
    The external part is running as a client, but forces us to use their
    wsdl specification because they are communicating against several
    other parts which also must follow their wsdl contract. Now we are the
    only one that is implementing our web service in .net. The other ones
    have implemented their web service on the bea weblogic platform (java)
    and therefore has an easier integration.

    Some have told me to use the original wdsl as a static wsdl to my web
    service and in this way could be the client call my web service. If
    some of you have done this or have some experience with static wsdl
    please let me know. I won't really like to see an asp.net web service
    example that uses a static wsdl.

    Hope you can help me with this.

    regards

    Geir F
    Geir Forsmo, Feb 27, 2008
    #1
    1. Advertising

  2. "Geir Forsmo" <> wrote in message
    news:...
    > Hi!
    >
    > I am trying to create a web service from a wsdl from a external part.
    > The external part is running as a client, but forces us to use their
    > wsdl specification because they are communicating against several
    > other parts which also must follow their wsdl contract. Now we are the
    > only one that is implementing our web service in .net. The other ones
    > have implemented their web service on the bea weblogic platform (java)
    > and therefore has an easier integration.
    >
    > Some have told me to use the original wdsl as a static wsdl to my web
    > service and in this way could be the client call my web service.


    I think that those you have spoken to are talking about the WSDL used when
    the client navigates to your .ASMX file with ?WSDL at the end. If you need
    to adhere to a specific WSDL, and not to the WSDL that ASP.NET generates for
    you, then you don't want the ?WSDL to work at all. Simply remove the
    Documentation protocol:

    <system.web>
    <webServices>
    <protocols>
    <remove name="Documentation"></remove>
    </protocols>
    </webServices>
    </system.web>

    Since the customer already knows the WSDL, there's no need to serve it up to
    them!
    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
    John Saunders [MVP], Feb 28, 2008
    #2
    1. Advertising

  3. Geir Forsmo

    Geir Forsmo Guest

    On 28 Feb, 01:10, "John Saunders [MVP]" <john.saunders at
    trizetto.com> wrote:
    > "Geir Forsmo" <> wrote in message
    >
    > news:...
    >
    > > Hi!

    >
    > > I am trying to create a web service from a wsdl from a external part.
    > > The external part is running as a client, but forces us to use their
    > > wsdl specification because they are communicating against several
    > > other parts which also must follow their wsdl contract. Now we are the
    > > only one that is implementing our web service in .net. The other ones
    > > have implemented their web service on the bea weblogic platform (java)
    > > and therefore has an easier integration.

    >
    > > Some have told me to use the original wdsl as a static wsdl to my web
    > > service and in this way could be the client call my web service.

    >
    > I think that those you have spoken to are talking about the WSDL used when
    > the client navigates to your .ASMX file with ?WSDL at the end. If you need
    > to adhere to a specific WSDL, and not to the WSDL that ASP.NET generates for
    > you, then you don't want the ?WSDL to work at all. Simply remove the
    > Documentation protocol:
    >
    > <system.web>
    > <webServices>
    > <protocols>
    > <remove name="Documentation"></remove>
    > </protocols>
    > </webServices>
    > </system.web>
    >
    > Since the customer already knows the WSDL, there's no need to serve it up to
    > them!
    > --
    > --------------------------------------------------------------------------------
    > John Saunders | MVP - Windows Server System - Connected System Developer


    Thanks for responding. What would happen then? The external part (the
    client) is running a java client written in BEA Weblogic. And in their
    code they have to put in the wsdl to my web service as an url. Below
    you see their code

    String value = null;
    OutboundLegacyDataReceiverService outboundLegacyDataReceiverService =
    new OutboundLegacyDataReceiverService_Impl(wsdl);
    OutboundLegacyDataReceiver outboundLegacyDataReceiver =
    outboundLegacyDataReceiverService.getOutboundLegacyDataReceiverSoapPort();
    ((Stub)
    outboundLegacyDataReceiver)._setProperty("weblogic.wsee.transport.connection.timeout",
    10000);
    value = outboundLegacyDataReceiver.submitMessage(user, password,
    soapmessage);

    If I change web.config the way you suggest here, will they still could
    put in the url: http://......asmx?wsdl

    regards

    geir F
    Geir Forsmo, Feb 28, 2008
    #3
  4. "Geir Forsmo" <> wrote in message
    news:...
    > Thanks for responding. What would happen then? The external part (the
    > client) is running a java client written in BEA Weblogic. And in their
    > code they have to put in the wsdl to my web service as an url. Below
    > you see their code
    >
    > String value = null;
    > OutboundLegacyDataReceiverService outboundLegacyDataReceiverService =
    > new OutboundLegacyDataReceiverService_Impl(wsdl);
    > OutboundLegacyDataReceiver outboundLegacyDataReceiver =
    > outboundLegacyDataReceiverService.getOutboundLegacyDataReceiverSoapPort();
    > ((Stub)
    > outboundLegacyDataReceiver)._setProperty("weblogic.wsee.transport.connection.timeout",
    > 10000);
    > value = outboundLegacyDataReceiver.submitMessage(user, password,
    > soapmessage);
    >
    > If I change web.config the way you suggest here, will they still could
    > put in the url: http://......asmx?wsdl
    >


    I don't understand why their code is referring to a WSDL at all, especially
    since you say it is their WSDL that you are adhering to.

    If they really need to do it, then you should put your (their) WSDL up on
    your web site and simply serve it up as a file. For instance, if your
    service is at http://server.com/services/myService.asmx, then put the WSDL
    at http://server.com/services/myService.WSDL.
    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
    John Saunders [MVP], Feb 28, 2008
    #4
  5. Geir Forsmo

    Guest

    On 28 Feb, 20:31, "John Saunders [MVP]" <john.saunders at
    trizetto.com> wrote:
    > "Geir Forsmo" <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    > > Thanks for responding. What would happen then? The external part (the
    > > client) is running a java client written in BEA Weblogic. And in their
    > > code they have to put in the wsdl to my web service as an url. Below
    > > you see their code

    >
    > > String value = null;
    > > OutboundLegacyDataReceiverService outboundLegacyDataReceiverService =
    > > new OutboundLegacyDataReceiverService_Impl(wsdl);
    > > OutboundLegacyDataReceiver outboundLegacyDataReceiver =
    > > outboundLegacyDataReceiverService.getOutboundLegacyDataReceiverSoapPort();
    > > ((Stub)
    > > outboundLegacyDataReceiver)._setProperty("weblogic.wsee.transport.connectio-n.timeout",
    > > 10000);
    > > value = outboundLegacyDataReceiver.submitMessage(user, password,
    > > soapmessage);

    >
    > > If I change web.config the way you suggest here, will they still could
    > > put in the url:http://......asmx?wsdl

    >
    > I don't understand why their code is referring to a WSDL at all, especially
    > since you say it is their WSDL that you are adhering to.
    >
    > If they really need to do it, then you should put your (their) WSDL up on
    > your web site and simply serve it up as a file. For instance, if your
    > service is athttp://server.com/services/myService.asmx, then put the WSDL
    > athttp://server.com/services/myService.WSDL.
    > --
    > ---------------------------------------------------------------------------------
    > John Saunders | MVP - Windows Server System - Connected System Developer- Skjul sitert tekst -
    >
    > - Vis sitert tekst -


    OK. I may have been unclear about this. Our external part is a bigger
    national state register in Norway and they have developed a contract
    to their communicating parties which delivers services to them in form
    of web services. They don't want to change their contract interface
    when new parties are added. Therefore they just add the url in form of
    a "http:/...asmx?wsdl" in a record in a database table. We, which must
    serve the contract, a web service with one method, 3 string arguments,
    returns a string, and we must use a specific target namespace and
    service name. I have tried to follow these rules but it won't work.
    the client program (java) complains about port name and binding in the
    service name tag, which I have not found how to change. These
    attributes are generated when compiling the web services.

    I could send you the wsdl file so you can take a look at it. I have
    tried using the wsdl.exe program and the wscf program from
    thinktecture, but that generated a web service that was not good. Now
    I have no clue to solve this. I though I could fake the web service in
    a way, but I havenot found out how.

    Any suggestion

    regards

    Geir F
    , Feb 28, 2008
    #5
  6. <> wrote in message
    news:...
    > OK. I may have been unclear about this. Our external part is a bigger
    > national state register in Norway and they have developed a contract
    > to their communicating parties which delivers services to them in form
    > of web services. They don't want to change their contract interface
    > when new parties are added. Therefore they just add the url in form of
    > a "http:/...asmx?wsdl" in a record in a database table.


    Couldn't they put http://server/Service.wsdl in their table instead? If
    they're doing this generically, then they must be prepared to deal with
    non-.NET servers, meaning they can't reply on .asmx meaning something. I bet
    their system stores the entire URL to the WSDL. So, have them insert the URL
    to the actual WSDL.

    Then, the only question is, does your service actually act as though it
    implemented the WSDL correctly?

    An alternate way to look at the problem may be to assume that you _are_
    doing something wrong. Maybe .NET is actually creating the WSDL correctly,
    based on how you wrote your service. So, maybe you wrote the service
    incorrectly.

    Can you simplify this to the point where you can send me the WSDL and a
    trivial version of the web service code? By trivial, I mean, no
    implementation at all; just the [WebService] class and the [WebMethod]
    methods, and any additionally classes necessary to make the code compile.
    Then, e-mail me the resulting project (you can guess the e-mail address),
    and I'll try to take a quick look at it. Note that I don't have much time
    for this sort of thing right now, so you'll have a better chance of me
    looking at it if you take the time to simplify the code so that I can try to
    find the answer quickly, in my "copious spare time".

    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
    John Saunders [MVP], Mar 1, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dark
    Replies:
    1
    Views:
    4,625
    milfar
    Nov 14, 2008
  2. mit-hp
    Replies:
    0
    Views:
    2,576
    mit-hp
    Feb 15, 2007
  3. Bert Leu
    Replies:
    1
    Views:
    458
    Cowboy \(Gregory A. Beamer\)
    Nov 23, 2007
  4. Bert Leu

    Creating a Web Service (Service, not Client) from WSDL

    Bert Leu, Nov 23, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    272
    Cowboy \(Gregory A. Beamer\)
    Nov 23, 2007
  5. Replies:
    3
    Views:
    481
    John Saunders
    Oct 7, 2008
Loading...

Share This Page