On Mon, Mar 14, 2011 at 1:20 PM, Nikolaus Krismer <[email protected]> wrote:
> Using a SchemaSupplier works great to deliver the xsd files.
>
> However, i noticed that although i am using the parameter "useOriginalwsdl" = 
> "true" (i set that in the services.xml file), the wsdl gets modified. in the 
> <xsd:include> tag the (to include some xsd files) the serviceName is used as 
> a prefix for the schemaInclude (f.e. i use a schemaLocation="faults.xsd" 
> which is turned to schemaLocation="v1_MyServicce?xsd=faults.xsd")
>
> Is there a way to prevent the serviceName to be used as a prefix (or at least 
> to modify it?). I'd need schemaLocation=MyService?xsd=faults.xsd" and not 
> schemaLocation="v1_MyServicce?xsd=faults.xsd".

AFAIK, there is no way to disable the automatic modification of the
schemaLocation in the supplied schemas using standard Axis2 binaries.

Sanka

>
> Regards,
> Niko
>
> ----- Original Message -----
> From: [email protected]
> To: [email protected]
> Date: 10.03.2011 16:41:39
> Subject: Re: Re: Deploy service programatically - howto use custom wsdl?
>
>
>> You can implement an instance of
>> org.apache.axis2.dataretrieval.SchemaSupplier and set it a parameter
>> in the AxisService object.
>>
>> SchemaSupplier supplier = new SchemaSupplierImpl()..
>> service.addParameter("SchemaSupplier", supplier);
>>
>>
>> You can implement the SchemaSupplierImpl such that it returns all the
>> relevant schema from the associated javax.wsdl.Definition instance.
>> For example,
>>
>>  XmlSchema getSchema(AxisService service, String xsd) throws AxisFault {
>>  Definition def = (Definition)
>> service.getParameter(org.apache.axis2.wsdl.WSDLConstants.WSDL_4_J_DEFINITION).getValue();
>>  if (def != null) {
>>      XmlSchema xmlSchema = .. (construct an XmlSchema instance using
>> schems accessible via def instance)
>>     return xmlSchema;
>>  }
>>
>>
>> HTH
>>
>> Sanka
>>
>> On Thu, Mar 10, 2011 at 4:13 PM, Nikolaus Krismer <[email protected]> wrote:
>> > This works great.
>> > However, when using a xsd:include in the wsdl (to import types from an 
>> > external xsd file) the xsd file can not be retrieved using ?xsd. Is there 
>> > another option that can be set to solve this issue?
>> >
>> > By now i use the following to generate the Wsdl-Definition object:
>> >
>> >        try {
>> >                final WSDLFactory factory = WSDLFactory.newInstance();
>> >                final WSDLReader reader = factory.newWSDLReader();
>> >                reader.setFeature("javax.wsdl.verbose", false);
>> >                reader.setFeature("javax.wsdl.importDocuments", true);
>> >                final Definition def = 
>> > reader.readWSDL(null,"MyService.wsdl");
>> >                
>> > service.addParameter(org.apache.axis2.wsdl.WSDLConstants.WSDL_4_J_DEFINITION,
>> >  def);
>> >        } catch (final WSDLException e) {
>> >                logger.warn("Exception occured. There will be no wsdl file 
>> > available for this webservice.");
>> >        }
>> >
>> > Regards,
>> > Niko
>> >
>> >
>> > ----- Original Message -----
>> > From: [email protected]
>> > To: [email protected]
>> > Date: 10.03.2011 12:06:46
>> > Subject: Re: Deploy service programatically - howto use custom wsdl?
>> >
>> >
>> >> Add the following code after service deployment and then try ?wsdl
>> >>
>> >> AxisConfiguration axisConfig = context.getAxisConfiguration();
>> >> AxisService service = axisConfig.getService("service-name");
>> >> ..
>> >> javax.wsdl.Definition definition = <definition of your custom wsdl>;
>> >> ..
>> >>
>> >> service.addParameter(org.apache.axis2.wsdl.WSDLConstants.WSDL_4_J_DEFINITION,
>> >> definition);
>> >> service.addParameter("useOriginalwsdl", "true");
>> >>
>> >>
>> >> HTH
>> >>
>> >> Sanka
>> >>
>> >>
>> >> On Thu, Mar 10, 2011 at 10:28 AM, Nikolaus Krismer <[email protected]> 
>> >> wrote:
>> >> > Hi!
>> >> >
>> >> > are there best practices on how to deploy services programatically?
>> >> > I tried different approaches, but i can't figure out how to deploy my 
>> >> > own wsdl file (so it can be retrived by ?wsdl in the web browser) when 
>> >> > deploying programatically.
>> >> >
>> >> > Here are some of my tries:
>> >> >  1.) DeploymentEngine.buildService(new FileInputStream(serviceXmlFile), 
>> >> > context);
>> >> >  2.) Build an aar file in code (using ZipOutputStream) and pass the 
>> >> > generated zip to:
>> >> >        
>> >> > axisConfig.addServiceGroup(DeploymentEngine.loadServiceGroup(aarZipFile,
>> >> >  context))
>> >> >  3.) Using DeploymentFileData.deploy (also using a generated aar zip 
>> >> > file, which is generated in code)
>> >> >
>> >> > All of these approches seem to work (personally i prefer #1), but i 
>> >> > can't get my original wsdl file (which for #2 and #3 is included in the 
>> >> > generated aar file) to be used when calling my service in a webbrowser 
>> >> > using ?wsdl. However, i can deliver my custom wsdl files when deploying 
>> >> > aar files to the service directory before starting up axis, but since i 
>> >> > want to simplify the build of the application i would prefer to deploy 
>> >> > services at runtime when starting the application, and not at buildtime.
>> >> >
>> >> > Is there a way to deliver a custom wsdl file when deploying services 
>> >> > programatically?
>> >> >
>> >> > Regards,
>> >> > Niko
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [email protected]
>> >> > For additional commands, e-mail: [email protected]
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Sanka Samaranayake
>> >>
>> >> PMC Member, Committer, Apache Software Foundation, http://www.apache.org/
>> >>
>> >> Telephone: +34 677 864358
>> >> Email: sanka AT apache DOT org
>> >> Blog: http://sankas.blogspot.com/
>> >> Linked-in: http://lk.linkedin.com/pub/sanka-samaranayake/4/b2b/3b3
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [email protected]
>> >> For additional commands, e-mail: [email protected]
>> >>
>> >
>> >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [email protected]
>> > For additional commands, e-mail: [email protected]
>> >
>> >
>>
>>
>>
>> --
>> Sanka Samaranayake
>>
>> PMC Member, Committer, Apache Software Foundation, http://www.apache.org/
>>
>> Telephone: +34 677 864358
>> Email: sanka AT apache DOT org
>> Blog: http://sankas.blogspot.com/
>> Linked-in: http://lk.linkedin.com/pub/sanka-samaranayake/4/b2b/3b3
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Sanka Samaranayake

PMC Member, Committer, Apache Software Foundation, http://www.apache.org/

Telephone: +34 677 864358
Email: sanka AT apache DOT org
Blog: http://sankas.blogspot.com/
Linked-in: http://lk.linkedin.com/pub/sanka-samaranayake/4/b2b/3b3

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to