views:

242

answers:

2

Friends,

Hope you can help with a problem I am encountering with Apex and Web Services.

I have used the wizard within Apex to to create a web service reference. The webservice works as expected however...

One of the wizard steps requires the location of the wsdl file, which for development is at location a.

However when application is moved to QA, the wsdl will be at location b, and when this goes into production it will be at various different locations dependent on customer requirments.

I exported the application and looking at the resultant sql file, I can see wsdl reference is there, but I would rather not have to keep amending this file as it could become error prone or easily forgotten during the installation process.

Are there any other options that I have to amend the wsdl location? as it now appears the development location is hard coded into the application!

I have searched the Apex OTN Forums and found this question has been asked here and here but there have been no responses.

In case of need I am using Apex 3.2.1 & Oracle 10.2.0.3

Thanks in advance.

+1  A: 

I don't know if this will work for a WSDL location, but have you tried setting up an application item e.g. WSDL_LOCATION and then setting the WSDL location to '&WSDL_LOCATION.'? You could then select a value into the application item from a table via an application process that runs on new session. However, that wil only work if Apex does variable substitution when accessing the WSDL location.

Tony Andrews
Thanks for the prompt response Tony. I thought that wwas a superb idea, but unfortunately it doesn't work. On invoking the webservice I see the error...ORA-20001: The webservice was unreachable because either the etc... (If I amend the WS and put in the hard coded value, then it works as expected)
carpenteri
That's a pity. It works for some things, such as paths to Javascript libraries in templates, so I just hoped it might work for your WSDL location too!
Tony Andrews
It is, it would have been an ideal solution, but really appreciate your input.
carpenteri
+1  A: 

I don't have SYS access to my instance right now, but in Apex I see that web services are described by the APEX_APPLICATION_WEB_SERVICES view, which queries WWV_FLOW_SHARED_WEB_SERVICES.

You will want to test this carefully in a non-production Apex instance, but you might be able to get away with updating the URL column of this table directly.

I can't test this right now, and there are no guarantees this unsupported method won't mess something up.

Jeffrey Kemp
Thanks for the response Jeffrey - That looks a very promising lead, I'm off to give it try and will let you know how I get on.
carpenteri
The rudimentary testing I performed shows this works.(webservice working --> update url to foo --> webservice stops working --> update back to correct address --> webservice working) I will need to perform more robust testing but the first impressions are good. I understand that updating the apex tables is not supported but it is a big step up from editing the export file.Thanks again for your help.
carpenteri
I was thinking about this last night and my main fear about this approach is that we don't know how Oracle uses the value - e.g. it might be denormalised internally - copied to one or more other tables - and we wouldn't know. More likely, with a patch or version change the structure will later change in some way which breaks this approach.
Jeffrey Kemp
Also, I would suggest you test it by changing the url to a known working webservice, then test that it actually calls the new URL correctly.
Jeffrey Kemp
Thanks for the futher thoughts on this Jeffrey. This option will need further testing as you say and thanks for the idea on testing against another web service, I will add it to my suite of tests. If had several options then going down the route of updating the apex tables directly would be leave me feeling uneasy (especially after reading Scott Spendolini's Blog post on the subject) but as it appears to be my only viable option at this time I'm willing to try it out.
carpenteri