Is it possible to generate SOAP message from XSD file? - soap

Is it possible to generate programmatically SOAP message from XSD file and if so how to do it?

For some reason, this fell through the cracks... Below is one possible way of doing it.
The setup consists of two main components:
Aquiring of an XML document based on the XSD
Generation of the SOAP envelope and any other SOAP headers you may wish to add.
Creation of the XML may vary, based on more specific requirements; it can range from creating samples as described by this MSDN article, to Excel spreadsheets, databases, etc.
To create the SOAP Envelope, all you need is one of the System.ServiceModel.Channels.Message.CreateMessage methods.

Related

Is there any functionality similar to "Schema Compliance" and "SOAP Response" as in Ready API in Karate? [duplicate]

Is it possible to use WSDL in rest assured, I'm looking for open source API automation testing tool. My services are in WSDL, I can use SOAPUI which will extract wsdl into separate end points. but Is there any way can we extract end in WSDL manually or else how I can use this with Karate or Rest Assured.
As the author of Karate, let me give you my point of view.
You don't need to worry about WSDL. All you need is a sample SOAP envelope as XML (plain-text) and you will be easily able to derive all your tests, complex scenarios and edge cases with that. This is what many teams are doing today, and you can refer this detailed set of examples to get a sense of the possibilities: xml.feature
Even if you have some complexities like encryption and signed-headers etc, you can easily plug them into your tests using Java-interop, look at this example in the documentation: https://github.com/intuit/karate#http-basic-authentication-example

Sample WSDL File Download

May I know where to download sample WSDL file? From what i know, there is a UDDI publishes over the internet which searchable by any users.
Please help. Thanks.
i can provide you upto 5 working wsdls built in .net and magento.
This is the site where you can analyze and test the wsdls.wsdl-analyzer-Link
here are the links where you can view or download the wsdls
sample
Most services publish the wsdl at the same location as the service by adding ?wsdl to the URL. You can also get xsd with the ?xsd querying
For an example, any random WSDL will not do. You would want to have one which uses the most important features, which works out of the box with most software stacks.
I've written an example WDSL as part of a test library which should fulfill most the above criteria:
Standard compatibility form (can't remember the exact name) for cross-platform tooling support. Notably, one Element for each request/response type.
Request headers
SOAP Faults
XSD in its own file
not covered is
Response header (rare)
MTOM

SOAP based WebServices and WSDL

I have a SOAP based WebServices that I should consume. The WSDL file for this service contains 50 different operations and is 1000 lines in content. Out of these 50 different operations, I only use a handful of them. So here are my questions:
Can I trim this WSDL down to the set of services that I need? I can then keep a local copy of this WSDL and do the code generation when building my project.
Are there any potential dis-advatages of using this approach to trim the WSDL on the client?
Is there any good Scala based libraries that I could use?
Can I trim this WSDL down to the set of services that I need?
Yes. I've done exactly this before
Are there any potential dis-advatages of using this approach to trim
the WSDL on the client?
Depends. If you're building a client library for use by other code, you've just limited what they can do. If it's all your code, it makes it more of a pain if you find you need to add one to that handful of methods you need.
If the WSDL gets updated and re-released, you have to do your edits again.
And any change you made to the WSDL always introduces the chance of an error
Is there any good Scala based libraries that I could use?
Asking for recommendations for libraries is off topic. However, scalaxb maybe?

How to add custom automatic generated topics in Sandcastle

Does anyone know how to add custom reference topics to a Sandcastle help file?
I have a .net wcf rest service library and I want to produce reference documentation for the rest API as they are seen from an http client point of view.
For example:
Instead of methods within classes I would like to expose endpoint uris within a service.
Instead of request method parameters I would like them listed in a table indicating if they are query string parameters
For .net dto classes I want them listed in a JSON like fashion.
I know I had to customize some presentation xsl styles in Sandcastle, but first of all I do not know how to add those custom topics and inject the xsl transforms to generate content for those topics, within Sandcastle Help Builder build process?
I know there is support to add conceptual topics, but their content seems targeted to be manually generated and from which you can add references to automatic generated documentation with codeEntityRefferences or am I missing something here?

What's causing this SoapMapper error in VBA Soap Service call?

I'm trying to consume a Java based SOAP web service from VBA code in an Excel 2003 workbook. There are two methods available. One retrieves data, the other uploads data. The service for retrieving data works fine. However, when we try to upload data, we're running into a strange error that I just cannot find good information about on Google. The error message is:
Run-time error '-2147221504 (800040000)';
SoapMapper: Putting data into SoapMapper element failed
If we try to consume the same web service from a .NET application, it looks like the generated classes and methods are slightly different. For example, the fetch data service call takes a DataContainer object which has some identifying properties to determine what data to get. Then it returns the same type of object with the data filled in.
In the VBA classes generated by the Web Reference Toolkit, both fetch and save take the same type of object. But in .NET, the save takes a SaveDataContainerDetails object.
So a couple questions really:
Has anyone seen the SoapMapper error before in their VBA work?
Has anyone seen .NET and VBA generate different method signatures from the same WSDL? What could cause that and how could I work around it?
Is there a better way to call SOAP services from VBA rather than using the Web Reference Toolkit and the SOAP Toolkit?
I've figured out the issue here. The VBA Soap Toolkit and Web References Toolkit just can't handle array's of complex types. The error message above was somewhat misleading because "element" was actually the name of the XML element in the Soap envelope. So it was failing to put data into an element called "element". That was masking the issue a bit.
So I've determined it all boiled down to arrays of complex types. I've also determined that it's MUCH easier to just craft the soap envelopes my self in the VBA. The XML required is generally pretty well structured and not too difficult to create and or parse. So, if you're having trouble with the Soap Toolkit or the Web References Toolkit in VBA... just don't use it! :)
The best way to consume web services from VBA, VBSCRIPT, Classic ASP, etc. is to create your client using .NET. Then turn your client into a COM object. These are easily consumed by these older technologies.