Example of using Static wsdl in a .net web service

G

Geir Forsmo

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
 
J

John Saunders [MVP]

Geir Forsmo said:
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!
 
G

Geir Forsmo

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!

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
 
J

John Saunders [MVP]

Geir Forsmo said:
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.
 
G

g-forsmo

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.
--

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
 
J

John Saunders [MVP]

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".
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top