views:

446

answers:

1

I've been tasked when integrating a web form into Oracle CRM on Demand (Siebel) using web services. I've been given the WSDL, and some high level documentation from Oracle.

Well, I knew I was in trouble when I tried to add the WSDL as Web Reference and I was asked to enter an URL. I have the WSDL file in the root of the project, but I have no idea how to link to it.

So, I guess that means I need to learn up on web services using C# and Visual Studio. I have a Safari Books Online account, so I can look up most anything.

It's been a while, but I'm OK at the form part. I just need help connecting and using the web service.

Edit #1: Ok, to clarify my question: I am well aware on how to use web services in general. My specific question is how take this WSDL file and do something with it. If the WSDL was hosted somewhere else, I could just add it as a Web Reference. But, I have the file in the project itself and that is what I am having problems with.

A: 

The web reference asks for a URL but you can point it to a local file. Just paste the local file path of your WSDL in and it should work.

Further Clarification of Web Reference URL vs URL to access Web Service

  1. Web Reference URL is used to generate and update wrapper classes for WSDL/Web Service. It is not the URL used at runtime to access Web Service.
  2. URL property on generated wrapper classes is used to access actual web service at runtime.

Update: It should add a path in the web.config or app.config/settings file (Depending on your project type) similiar to the following:

<setting name="Namespace_WebReferenceName" serializeAs="String">
        <value>XXX</value>
</setting>

Which should map to a URL property in the generated web reference wrapper classes. You can modify the URL property programmatically to point wherever you want:

Dim shipService As ShipService = New ShipService() 'Initialize the service - where ShipService is the Generated WebReference Wrapper CLass
shipService.Url = ConfigurationSettings.AppSettings("FedExOnlineURL")
Rick Hochstetler
Ok, I was able to do that, but I assuming there's a better, portable way of doing this. As soon as I deploy the app it would break as the file path will change.
Nick
Rick Hochstetler
The WebReference path to the WSDL file really has no bearing when you deploy the app... it's only used when you update or generate the wrapper classes for the WSDL/WebService.
Rick Hochstetler
I have added Web References to WSDL files locally for FedEx, UPS, SAP, etc.. and then set the actual URL as described above at runtime. In some cases you won't have a WSDL file hosted alongside the Web Service and will need to add a Web Reference to the local WSDL file.
Rick Hochstetler