How to access web service from SSRS? - web-services

I am using SSRS 2008 R2 and am very new to web services. I want to use the website:
https://geoservices.tamu.edu/Services/Geocode/WebService/GeocoderService_V04_01.asmx
in order to translate addresses into geography datatypes. How can I do this? I would like to automate this process if possible. I have found many websites which allow me to manually enter the addresses on their website, but I would like to be able to do this on my local desktop. However, the website above supposedly will let me connect a web service to my local machine in order to do this translation.
What are the steps I need to take in order to add this web reference? I tried following this website, but I haven't gotten it to work yet:
http://technet.microsoft.com/en-us/library/aa964129.aspx#repservxmlds_topic4
So I created an XML data source:
Then I created a new dataset using this datasource:
<Query>
<Method Name="GeocodeAddressParsed"
Namespace="https://geoservices.tamu.edu">
<Parameters>
<Parameter Name="City">
</Parameter>
</Parameters>
</Method>
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>
But when I ran this query in BIDS, I got the following errors:
The remote server returned an error: (500) Internal Server Error.
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request. ---> Unexpected or unimplemented census year: Unknown</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>
----------------------------
Failed to execute web request for the specified URL.
Soap Fault:
Server was unable to process request. ---> Unexpected or unimplemented census year: Unknown
So I tried adding the censusYear parameter, but I continued to get this same error. I also tried contacting ATM about this, but they were offline. However, I don't think i need to contact them since the Service Description and method details are listed online.
I created all of this in the same project and RDL as my report. I also tried creating this as a C# Console app. But I prefer to run this from this same RDL file if possible.
I do not know why this didn't work. I tried to simplify it as much as possible by only specifying one parameter.

Related

How to get rid of passing "username and password" in web service call to Pentaho transformation?

I have a requirement where 'XML-response' will be passed in web service call as parameter and it executes a transformation where XML is shredded.
I have designed the transformation in kettle and for accepting web-service request to execute transformation, Carte is up and running on my server.
So, From Server A, client is hitting web-service using URL which is something like below :
http://localhost:8081/kettle/executeTrans/?trans=C:\Carte-test\test_2.ktr&response_xml=<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<persons>
<person>
<id>1</id>
<firstname>Samatar</firstname>
</person>
</persons>
On Dev Server B, Carte is up and running and requisite transformation is executed.
But there is a glitch. How to pass "https"(secure connection) rather than "http" in the URL construct i.e. how to make the web service call secure.
My client is obstinate about it.
P.S - We are using "Pentaho 5.4 community edition and hence - no PDI :(" on server B and no Kettle Installation on Server A
Any suggestions!!
Since there is no notes in documentation how to run Carte most simple way to secure it is to run behind proxy.
Use some Apache, Nging, Caddy configure https protocol and configure proxy to Carte.
As well u can configure basic http authentication on webserver.
Yes, you can do that, and it is perfectly well documented on pentaho website. Here you have the instructions to setup a carte server with ssl :
https://help.pentaho.com/Documentation/6.0/0L0/0Y0/060/060/010#Configuring_Carte_Servers_for_SSL

Does the Navision (2009) Webservice support authentication to a remote database?

I'm currently attempting to deploy the Navision webservice (from Dynamics Navision 2009) and am finding that the webservice authenticates when connecting to a local Navision SQL database but NOT a remote Navision SQL database.
So we have servers S (with a full Navision install) and W (with only the Services installed). The CustomSettings.config file on these two systems is identical except that where S references localhost:
<add key="DatabaseServer" value="127.0.0.1"></add>
<add key="ClientCredentialType" value="Windows"></add>
W references S:
<add key="DatabaseServer" value="S"></add>
<add key="ClientCredentialType" value="Windows"></add>
(Other details omitted.) The webservice itself is running as the same domain user in both cases, and that user is authenticated within Navision.
When I connect to the webservice which is running on S, authentication works and the service proceeds as normal:
http://S:7047/DynamicsNAV/WS/Company/Codeunit/RLIntegartion
I'll omit the actual result here. When connecting via W instead:
http://W:7047/DynamicsNAV/WS/Company/Codeunit/RLIntegartion
the webservice instead returns XML indicating an authentication failure:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">
a:Microsoft.Dynamics.Nav.Types.NavDatabasePasswordException
</faultcode>
<faultstring xml:lang="en-US">
The login failed when connecting to SQL Server S.
</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
The login failed when connecting to SQL Server S.
</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
I can configure an ODBC connection on W to the Navision database on S and the connection succeeds and authenticates correctly, so the actual database connection and authentication appears to be fine.
I'm aware that the webservice itself must normally be accessed locally so that any files written can be read from where the Navision webservice has written them, but from what I can tell in the documentation the webservice may legitimately access the database from a separate server. However, in practice (per above) this doesn't seem to actually work.
Is this a restriction that Navision imposes? If not, does anyone have any suggestions as to why the webservice is failing to authenticate when accessing a remote database when the same webservice succeeds locally?
Or could it be a limitation imposed by the codeunit programmers? I've spoken to them and they indicate that this should work, but clearly it does not.
That is known problem of Nav 2009. In later versions it's working without additional tricks. To solve this you need to create SPN.
Me personally was not able to set it properly so I just always installed web service tier on the same server with SQL. In this case it works.
There are three participants in this scheme - DB, web service and the client (that connects to this service). The problem appears only when all these three participants are on three different machines.
This three-machine setup will work only if the following requirements are fulfilled:
1) your client is capable of using Kerberos authentication (e.g. Internet Explorer or .NET applications are capable, but Chrome or PHP applications are not)
2) you set up NAV to use Kerberos authentication (as opposed to NTLM) and you set up delegation.
Delegation is a process that allows NAV server (or web service) to take the authentication ticket that came from client and pass it to SQL Server. You need to explicitly allow this in Active Directory setup. For that you will need SPNs - they basically describe the subjects that take part in this delegation.
You may refer to these manuals to setup the whole thing:
MSDN Walkthrough: Installing the Three Tiers on Three Computers
MSDN How to: Configure Web Services with Delegation
NAV 2009 Web Services on a three machine setup
You can also revert to more simple setup of using two-machines setup. In this case, either NAV server and SQL server should be on the same machine, or NAV server and the web service client should be on the same machine. As an example of the latter, you may create a small custom web service which acts as a proxy for your calls, and publish it on the same machine as NAV server/web service.

Intercept SOAP request

I know this might sound like a duplicate but despite the number of result for this research, I couldn't manage to find a working answer..
I'm using a Java Web service built with Axis (the first one), running on Tomcat v5.5 and a .Net client with some Web reference (not the service reference).
What I want to do is to have a look on the outgoing request from my client, the soap enveloppe.
So far, I tried to use soapUI, great tool, helped me a lot for other thing, but the structure of my web service is quite complexe (array of complexe datatypes) so I have no idea on how I could give him some parameters, here is an exemple of the generated request :
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.main.gimaweb.itrec.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<web:televerserDocument soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<wsi xsi:type="urn:DocumentWSI" xmlns:urn="urn:DocumentWS">
<version xsi:type="xsd:string">?</version>
<documents xsi:type="doc:ArrayOf_tns1_DocumentWVO" soapenc:arrayType="urn:DocumentWVO[]" xmlns:doc="adress"/>
</wsi>
</web:televerserDocument>
</soapenv:Body>
</soapenv:Envelope>
But what i need is an array with data, so there is a lot of xml tag missing for that purpose. Maybe there is a way to generate a more complete sample request? (I don't know if I'm clear enough).
I also tried to use Fiddler, also a great tool but I never managed to get the soap enveloppe, I just got the WSDL from when I update the web reference.
I tried different kind of adresses like :
localhost:port
localhost.:port
ipv4.fiddler:port
hostname:port
But I guess the adress isn't the origin of the problem, I also used ISS Express instead of Visual Studio development server.
Finally, I tried to use some software named Membrane Moniter, but no way to get it, it's becoming quite old, maybe someone knows an alternative
Does someone have a clue on how to do this?
EDIT: And I also tried to use the TCP/IP Monitor on server side, but onece again, I only get the WSDL from the update on VS's side.. I do not really understand why.
EDIT: My Java Webservices are running on Tomcat v5.5, my ASP.Net client is a web application running on IIS Express

The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'

I am trying to program a VisualWebPart using Visual Studio 2010 which has to do a simple thing: invoke a web service (hosted in a remote server, NOT locally). When I execute within the Sharepoint site (version 2010, which I have published in my IIS) I get this error:
"The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'."
Pardon my ignorance, but the only difference here is the case of the Ntlm authentication scheme! I have been all over the web and found many related problems, but none of the solutions worked. Almost ALL solutions i found involve modifications in the webservice security configuration, this is not an option for me.
Looking for a solution, I created a sample windows form and invoked the web service from it: no problems whatsoever.
In order to be able to invoke the webservice correctly this is the necessary security configuration:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
I believe the problem is that I havenĀ“t been able to properly set this security property to the web.config of my Sharepoint site, since I tried to put it in the security tag that appears in the web.config but still get the same error.
Any further information needed please ask, I am REALLY desperate, for days I have been with the SAME error.
In the end I was given permissions in their server: more precisely in the database which was the one that wouldn't let me create the web part in the server. Once this was done, the call to the webservice worked just fine, because they have the web.config correctly configured.

Compact Framework - Invalid URI: Hostname could not be parsed

I'm writing a compact framework 3.5 application for a windows mobile device. In this application I'm consuming a web service in order to sync with our database. However, whenever I try to make a call to the web service from the device or the emulator, I get the following error: Invalid URI: Hostname could not be parsed. I'm connected to the network via R-NDIS. The service is running on my development machine right now, and I'm actually able to browse to the asmx page through pocket IE. What am I missing?
Thanks!
This might be a proxy problem. The following worked for me.
var service = new WebService.Service();
service.Proxy = GlobalProxySelection.GetEmptyWebProxy();
You might not be picking up the proxy server IE is using, or pocket IE might be displaying a cached version of the ASMX page (and thus not really able to access it either). Probably neither one of these is your problem, however.
Update: try putting this in your application's config file:
<configuration>
<system.net>
<defaultProxy>
<proxy autoDetect="true" />
</defaultProxy>
</system.net>
</configuration>