Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Example of using Static wsdl in a .net web service

Reply
Thread Tools

Example of using Static wsdl in a .net web service

 
 
Geir Forsmo
Guest
Posts: n/a
 
      02-27-2008
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
 
Reply With Quote
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      02-28-2008
"Geir Forsmo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Geir Forsmo
Guest
Posts: n/a
 
      02-28-2008
On 28 Feb, 01:10, "John Saunders [MVP]" <john.saunders at
trizetto.com> wrote:
> "Geir Forsmo" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
> > 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.getOutboundLegac yDataReceiverSoapPort();
((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
 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      02-28-2008
"Geir Forsmo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.getOutboundLegac yDataReceiverSoapPort();
> ((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


 
Reply With Quote
 
g-forsmo@hotmail.com
Guest
Posts: n/a
 
      02-28-2008
On 28 Feb, 20:31, "John Saunders [MVP]" <john.saunders at
trizetto.com> wrote:
> "Geir Forsmo" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
>
>
> > 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.getOutboundLegac yDataReceiverSoapPort();
> > ((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
 
Reply With Quote
 
John Saunders [MVP]
Guest
Posts: n/a
 
      03-01-2008
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turn off Auto Generated WSDL, so I can use my static custom wsdl casucci@gmail.com ASP .Net Web Services 3 10-07-2008 06:38 PM
Creating a Web Service (Service, not Client) from WSDL Bert Leu ASP .Net 1 11-23-2007 08:29 PM
Creating a Web Service (Service, not Client) from WSDL Bert Leu ASP .Net Web Services 1 11-23-2007 07:59 PM
Generate web service from WSDL using JDeveloper mit-hp XML 0 02-15-2007 07:23 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM



Advertisments