BizTalk runtime does not use imported XSD by schemalocation - xsd

I'm converting a XML from one XSD to another by using BizTalk maps. I have "schemalocation" import in one XSD just like below
<xs:import schemaLocation=".\CurrencySchema.xsd" namespace="http://Biztalk.CurrencySchema" />
I built this solution which includes two schemas and one BizTalk map. After I GACed it, İ have added the DLL to BizTalk assembly. There is no problem on this side.
The problem is beginning when I sent the XML to BizTalk for converting. While validation of this XML BizTalk gets error just like below.
System.Xml.Schema.XmlSchemaValidationException: Type 'http://Biztalk.CurrencySchema:curType' is not declared.
I checked the BizTalk schemas and maps from BizTalk application. Two schemas and one map uploaded correctly to BizTalk administration console.
I think BizTalk doesn't import the referenced XSD on validation process. I don't understand why.
Can someone tell me what is wrong?

Related

Automated validation of XSD files, not XML instances

I am looking for a programmatic solution to this, not asking about a tool.
Given a directory of XSD files with imports to other XSD files in that directory,
I would like to verify all required imports are present and the XSDs are valid XML.
My current manual process:
Open XML Spy
Start a new project
Add XSD files
'Validate XML' on all XSD files.
This gives error messages if there are issues or missing files.
How files are imported:
<xs:import schemaLocation="Other.xsd" namespace="Foo"/>
I'm looking for an automated way to achieve this, preferably without the overhead of XML Spy, so that this can be integrated in an automated test.
This is not about validation XML instances based on those XSD files, only about validating the XSD files and their dependencies.
It depends on the platform your are on, on .NET (with XSD 1.0) you have good support for checking schemas with XmlSchemaSet by loading/compiling them and checking for any warnings or errors, details are at https://learn.microsoft.com/en-us/dotnet/standard/data/xml/xmlschemaset-for-schema-compilation#compiling-schemas.
I think with Java there are different APIs but somehow similar functionality available.

BPEL apache ODe deploy

Could anyone point me how to deploy a BPEL in Apache Ode from java? Is there any convenient way to create the deploy.xml file and then deploy it? Creating it with plain XML and then saving to the process directory doesn't look nice.
For the deployment you can use the deployment API provided via Web service or the hot deployment (by copying the deployable to the processes directory).
There is no generator for the deploy.xml, however, the schema is straight-forward. ODE has a XMLBeans-based java object model in the bpel-schemas module (see org.apache.ode.bpel.dd.DeployDocument). The Eclipse BPEL designer also contains a EMF-based metamodel for the same schema and tries to guess some smart defaults based on the WSDLs used.

Mule ldap connector not working xsd issue

In mule ldap connector examples shows xsd available in the http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd. But runtime it shows error, as this xsd not existsing. I browsed http://www.mulesoft.org/schema/mule/ there is no ldap directory after that. Any change in the ldap connector support? Am I wrong using mulestudio(3.5)? I used demo application in the https://github.com/mulesoft/ldap-connector
I'm getting an error like this
org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 122; schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd'
It seems like the Mule LDAP conncetor is having support only for Mule 3.3.2 and Mule 3.4 versions.
Try changing the schema declaration to the below one.
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ldap
http://www.mulesoft.org/schema/mule/ldap/current/mule-ldap.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
If not try changing you Mule version to 3.4.
Please refer to the link below for more details
Mule LDAP Connector
Hope this helps.
Do you have the LDAP connector in your build path? XSDs are always present in your JARs but not always on the web. If you're using MuleStudio, all you need to do is to drag an LDAP message processor from the palette into your flow. Doing so will cause MuleStudio to load the necessary libraries for the LDAP connector and modify your namespaces accordingly.
Judging by the error that you posted, it seems that you are missing a JAR file from your build path. If you are using a Maven project, you can take a look here to learn how to add the necessary dependencies to your pom.xml file. If you're working with a normal Mule project, dragging and dropping an LDAP message processor into your flow should be enough.
I should mention that you need to install the LDAP connector in Mule Studio before you can use it. You can do so through the Cloud Connectors update site that comes bundled with Mule Studio. You can access this update site by going on Help > Install New Software and choosing it from the drop down list.
If you're interested in learning more on how to use Mule, we host a number of interesting blog posts on http://blog.ricston.com.

Why would the RIAServices.EntityFramework NuGet Package break context class code generation?

I have an existing project using RIAServices with Entity Framework. The project builds correctly and generates the AmsiWeb.g.cs file with all the context classes for my services.
I am converting my designer based entities and ObjectContext with Code First entities and DbContext. I installed the RIAServices.EntityFramework NuGet package to the web application that contains my services. However, now when I build the AmsiWeb.g.cs file only contains the WebContext class. It doesn't contain any generated services.
I have only at this point converted a single EDMX model to Code First and DbContext and made the requisite changes to the services that use that model to inherit from DbDomainService.
I am using EF 5.0... not sure if that matters cause I'm not sure how adding a DLL to the AmsiWeb application project would break code generation.
What would cause this to no longer work and how can I fix it?
Maybe it's a problem within the msbuild task that generates the proxy code (I mean the *.g.cs file). Probably it's looking for the wrong version of a entity framework. Have a look at this blog post http://mcasamento.blogspot.it/2012/10/entity-framework-5-code-first-and-wcf.html in the final part I wrote an assembly redirect statement that did the trick
It turns out that their needs to be a redirect for Entity Framework 5.0 (4.4.0.0 since I was using .Net 4.0) in the web.config. But, since my RIA Services were in a web application project that was not my root project the code wasn't generating.
Once I added the redirect to the web.config of the web application with the RIA services in it, the context code was correctly generated.

Multiple wsdl and xsd files... into a single wsdl

Probably is a straight-forward question: do you know any tools for combining multiple wsdl + xsd files into a single wsdl?
Thank you.
Edit1:
The service is a WCF service, and I want to have a single wsdl for PHP (as client).
Edit2:
Too bad I need to use .Net 4.0 and not 4.5 where this would be possible. Maybe I could borrow then one of the new MS tools? Do you know which one? Is the svcutil.exe the responsible tool? If yes, what are his dependencies? Because I don't want to jump to .Net 4.5 just yet.
You can build a small application that can generate a flat wsdl. We do generate flat wsdl programatically in C# for building interoperable WCF services. Refer to the link on how to generate flat wsdl.
Hopefully seeing the code you can build a tool that does it for you.
Else you can manually do it using Altova Xml Spy and replacing the xsd import attributes by the xsd schema definition.
For sure, I can recommend a tool that can combine multiple XSD files into the minimum set possible (I am biased here, since I wrote it). This in itself can be a heavy task, if you have a large number of files, many namespaces, or both. The things might get trickier for multiple WSDLs into one, depending on some parameters you may have configure; for example, is it logically one WSDL authored over three layers that maintains separation of messages - portTypes - services, or multiple WSDLs, period? One thing you must ensure is that all share the same types subsystem, there's no conflict for operations, etc. But even this is a task that could be achieved, I could easily put an addon out... If this is refactoring of XML Schemas and WSDLs you see doing often, let me know.
We wanted one wsdl file to make use of some tools to automatically generate soap proxy on PHP side. But we ended up writing the DTO layer manually.
If you have wcf service in .NET 4.5 you can get easily only one wsdl file (inbuilt feature of WCF framework).

Resources