Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2008

Tip: Looking for answers? Try searching our database.

Example of using Static wsdl in a .net web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geir Forsmo - 27 Feb 2008 14:57 GMT
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
John Saunders [MVP] - 28 Feb 2008 00:10 GMT
> Hi!
>
[quoted text clipped - 8 lines]
> 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!
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Geir Forsmo - 28 Feb 2008 14:49 GMT
On 28 Feb, 01:10, "John Saunders [MVP]" <john.saunders at
trizetto.com> wrote:

> > Hi!
>
[quoted text clipped - 28 lines]
> --------------------------------------------------------------------------------
> 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
John Saunders [MVP] - 28 Feb 2008 19:31 GMT
> Thanks for responding. What would happen then? The external part (the
> client) is running a java client written in BEA Weblogic. And in their
[quoted text clipped - 14 lines]
> 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.
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

g-forsmo@hotmail.com - 28 Feb 2008 23:16 GMT
> > Thanks for responding. What would happen then? The external part (the
> > client) is running a java client written in BEA Weblogic. And in their
[quoted text clipped - 27 lines]
>
> - 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
John Saunders [MVP] - 01 Mar 2008 18:51 GMT
> 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".

Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.