Validate XML instance document against WSDL - validation

I can easily validate a XML document against a XML Schema, eg. with XMLSpy or programmatically.
Is it possible to do this with a WSDL file? It does not seem possible with XMLSpy or any other XML tool I know. For me the only possibility right now is to do it programmatically, eg. by generating Java code from the WSDL and starting a request, which is then marshalled correctly.
If there is no tool / easy programmatic approach, is there a tool which can extract XML Schema from the WSDL?
Best

You could use SoapUI :
Create new project (you'll need to provide wsdl)
Double click on the "request" of your new project
Modify XML if needed
Right click -> validate

QTAssistant (I am associated with it) provides an easy to use utility to extract XSDs from any-style WSDL (single or multiple file, internalized or externalized XSDs).
The prompt is pretty straightforward to follow, and provides a lot of flexibility in referencing offline WSDLs (local disk) or remote (HTTP/S).
Another feature that works well with the above set is the ability to validate a SOAP envelope against an XSD, also available within QTAssistant; there's a property Strip SOAP for an XML document that'll automatically validate SOAP Body content against assign XSD.

Related

How can I create documentation with all properties which can be overridden in `yaml` file of my spring boot application?

Can I generate documentation from spring-configuration-metadata.json file?
I have autogenerated file spring-configuration-metadata.json with properties. It's useful for autocomplete in IDE. But I wont to give documentation to administrators. I can give them JSON file, but maybe there is something which can convert JSON to HTML or something else?
I just want to create full list properties which can be overridden in yaml file and pass it to somebody who deploys an application.

How to get localized values of OSGi bundle headers without a Bundle object

If I have an org.osgi.framework.Bundle object, I can ask for its localized headers (like Bundle-Name) using Bundle.getHeaders(<locale>).
But does there exist a similar facility that I can use to get the values oflocalized headers (taking the Bundle-Localization header into account, if present) when I just have a File, JarFile, or Manifest object? Or do I have to implement the whole lookup procedure myself (as outlined in the OSGi spec)?
That support is built into the OSGi framework. So if you are not asking the framework for the localized headers of a bundle, you will need to implement the specified rules yourself.

Why is a SoapActionCallBack sometimes necessairy?

I'm working on a webservice client using Spring-WS. It's not my first webservice project, using Spring-WS. But I am new in this particular project.
We generate dao-objects by using the maven-jaxb2-plugin.
I'm using Spring-WS WebServiceTemplate, with a standard marshaller and unmarshaller set.
In a previous project, I could just do my webservice calls using:
webserviceTemplate.marshallSendAndReceive(new ObjectFactory().createSomeRequest());
In my current project, I need to provide a SoapActionCallback, provided with the SoapActionUrl.
webserviceTemplate.marshallSendAndReceive(new ObjectFactory().createSomeRequest, new SoapActionCallback("http://some-action-url.com/action"));
If I do not provide this SoapActionUrl, I don't get a result, and when debugging, I see a surpressed exception:
Couldn't get a SAX parser while constructing a envelope
I'd like to remove those SoapActionUrls. Using the correct generated objects by maven-jaxb2-plugin, should automatically refer to the correct actionurl?
I've googled this, but did not find too much info about it.
I'd like to know why I just could 'leave the SoapActionCallback' in the first case, and in the second case, I'm obligated to provide this.
I'm not aware of specific technology used on the server-side, as the webservices are developed by an external partner.
Can someone explain this?

Best way to get Spring Bean info from context WIHOUT creating app context?

I have a Spring (3.1.) app that has a large app-context.xml file. There is a second very small stand-alone application that needs just a few parameters from one of the beans that are configured in that xml file.
Rather than that little application instantiating the whole application context (which builds a lot of connections, etc), I just want to read in the couple of configuration parameters that are contained in that file.
I could of course create a new smaller small-app-context.xml that only has the configuration i need or put those parameters in a properties file, but then I need to maintain that information in two places, which I am trying to avoid. I know I could read in and parse the raw XML file (not exactly sure the most efficient way to do that). However, I was hoping that Spring provides a nice way to do this but I haven't found it.
Does Spring provide a clean way to do this?
Thanks.
In Spring you can have multiple configuration files. So for the part that you would like to reuse you would create a smaller, self-contained config file. It can remain in the original project and your app-context.xml can include it. Then your new, small project could include the small config xml and you wouldn't need to maintain the information in two locations.
I could of course create a new smaller small-app-context.xml that only has the configuration i need or put those parameters in a properties file
I would agree that configuration belongs in a properties file. Not the application context file. You should not be maintaining the configuration in two places. You should have the configuration once in your properties file and then make that available to any contexts which require it.

SOAP UI: Can I add assertion to validate with local XML Schema file?

I have created a Web Service (with Java, Axis). Depending on the content of the request, the response may have a different XSD. So, the WSDL only specifies that the response is of a generic XSD, and the responses comply to XSDs that import and extend the generic XSD.
Unfortunately, the Schema assertion fail because the XSD specified in the WSDL can only the generic one. Is there a way to manually specify which XSD I want the assertion to use? For instance, depending on the request I prepare, I know the specific XSD of the response. So, it would be perfect if I could say to SoapUI to assert the response by that XSD, which I can store either locally or at a url.
So, is there a way to make a schema assertion using a locally (or remotely) stored XML schema?
Thanks,
Markos
What I did after all is that I created a simple class to do this in Java.I exported the project as a jar, imported it in Groovy and just called it.
This is normal, as both Java and Groovy both play on the JVM, so it is perfectly normal to call classes and methods from one another.

Resources