Can you tell what kind of database is the WSDL using? - database

Can you tell what kind of database is the WSDL using? The reason for asking is the 3rd party only give me a url and and didnt tell me anything about the database. I requested them to give me the document to explain a bit but they never did.
I am new in this area and after some research, but i cannot sure what database (oracle?sql?xml?)
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="AccountService" targetNamespace="http:// local host/web/" xmlns:ns1="http://client.local host/web//" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://local host/web/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://local host/web/" xmlns:tns="local host/web/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="ArrayOfAccount">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Account" nillable="true" type="tns:Account"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Account">
<xsd:sequence>
<xsd:element minOccurs="0" name="currentbalance" nillable="true" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
The second question is, can i use .asp call out the element from the database directly?
The last question is, WSDL is just a set of policy (rules) telling the server to generate the result?

No, it is not possible to determine the internal implementation of a web service solely from it's WSDL.

For your questions:
You can't tell what sort of database, or even anything about the back-end of a Web service from the WSDL. It is specifically a descriptive document that shows what types of methods are available. It could be a Java based Web service, .Net, or whatever, and point to what ever database the Web service developer decided to use. The point of having a service model is that a client doesn't really need to know anything about the inner workings of a service it uses, just what functions you can call, and what sort of data it accepts, which is what the WSDL provides.
If you are hosting the Web service, then you would have the database and directions to set up the connection string. In that case, your ASP application "could" connect to the database, but it shouldn't, since it would defeat the purpose of having the service in the first place. It's better to update the service to include whatever functions you need. From your request though, it sounds like you have no control over the Web service, so you won't have any connection directly to the database. If the database were on the same network as your service, and there were no firewall policies blocking database connections, you could theoretically connect to the database the service uses. But, again, that would defeat the purpose of having the service.
WSDL is just an XML file that describes what the service can do. It doesn't actually do any work. The work is handled when you make an Http request with something like WebClient or HttpClient to a URL passing in the needed information. So, the WSDL may show in XML:
Method URL:
http://someURL/UpdateAccounts
Accepts Parameters:
Account
Then in your service you would code to post a request to
http://someURL/UpdateAccounts
passing in Account converted to XML.

A WSDL is a document describing a webservice, listing all the web methods, and their paramaters. It helps you build a client that can consume the webservice. It describes how you can communicate with the webservice. The webservice itself could be implemented anyway the creator wants, with or without a DB. They aren't related at all.

WSDL describes only the interface, like the function definition. Not the internals about the service. So no, you can not tell.

Related

Encapsulate backend specifics with custom Camel component that wraps existing component

We have different backends (mostly SOAP so I will focus on this) each with its own specifics (security, default timeout, error handling etc).
On the other hand we have a lot of integration services that orchestrate calls to these backends. For example "service A" first calls "backend 1" and then "backend 2" with SOAP requests. Finally it uses the responses of both backends to create a response.
There are a lot of services like "service A", each of them has an individual orchestration. Each of them is an individual project with its own repository and is deployed as a small Spring-Boot unit.
Let's say that 4 out of 10 services call "backend 1". They do not necessarily call the same service of "backend 1", but they all need to implement the specifics of this same backend. For example send special headers, a specific security token, use a retry strategy for this backend etc.
To avoid that every integration service repeats the specifics for "backend 1" or "backend 2", I would like to somehow encapsulate these specifics.
Because we use Apache Camel, I assume that I could do this with a custom Camel component. But because components typically integrate a new type of backend, I don't know if I should do this or if it is a bad idea. My backend types (for example SOAP) already exist as components, I would just wrap them with specifics.
For example to "encapsulate" a SOAP backend I could create a custom component that delegates to the CXF component to create concrete service endpoints with the common specifics of this backend (headers, security, etc).
In the Camel route the endpoints would perhaps look somehow like this
MyBackend://serviceUri?option1=value1
and under the hood it would create
cxf://serviceUri?backendSpecific1=valueA&backendSpecific2=valueB&option1=value1
Or are there other, better suited extension points to use for this use case?
There is a way to achieve this to some level. Its called endpoint reuse. Let me take you on how I typically tackle a problem like this.
I normally declare all my SOAP and JMS enpoints in my camel-context.xml. I then create xml files for each route and reference the endpoints defined in my camel-context.xml from there.
Here is a short example of my camel-context.xml note the routeContextRef element:
<bp:blueprint
xmlns="http://camel.apache.org/schema/blueprint"
xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0 http://aries.apache.org/schemas/blueprint-ext/blueprint-ext-1.2.xsd">
<camelContext id="foo-bar" trace="{{camel.context.trace}}" autoStartup="true" useMDCLogging="true" useBreadcrumb="true" depends-on="jms" threadNamePattern="#camelId#-thread-#counter#" managementNamePattern="#camelId#-#version#" allowUseOriginalMessage="false" streamCache="false">
<routeContextRef ref="foo-bar-routes"/>
<endpoint id="jms-gateway-v1" uri="jms:queue:Foo.Bar.System.Evt.1.0.T" />
<endpoint id="rs-gateway-v1" uri="cxfrs://bean://rs-gateway-impl-v1" />
</camelContext>
I then create a foo-bar-routes.xml and I reference the endpoint from there like so:
<bp:blueprint xmlns="http://camel.apache.org/schema/blueprint"
xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ers="http://www.fooxml.com/events/resourceitem/service/v1"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<routeContext id="foo-bar-routes">
<!--
This route receives an event from the JMS queue
-->
<route id="jms-gateway-route-v1">
<from ref="jms-gateway-v1" />
<to ref="rs-gateway-v1" />
</route>
</bp:blueprint>
So in short I wrap my SOAP and JMS components in endpoint definitions and then reuse these in routes that are defined in the own xml document. I could add a second route in another XML file and reuse the endpoint in that route just add, rinse and repeat.
I know the JavaDSL has similar functionality so it is achievable as well using the JavaDSL as well.

vCloud: Create and configure a vm in vApp

I am trying to deploy Virtual Machines from a template into a vApp using the vCloud rest API. I feel that there should be a way to configure a vm as I am spawning it (Since the UI seems to do that) but haven't found a way.
I've been focusing my efforts on recomposing a vApp to add a vm to it. The below example will add a vm but I haven't figured out to configure the vm until after it has been created. Specifically I want to set the VM Name, host name, and IP settings of the vm.
<?xml version="1.0" encoding="UTF-8"?>
<RecomposeVAppParams
xmlns="http://www.vmware.com/vcloud/v1.5"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
<SourcedItem sourceDelete="false">
<Source href="templateUri" />
</SourcedItem>
<AllEULAsAccepted>true</AllEULAsAccepted>
</RecomposeVAppParams>
After the vm is created I can reconfigure it but neither the network settings or host name actually change. The vCloud Director UI tells me they have changed but looking on the guest os shows that the settings have not changed.
Change host name example (doesn't work):
<vcloud:GuestCustomizationSection
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
href="vmUri/guestCustomizationSection/"
ovf:required="false"
type="application/vnd.vmware.vcloud.guestCustomizationSection+xml">
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<vcloud:ComputerName>newName</vcloud:ComputerName>
</vcloud:GuestCustomizationSection>
Has anyone been able to configure a VM as you deploy it. Otherwise does anyone know how to effectively configure settings of a VM after it has been deployed. Working XML examples would be amazing but I would still appreciate help in other forms.
The closest I have been able to come to this is to deploy a vApp from a catalog somewhat customizing it in the process. This is not exactly what you asked for, but I hope it helps.
<?xml version="1.0" encoding="UTF-8"?>
<InstantiateVAppTemplateParams
xmlns="http://www.vmware.com/vcloud/v1.5"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
name="<MyVappName"
deploy="false"
powerOn="false">
<Description>vApp I deployed through REST API...</Description>
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig networkName="App-Network-1">
<Configuration>
<ParentNetwork href="https://vcd-url/api/network/331a8ee3-33fd-4e4a-878e-1a6dce772fea" />
<FenceMode>bridged</FenceMode>
</Configuration>
</NetworkConfig>
</NetworkConfigSection>
</InstantiationParams>
<Source
href="https://vcd-url/api/vAppTemplate/vappTemplate-d11de298-3041-2ae2-5e81-3ac2b4255423" />
</InstantiateVAppTemplateParams>
Just use the SDK for this task. Download the example and the library. Add the library to proj and call function from there. The SDK has already and Utility library that handle the http communication with the vcloud creating the requests and serve the answers using serialization.
If you really want to do the request by yourself you just run the example in SDK put Fiddler to spy the communication and get the exact request and reproduce it.
I know because first time I have started making http request using the documentation and get in trouble.

Configuring Breeze web client to connect to remote breeze server with CORS support

We are envisioning a product that will have a web front end and mobile apps on multiple platforms (Xamarin). I've already turned a breeze angular hot towel example into a web front end. I am tasked with investigating splitting apart the breeze web client and the breeze server back end. The main reason for this is the mobile devs could potentially use breeze sharp to save their objects to the same breeze back end. It seems like a bad idea to have the breeze web client and server coupled so tightly. I duplicated the project and stripped out the necessary parts on each end to decouple them.
The part I can't figure out is how to get them to talk to each other again. I briefly looked into connectionString, but that doesn't seem to be the right answer. Any ideas on how to get them talking again would be appreciated.
Edit: 20140725 14:23
I've been trying to resolve this on and off since yesterday. I looked into connectionStrings in Web.config and found that that was dead end. Another post made me think that appSettings in Web.config.
I found a parameter in config.js named remoteServiceName. The previous value was "breeze/Breeze" I changed it to
'http://localhost:4545/breeze/Breeze'
The web client still fails:
Error retrieving data.Metadata query failed for: http://localhost:4545/breeze/Breeze/Metadata; HTTP response status 0 and no message. Likely did not or could not reach server. Is the server running? Error: Metadata query failed for: 'http://localhost:4545/breeze/Breeze/Metadata'; HTTP response status 0 and no message. Likely did not or could not reach server. Is the server running?'
When I run that link in its own tab I get metadata.
What did I strip out?: The breeze controller, models, repository (c# only), dbcontext, and BreezeWebApiConfig
Edit 20140725 14:52
Sorry I missed the exception before the one mentioned above:
XMLHttpRequest cannot load http://localhost:4545/breeze/Breeze/Metadata. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:53555' is therefore not allowed access.
Thank you to everyone for the clues you provided in the comments!
The first part of the answer I already included in my edits above:
I found a parameter in config.js named remoteServiceName. The previous value was "breeze/Breeze" I changed it to
'http://localhost:4545/breeze/Breeze'
That got the client talking attempting to talk to the remote server.
After that the CORS issue stumped me. The three following links helped me solve this issue:
Using Breeze with a WebApi Service from another domain
WebAPI CORS and Ninject
http://msdn.microsoft.com/en-us/magazine/dn532203.aspx
You have to install the CORS packages. From the microsoft article:
First, in order to get the CORS framework, you must reference the CORS libraries from your Web API application (they’re not referenced by default from any of the Web API templates in Visual Studio 2013). The Web API CORS framework is available via NuGet as the Microsoft.AspNet.WebApi.Cors package. If you’re not using NuGet, it’s also available as part of Visual Studio 2013, and you’ll need to reference two assemblies: System.Web.Http.Cors.dll and System.Web.Cors.dll (on my machine these are located in C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Stack 5\Packages).
The next step was to add a few lines to the config file from the webapi-cors-and-ninject stackoverflow post:
<system.webServer>
<handlers>
</handlers>
<httpProtocol>
<customHeaders>
<!-- Adding the following custom HttpHeader will help prevent CORS from stopping the Request-->
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>
</httpProtocol>
Obviously this is a very insecure solution and shouldn't be used for anything other than a development environment.

Exchange 2010 Impersonation trouble when requesting a User's Calendar Availability Details

I'm working on project where an external application is trying to get the availability info (Free/busy) along with the details (Location/Subject/etc) for group of users in Exchange 2010.
I've read enough that I think that the best way to do this is through a service account run by the application that impersonates the user in question and pulls back their calendar information.
I've set up impersonation for the service account and run the basic test that I found on technet: http://msdn.microsoft.com/en-us/library/bb204088(v=exchg.140).aspx
This works for pulling back the mailbox folder (as the example) and if try to pull back the calendar folder.
I also found how to get availability via technet:
http://msdn.microsoft.com/en-us/library/aa563800(v=exchg.140).aspx
which will also work if I login as the user that I'm trying to find the calendar info for.
The problem comes when I try to combine both the impersonation XML with the get availability. Here is what I have for the two combine:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrincipalName>[usersname#myorg.org]</t:PrincipalName>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Bias>300</Bias>
<StandardTime>
<Bias>0</Bias>
<Time>02:00:00</Time>
<DayOrder>1</DayOrder>
<Month>11</Month>
<DayOfWeek>Sunday</DayOfWeek>
</StandardTime>
<DaylightTime>
<Bias>-60</Bias>
<Time>02:00:00</Time>
<DayOrder>2</DayOrder>
<Month>3</Month>
<DayOfWeek>Sunday</DayOfWeek>
</DaylightTime>
</t:TimeZone>
<MailboxDataArray>
<t:MailboxData>
<t:Email>
<t:Address>[usersname#myorg.org]</t:Address>
</t:Email>
<t:AttendeeType>Required</t:AttendeeType>
<t:ExcludeConflicts>false</t:ExcludeConflicts>
</t:MailboxData>
</MailboxDataArray>
<t:FreeBusyViewOptions>
<t:TimeWindow>
<t:StartTime>2011-07-28T00:00:00</t:StartTime>
<t:EndTime>2011-07-28T23:59:59</t:EndTime>
</t:TimeWindow>
<t:MergedFreeBusyIntervalInMinutes>5</t:MergedFreeBusyIntervalInMinutes>
<t:RequestedView>DetailedMerged</t:RequestedView>
</t:FreeBusyViewOptions>
</GetUserAvailabilityRequest>
</soap:Body>
</soap:Envelope>
What I get back is this:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorProxyRequestNotAllowed</faultcode>
<faultstring xml:lang="en-US">Client context header found but no request type found in SOAP header.</faultstring>
<detail>
<m:ErrorCode xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">5015</m:ErrorCode>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Digging around a little more in technet, the ErrorProxyRequestNotAllowed info:
"This error indicates that the request that Exchange Web Services sent to another Client Access server when trying to fulfill a GetUserAvailability request was invalid. This response code typically indicates that a configuration or rights error has occurred, or that someone tried unsuccessfully to mimic an availability proxy request."
What I'm having trouble with, is how impersonation seems to be working in the cases where I'm pulling back the user's mail and calendar folders, but not working for the case where I want to check their availability.
Right now, I'm just sending the straight XML via curl (wrapped in a little python script).
Anyone have any pointers? Thanks in advance!
I finally found a few (old) references that this is known feature/bug with GetUser[blank]Request style calls and Impersonation.
The two just do not work together. I hope this save someone a little time.

Self Hosted ADO.NET Data Services, comsuming from an external Silverlight application

Issue:
An issue exists whereby I cannot access my Self Hosted ADO.NET Data Services from my RIA applications.
My services are hosted separately to the web projects with the Rich Internet Applications (RIA)s.
I need to enable access from separate Silverlight (and Flash) client apps.
From Silverlight I get an exception (see below) when I try to make a call to the ADO.NET Data Service (which is Self Hosted separately). This I believe to due to Silverlight forbidding the cross domain call.
System.InvalidOperationException: An error occurred while saving changes. See the inner exception for details. --->
System.Data.Services.Http.WebException: Internal error at 'HttpWebResponse.NormalizeResponseStatus'.
at System.Data.Services.Http.HttpWebResponse.NormalizeResponseStatus(Int32& statusCode)
at System.Data.Services.Http.HttpWebResponse..ctor(HttpWebRequest request, Int32 statusCode, String responseHeaders)
at System.Data.Services.Http.HttpWebRequest.CreateResponse()
at System.Data.Services.Http.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.QueryAsyncResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)
at Curo.Silverlight.MainPage.<>c__DisplayClass1.<.ctor>b__0(IAsyncResult ar)
at System.Data.Services.Client.BaseAsyncResult.HandleCompleted()
at System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)
at System.Data.Services.Http.HttpWebRequest.ReadyStateChanged()
System.Data.Services.Http.WebException: Internal error at 'HttpWebResponse.NormalizeResponseStatus'.
at System.Data.Services.Http.HttpWebResponse.NormalizeResponseStatus(Int32& statusCode)
at System.Data.Services.Http.HttpWebResponse..ctor(HttpWebRequest request, Int32 statusCode, String responseHeaders)
at System.Data.Services.Http.HttpWebRequest.CreateResponse()
at System.Data.Services.Http.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Data.Services.Client.QueryAsyncResult.AsyncEndGetResponse(IAsyncResult asyncResult)
Notes:
From what I have read, it appears that cross domain access is forbidden with regards to ADO.NET Data Services, which may result in my having to take another approach to the data access e.g. using a pure REST Framework..?
"The problem of Cross Domain ADO.NET
Data Services is more complex than it
sounds and it hasn't been solved.
I've discussed it with Microsoft for a
while now and the reason that it
doesn't work has to do with its using
a browser level transport and that
transport doesn't allow cross-site
scripting."
See:
http://forums.silverlight.net/forums/p/70925/170703.aspx#170703
I understand that I need may need to expose a ClientAccessPolicy.xml file which will define the access rules whilst restricting cross site scripting.
It is also noteworthy to mention that the RIA applications will be running on the same LAN.
Questions:
Is there a viable means for me to access the services from my RIA clients considering they will be running behind the same firewall? If so how?
How do I expose ClientAccessPolicy.xml from a Self Hosted ADO.NET Data Service exactly?
What way would you recommend proceeding in order to allow external access to my services?
- Different REST Framework?
- Host Services within same web project at the cost of separation?
- Any other advice...
Thanks.
I'm not sure I understand the full breadth of your problem, but at the very least, I would make sure I had a clientaccesspolicy.xml file and a crossdomain.xml file in the root folder of the service. It's important for the xml policy files to be in the root folder of the domain. For example, if your service is hosted in mycompany.com/services, the xml files need to be in the mycompany.com folder, not the services folder.
Here's an example of the ClientAccessPolicy.xml:
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
And here's an example of the crossdomain.xml:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="*" />
</cross-domain-policy>
I would recommend using both files for both flash and silverlight. Both files above will allow open access from all flash and silverlight apps, but that shouldn't be a problem if you're behind a firewall.
I had this exact problem in one of my behind-the-firewall silverlight apps and putting these files in place seemed to fix the problem. I would start with these files and go from there.
"The problem of Cross Domain ADO.NET Data Services is more complex than it sounds and it hasn't been solved. I've discussed it with Microsoft for a while now and the reason that it doesn't work has to do with its using a browser level transport and that transport doesn't allow cross-site scripting."
See: http://forums.silverlight.net/forums/p/70925/170703.aspx#170703
The cross domain policy is required by (as shown in the answer by Ben McCormack above).
By utilizing Yahoo pipes which is set up to allow cross domain access to aggregated feeds, you may be able to consume and external ADO.NET Data Services (formerly Astoria, now OData) from within a Silverlight application.
You will most likely lose the fidelity of querying the dataset that Odata gives you, but this could be recreated in the yahoo pipes.
The issue was not with the ADO.NET data services (OData), its was with Silverlight as does not allow cross domain calls.

Resources