<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
jar local wsdl access
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/gryffin">aodhan hoffman</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/550465#550465">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Morning friends. I've been fighting and hacking at trying to implement a web service client to read a local wsdl at runtime but it no matter how I try it, the I cannot seem to get a runtime defined WSDL location working. The wsdl is good, it compiles fine, and I can verify the path I'm giving it.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The primary challenge is that I cannot hardcode the final wsdl location into the web service because the remote web service and its WSDL are password protected. Since I cannot provide credentials at the time the service stub instantiates ( maybe there's a way, I don't know how ) I am trying to tell the service class to use a local wsdl within the deployed war, but this isn't working. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>By comparison, I can access a local WSDL just fine when accessing the service within Eclipse using a static class with main().</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The specific error JBoss gives me is:</p><p><span style="font-family: courier new,courier;"><br/></span></p><p><span style="font-size: 8pt; font-family: courier new,courier; ">2010-06-30 13:04:22,890 DEBUG [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) URL proto: vfszip<br/>2010-06-30 13:04:22,890 DEBUG [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) <br/>---URL PATH: [/C:/jboss-5.1.0.GA/server/default/deploy/NetworkLocationService-STL4.war/WEB-INF/wsdl/AssetAPIService.wsdl]<br/>2010-06-30 13:04:22,890 DEBUG [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) #*#<br/>2010-06-30 13:04:22,890 DEBUG [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) assetApiService = new AssetAPIService( erl )<br/>2010-06-30 13:04:23,108 WARN  [org.jboss.util.xml.JBossEntityResolver] (http-127.0.0.1-8080-8)<strong> Trying to resolve systemId as a non-file URL:</strong><span> </span><a class="jive-link-external-small" href="http://location.api.mobileview.aeroscout.com" target="_blank">http://location.api.mobileview.aeroscout.com</a><br/>2010-06-30 13:04:23,124 WARN  [org.jboss.ws.core.utils.JBossWSEntityResolver] (http-127.0.0.1-8080-8) <strong>Trying to resolve id as a non-file URL:</strong><span> </span><a class="jive-link-external-small" href="http://location.api.mobileview.aeroscout.com" target="_blank">http://location.api.mobileview.aeroscout.com</a><br/>2010-06-30 13:04:23,124 ERROR [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) #-!!!-# <br/>2010-06-30 13:04:23,124 ERROR [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) Exception: null<br/>2010-06-30 13:04:23,124 ERROR [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.getXMLInputSource(JBossXSEntityResolver.java:170)<br/>2010-06-30 13:04:23,124 ERROR [com.boeing.ntpm.nls.api.ws.AssociationGet] (http-127.0.0.1-8080-8) org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.resolveEntity(JBossXSEntityResolver.java:136)</span><span style="font-size: 8pt; font-family: courier new,courier; "><br/>...</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The file path is entirely accurate, the file object says it doesn't exist I presume because it could not read the zipped WSDL. The protocol value for the URL object created by the returned file object is 'vfszip'. I see that the URL adds a parent '/' to it's own path, but I don't know if that's a problem or how to prevent it.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I don't know why the JBossEntityResolver is attempting to resolve a namespace as a URL and I can't tell where it's occuring.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here's the representative code that leads to the error:</p><p><span style="font-size: 8pt; font-family: courier new,courier; ">        ...<br/></span></p><p><span style="font-size: 8pt; font-family: courier new,courier; ">            erl = AssociationGet.class.getClassLoader().getResource("./../wsdl/AssetAPIService.wsdl");<br/>          <br/>            if ( null == erl ) { log.debug( "URL is NULL!!!" ); }<br/>            log.debug( "URL proto: " + erl.getProtocol());<br/>            log.debug( "\n---URL PATH: [" + erl.getPath() + "]" );<br/>            log.debug( "#*#" );<br/>        }<br/>        catch (Exception e)<br/>        {<br/>            log.error( "#!!!# ");<br/>            log.error( "Exception: " + e.getMessage() );<br/>            log.error( e.getStackTrace()[0] );<br/>            log.error( e.getStackTrace()[1] );<br/>            log.error( e.getStackTrace()[2] );<br/>            log.error( e.getStackTrace()[3] );<br/>            log.error( "#!!!#" );<br/>            throw new Exception("WSDL not found");<br/>        }</span></p><p><span style="font-size: 8pt; font-family: courier new,courier; "><br/>        AssetAPIService assetApiService = null;<br/></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: courier new,courier;"><span style="font-size: 8pt;">       </span><span style="font-size: 8pt;"> try<br/>        {<br/>            log.debug( "assetApiService = new AssetAPIService( erl )" );<br/>            assetApiService = new AssetAPIService( erl );</span></span></p><p><span style="font-size: 8pt; font-family: courier new,courier; ">        ...<br/></span></p><p><span style="font-size: 8pt;"><br/></span></p><p><span style="font-size: 10pt; ">Here's the code for AssetAPIService( URL url ):</span></p><p><span style="font-size: 10pt; "><br/></span></p><p><span style="font-size: 8pt; font-family: courier new,courier; ">public AssetAPIService(URL wsdlLocation) {<br/>        super(<br/>                wsdlLocation, <br/><span>                new QName("</span><a class="jive-link-external-small" href="http://service.api.mobileview.aeroscout.com" target="_blank">http://service.api.mobileview.aeroscout.com</a><span>",  "AssetAPIService"));</span><br/>    }</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>So from the wsdl location "./../wsdl/AssetAPIService.wsdl" and a valid QName that says nothing of 'location', I'm getting an error about "Trying to resolve systemId as a non-file URL: </span><a class="jive-link-external-small" href="http://location.api.mobileview.aeroscout.com" target="_blank">http://location.api.mobileview.aeroscout.com</a><span>".</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Does anyone have any pointers on what I might be doing wrong, or any examples they can point to about how to refer to a local wsdl within a deployed war file at runtime? Thanks!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 8pt; font-family: courier new,courier; "><br/></span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/550465#550465">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>