Thanks. That worked!
Jitendra Kotamraju wrote:
> mark_at_javector.com wrote:
>
>> I'm getting a MalformedURLException when I try to publish an Endpoint
>> after
>> setting its metadata. This does not happen if I don't set the metadata.
>>
>> I am running Mustang binary distribution from Feb 9th.
>>
>> I have a hunch that this is happening because I have not set the
>> systemId
>> property on the metadata Source. But, I don't have a clue how to do
>> that. The
>> metadata is a WSDL file inside the JAR (I am running this as a main
>> class inside
>> a JAR).
>>
>> Here is code:
>>
>> Endpoint endpoint = Endpoint.create(new RequestOrder());
>> InputStream wsdlStream =
>>
>> Client.class.getClassLoader().getResourceAsStream("RequestOrder.wsdl");
>> if ( wsdlStream == null ) {
>>
>> throw new RuntimeException("Cannont find WSDL resouce file.");
>> }
>> ArrayList<Source> metadata = new ArrayList<Source>();
>> metadata.add(new StreamSource(wsdlStream));
>>
>>
> The Source objects should have correct system id
> StreamSource source = new StreamSource(wsdlStream);
> source.setSystemId(Client.class.getClassLoader().getResource("RequestOrder.wsdl").toExternalForm())
>
>
> Let us know if this works.
>
> Jitu
>
>
>> endpoint.setMetadata(metadata);
>> endpoint.publish("http://localhost:8680/oms");
>>
>> Here is error trace:
>>
>> [java] Exception in thread "main" Server Runtime Error:
>> java.net.MalformedURLException
>> [java] at
>> com.sun.xml.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:185)
>>
>> [java] at
>> com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:65)
>>
>> [java] at samples.Client.main(Client.java:39)
>> [java] Caused by: java.net.MalformedURLException
>> [java] at java.net.URL.<init>(URL.java:601)
>> [java] at java.net.URL.<init>(URL.java:464)
>> [java] at java.net.URL.<init>(URL.java:413)
>> [java] at
>> com.sun.xml.ws.transport.http.server.HttpEndpoint.setDocInfo(HttpEndpoint.java:109)
>>
>> [java] at
>> com.sun.xml.ws.transport.http.server.HttpEndpoint.fillEndpointInfo(HttpEndpoint.java:155)
>>
>> [java] at
>> com.sun.xml.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:220)
>>
>> [java] at
>> com.sun.xml.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:179)
>>
>> [java] ... 2 more
>> [java] [ERROR] Java Result: 1
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>